Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -18,18 +68,69 @@
   38     38   
pub(crate) mod shape_put_snapshot_block_input;
   39     39   
   40     40   
pub(crate) mod shape_put_snapshot_block_output;
   41     41   
   42     42   
pub(crate) mod shape_request_throttled_exception;
   43     43   
   44     44   
pub(crate) mod shape_resource_not_found_exception;
   45     45   
   46     46   
pub(crate) mod shape_service_quota_exceeded_exception;
   47     47   
          48  +
/* JsonParserGenerator.kt:227 */
   48     49   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   49     50   
    if data.is_empty() {
   50     51   
        b"{}"
   51     52   
    } else {
   52     53   
        data
   53     54   
    }
   54     55   
}
   55     56   
   56     57   
pub(crate) mod shape_start_snapshot_output;
   57     58   

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

@@ -1,1 +26,40 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_access_denied_exception_error(
    3      4   
    value: &crate::error::AccessDeniedException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_access_denied_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::AccessDeniedException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.message {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("Message").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* SerializerUtil.kt:42 */
   22     32   
    {
          33  +
        /* JsonSerializerGenerator.kt:423 */
   23     34   
        object.key("Reason").string(input.reason.as_str());
          35  +
        /* SerializerUtil.kt:42 */
   24     36   
    }
          37  +
    /* JsonSerializerGenerator.kt:372 */
   25     38   
    Ok(())
          39  +
    /* JsonSerializerGenerator.kt:358 */
   26     40   
}

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

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

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

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

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

@@ -1,1 +257,347 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_complete_snapshot_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::CompleteSnapshotInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::complete_snapshot_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   22     30   
        if let Some(value) =
   23     31   
            crate::protocol_serde::shape_complete_snapshot_input::de_changed_blocks_count_header(
   24     32   
                &headers,
   25     33   
            )?
   26     34   
        {
   27     35   
            input = input.set_changed_blocks_count(value)
   28     36   
        }
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   29     38   
        if let Some(value) =
   30     39   
            crate::protocol_serde::shape_complete_snapshot_input::de_checksum_header(&headers)?
   31     40   
        {
   32     41   
            input = input.set_checksum(Some(value))
   33     42   
        }
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   34     44   
        if let Some(value) = crate::protocol_serde::shape_complete_snapshot_input::de_checksum_aggregation_method_header(&headers)? {
   35     45   
                                input = input.set_checksum_aggregation_method(Some(value))
   36     46   
                            }
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   37     48   
        if let Some(value) =
   38     49   
            crate::protocol_serde::shape_complete_snapshot_input::de_checksum_algorithm_header(
   39     50   
                &headers,
   40     51   
            )?
   41     52   
        {
   42     53   
            input = input.set_checksum_algorithm(Some(value))
   43     54   
        }
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   44     56   
        let input_string = uri.path();
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   45     58   
        let (input_string, (_, _, m2)) =
   46     59   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   47     60   
                ::nom::sequence::preceded(
   48     61   
                    ::nom::bytes::complete::tag("/"),
   49     62   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("snapshots"),
   50     63   
                ),
   51     64   
                ::nom::sequence::preceded(
   52     65   
                    ::nom::bytes::complete::tag("/"),
   53     66   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("completion"),
   54     67   
                ),
   55     68   
                ::nom::sequence::preceded(
   56     69   
                    ::nom::bytes::complete::tag("/"),
   57     70   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   58     71   
                        ::nom::bytes::complete::take_until("/"),
   59     72   
                        ::nom::combinator::rest,
   60     73   
                    )),
   61     74   
                ),
   62     75   
            ))(input_string)?;
   63     76   
        debug_assert_eq!("", input_string);
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   64     78   
        input = input.set_snapshot_id(
   65     79   
            crate::protocol_serde::shape_complete_snapshot_input::de_snapshot_id(m2)?,
   66     80   
        );
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   67     82   
        input.build()?
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   68     84   
    })
          85  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   69     86   
}
   70     87   
          88  +
/* RustType.kt:516 */
   71     89   
#[allow(clippy::unnecessary_wraps)]
          90  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   72     91   
pub fn ser_complete_snapshot_http_response(
   73     92   
    #[allow(unused_variables)] output: crate::output::CompleteSnapshotOutput,
   74     93   
) -> std::result::Result<
   75     94   
    ::aws_smithy_http_server::response::Response,
   76     95   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   77     96   
> {
          97  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   78     98   
    Ok({
          99  +
        /* RustType.kt:516 */
   79    100   
        #[allow(unused_mut)]
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   80    102   
        let mut builder = ::http::Response::builder();
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   81    104   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    105   
            builder,
   83    106   
            ::http::header::CONTENT_TYPE,
   84    107   
            "application/json",
   85    108   
        );
         109  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   86    110   
        let http_status: u16 = 202;
   87    111   
        builder = builder.status(http_status);
         112  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   88    113   
        let payload =
   89         -
            crate::protocol_serde::shape_complete_snapshot_output::ser_complete_snapshot_output_output_output(&output)?
   90         -
        ;
         114  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_complete_snapshot_output::ser_complete_snapshot_output_output_output(&output)?
         115  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
         116  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   91    117   
        let content_length = payload.len();
   92    118   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93    119   
            builder,
   94    120   
            ::http::header::CONTENT_LENGTH,
   95    121   
            content_length,
   96    122   
        );
         123  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   97    124   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         125  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   98    126   
        builder.body(body)?
         127  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   99    128   
    })
         129  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
  100    130   
}
  101    131   
         132  +
/* RustType.kt:516 */
  102    133   
#[allow(clippy::unnecessary_wraps)]
         134  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
  103    135   
pub fn ser_complete_snapshot_http_error(
  104    136   
    error: &crate::error::CompleteSnapshotError,
  105    137   
) -> std::result::Result<
  106    138   
    ::aws_smithy_http_server::response::Response,
  107    139   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  108    140   
> {
         141  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
  109    142   
    Ok({
         143  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
  110    144   
        match error {
         145  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  111    146   
            crate::error::CompleteSnapshotError::InternalServerException(output) => {
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  112    148   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         149  +
                /* RustType.kt:516 */
  113    150   
                #[allow(unused_mut)]
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  114    152   
                let mut builder = ::http::Response::builder();
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  115    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    155   
                    builder,
  117    156   
                    ::http::header::CONTENT_TYPE,
  118    157   
                    "application/json",
  119    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  120    160   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  121    161   
                    builder,
  122    162   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  123    163   
                    "InternalServerException",
  124    164   
                );
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  125    166   
                let content_length = payload.len();
  126    167   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  127    168   
                    builder,
  128    169   
                    ::http::header::CONTENT_LENGTH,
  129    170   
                    content_length,
  130    171   
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  131    173   
                builder
  132    174   
                    .status(500)
  133    175   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  134    177   
            }
         178  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  135    179   
            crate::error::CompleteSnapshotError::ResourceNotFoundException(output) => {
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  136    181   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         182  +
                /* RustType.kt:516 */
  137    183   
                #[allow(unused_mut)]
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  138    185   
                let mut builder = ::http::Response::builder();
         186  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  139    187   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  140    188   
                    builder,
  141    189   
                    ::http::header::CONTENT_TYPE,
  142    190   
                    "application/json",
  143    191   
                );
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  144    193   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  145    194   
                    builder,
  146    195   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  147    196   
                    "ResourceNotFoundException",
  148    197   
                );
         198  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  149    199   
                let content_length = payload.len();
  150    200   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  151    201   
                    builder,
  152    202   
                    ::http::header::CONTENT_LENGTH,
  153    203   
                    content_length,
  154    204   
                );
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  155    206   
                builder
  156    207   
                    .status(404)
  157    208   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         209  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  158    210   
            }
         211  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  159    212   
            crate::error::CompleteSnapshotError::AccessDeniedException(output) => {
         213  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  160    214   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         215  +
                /* RustType.kt:516 */
  161    216   
                #[allow(unused_mut)]
         217  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  162    218   
                let mut builder = ::http::Response::builder();
         219  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  163    220   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  164    221   
                    builder,
  165    222   
                    ::http::header::CONTENT_TYPE,
  166    223   
                    "application/json",
  167    224   
                );
         225  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  168    226   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  169    227   
                    builder,
  170    228   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  171    229   
                    "AccessDeniedException",
  172    230   
                );
         231  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  173    232   
                let content_length = payload.len();
  174    233   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  175    234   
                    builder,
  176    235   
                    ::http::header::CONTENT_LENGTH,
  177    236   
                    content_length,
  178    237   
                );
         238  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  179    239   
                builder
  180    240   
                    .status(403)
  181    241   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         242  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  182    243   
            }
         244  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  183    245   
            crate::error::CompleteSnapshotError::RequestThrottledException(output) => {
         246  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  184    247   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         248  +
                /* RustType.kt:516 */
  185    249   
                #[allow(unused_mut)]
         250  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  186    251   
                let mut builder = ::http::Response::builder();
         252  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  187    253   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  188    254   
                    builder,
  189    255   
                    ::http::header::CONTENT_TYPE,
  190    256   
                    "application/json",
  191    257   
                );
         258  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  192    259   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  193    260   
                    builder,
  194    261   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  195    262   
                    "RequestThrottledException",
  196    263   
                );
         264  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  197    265   
                let content_length = payload.len();
  198    266   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  199    267   
                    builder,
  200    268   
                    ::http::header::CONTENT_LENGTH,
  201    269   
                    content_length,
  202    270   
                );
         271  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  203    272   
                builder
  204    273   
                    .status(400)
  205    274   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         275  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  206    276   
            }
         277  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  207    278   
            crate::error::CompleteSnapshotError::ServiceQuotaExceededException(output) => {
         279  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  208    280   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         281  +
                /* RustType.kt:516 */
  209    282   
                #[allow(unused_mut)]
         283  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  210    284   
                let mut builder = ::http::Response::builder();
         285  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  211    286   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  212    287   
                    builder,
  213    288   
                    ::http::header::CONTENT_TYPE,
  214    289   
                    "application/json",
  215    290   
                );
         291  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  216    292   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  217    293   
                    builder,
  218    294   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  219    295   
                    "ServiceQuotaExceededException",
  220    296   
                );
         297  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  221    298   
                let content_length = payload.len();
  222    299   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  223    300   
                    builder,
  224    301   
                    ::http::header::CONTENT_LENGTH,
  225    302   
                    content_length,
  226    303   
                );
         304  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  227    305   
                builder
  228    306   
                    .status(402)
  229    307   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         308  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  230    309   
            }
         310  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  231    311   
            crate::error::CompleteSnapshotError::ValidationException(output) => {
         312  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  232    313   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         314  +
                /* RustType.kt:516 */
  233    315   
                #[allow(unused_mut)]
         316  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  234    317   
                let mut builder = ::http::Response::builder();
         318  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  235    319   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  236    320   
                    builder,
  237    321   
                    ::http::header::CONTENT_TYPE,
  238    322   
                    "application/json",
  239    323   
                );
         324  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  240    325   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  241    326   
                    builder,
  242    327   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  243    328   
                    "ValidationException",
  244    329   
                );
         330  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  245    331   
                let content_length = payload.len();
  246    332   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  247    333   
                    builder,
  248    334   
                    ::http::header::CONTENT_LENGTH,
  249    335   
                    content_length,
  250    336   
                );
         337  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  251    338   
                builder
  252    339   
                    .status(400)
  253    340   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  254         -
            }
         341  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         342  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  255    343   
        }
         344  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  256    345   
    })
         346  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  257    347   
}

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

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

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

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_complete_snapshot_output_output_output(
    3      4   
    value: &crate::output::CompleteSnapshotOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_complete_snapshot_output::ser_complete_snapshot_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_complete_snapshot_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::CompleteSnapshotOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.status {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("Status").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

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

@@ -1,1 +20,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_concurrent_limit_exceeded_exception_error(
    3      4   
    value: &crate::error::ConcurrentLimitExceededException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_concurrent_limit_exceeded_exception::ser_concurrent_limit_exceeded_exception(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_concurrent_limit_exceeded_exception(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::error::ConcurrentLimitExceededException,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.message {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object.key("Message").string(var_1.as_str());
          26  +
        /* JsonSerializerGenerator.kt:382 */
   18     27   
    }
          28  +
    /* JsonSerializerGenerator.kt:372 */
   19     29   
    Ok(())
          30  +
    /* JsonSerializerGenerator.kt:358 */
   20     31   
}

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

@@ -1,1 +20,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_conflict_exception_error(
    3      4   
    value: &crate::error::ConflictException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_conflict_exception::ser_conflict_exception(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_conflict_exception(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::error::ConflictException,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.message {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object.key("Message").string(var_1.as_str());
          26  +
        /* JsonSerializerGenerator.kt:382 */
   18     27   
    }
          28  +
    /* JsonSerializerGenerator.kt:372 */
   19     29   
    Ok(())
          30  +
    /* JsonSerializerGenerator.kt:358 */
   20     31   
}

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

@@ -1,1 +311,424 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_get_snapshot_block_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetSnapshotBlockInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_snapshot_block_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (_, m1, _, m3)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("snapshots"),
   28     37   
                ),
   29     38   
                ::nom::sequence::preceded(
   30     39   
                    ::nom::bytes::complete::tag("/"),
   31     40   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   32     41   
                        ::nom::bytes::complete::take_until("/"),
   33     42   
                        ::nom::combinator::rest,
   34     43   
                    )),
   35     44   
                ),
   36     45   
                ::nom::sequence::preceded(
   37     46   
                    ::nom::bytes::complete::tag("/"),
   38     47   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("blocks"),
   39     48   
                ),
   40     49   
                ::nom::sequence::preceded(
   41     50   
                    ::nom::bytes::complete::tag("/"),
   42     51   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   43     52   
                        ::nom::bytes::complete::take_until("/"),
   44     53   
                        ::nom::combinator::rest,
   45     54   
                    )),
   46     55   
                ),
   47     56   
            ))(input_string)?;
   48     57   
        debug_assert_eq!("", input_string);
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   49     59   
        input = input.set_snapshot_id(
   50     60   
            crate::protocol_serde::shape_get_snapshot_block_input::de_snapshot_id(m1)?,
   51     61   
        );
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   52     63   
        input = input.set_block_index(
   53     64   
            crate::protocol_serde::shape_get_snapshot_block_input::de_block_index(m3)?,
   54     65   
        );
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   55     67   
        let query_string = uri.query().unwrap_or("");
   56     68   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   57     70   
        let mut block_token_seen = false;
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   58     72   
        for (k, v) in pairs {
          73  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   59     74   
            if !block_token_seen && k == "blockToken" {
   60     75   
                input = input.set_block_token(
   61     76   
                    crate::protocol_serde::shape_get_snapshot_block_input::de_block_token(&v)?,
   62     77   
                );
   63     78   
                block_token_seen = true;
   64     79   
            }
          80  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   65     81   
        }
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   66     83   
        input.build()?
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   67     85   
    })
          86  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   68     87   
}
   69     88   
          89  +
/* RustType.kt:516 */
   70     90   
#[allow(clippy::unnecessary_wraps)]
          91  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   71     92   
pub fn ser_get_snapshot_block_http_response(
   72     93   
    #[allow(unused_variables)] output: crate::output::GetSnapshotBlockOutput,
   73     94   
) -> std::result::Result<
   74     95   
    ::aws_smithy_http_server::response::Response,
   75     96   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76     97   
> {
          98  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   77     99   
    Ok({
         100  +
        /* RustType.kt:516 */
   78    101   
        #[allow(unused_mut)]
         102  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   79    103   
        let mut builder = ::http::Response::builder();
         104  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   80    105   
        builder = crate::protocol_serde::shape_get_snapshot_block::ser_get_snapshot_block_headers(
   81    106   
            &output, builder,
   82    107   
        )?;
         108  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   83    109   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    110   
            builder,
   85    111   
            ::http::header::CONTENT_TYPE,
   86    112   
            "application/octet-stream",
   87    113   
        );
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   88    115   
        let http_status: u16 = 200;
   89    116   
        builder = builder.status(http_status);
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   90    118   
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::Body::wrap_stream(
   91         -
            ::aws_smithy_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         -
        ));
         119  +
            /* ServerProtocolLoader.kt:36 */::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
         120  +
                /* HttpBoundProtocolPayloadGenerator.kt:350 */crate::protocol_serde::shape_get_snapshot_block_output::ser_block_data_http_payload( output.block_data)?
         121  +
            /* ServerProtocolLoader.kt:36 */)
         122  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */));
         123  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   95    124   
        builder.body(body)?
         125  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   96    126   
    })
         127  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   97    128   
}
   98    129   
         130  +
/* RustType.kt:516 */
   99    131   
#[allow(clippy::unnecessary_wraps)]
         132  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
  100    133   
pub fn ser_get_snapshot_block_http_error(
  101    134   
    error: &crate::error::GetSnapshotBlockError,
  102    135   
) -> std::result::Result<
  103    136   
    ::aws_smithy_http_server::response::Response,
  104    137   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  105    138   
> {
         139  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
  106    140   
    Ok({
         141  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
  107    142   
        match error {
         143  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  108    144   
            crate::error::GetSnapshotBlockError::InternalServerException(output) => {
         145  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  109    146   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         147  +
                /* RustType.kt:516 */
  110    148   
                #[allow(unused_mut)]
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  111    150   
                let mut builder = ::http::Response::builder();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  112    152   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  113    153   
                    builder,
  114    154   
                    ::http::header::CONTENT_TYPE,
  115    155   
                    "application/octet-stream",
  116    156   
                );
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  117    158   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    159   
                    builder,
  119    160   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  120    161   
                    "InternalServerException",
  121    162   
                );
         163  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  122    164   
                let content_length = payload.len();
  123    165   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    166   
                    builder,
  125    167   
                    ::http::header::CONTENT_LENGTH,
  126    168   
                    content_length,
  127    169   
                );
         170  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  128    171   
                builder
  129    172   
                    .status(500)
  130    173   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         174  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  131    175   
            }
         176  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  132    177   
            crate::error::GetSnapshotBlockError::ResourceNotFoundException(output) => {
         178  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  133    179   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         180  +
                /* RustType.kt:516 */
  134    181   
                #[allow(unused_mut)]
         182  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  135    183   
                let mut builder = ::http::Response::builder();
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  136    185   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  137    186   
                    builder,
  138    187   
                    ::http::header::CONTENT_TYPE,
  139    188   
                    "application/octet-stream",
  140    189   
                );
         190  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  141    191   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    192   
                    builder,
  143    193   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  144    194   
                    "ResourceNotFoundException",
  145    195   
                );
         196  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  146    197   
                let content_length = payload.len();
  147    198   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  148    199   
                    builder,
  149    200   
                    ::http::header::CONTENT_LENGTH,
  150    201   
                    content_length,
  151    202   
                );
         203  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  152    204   
                builder
  153    205   
                    .status(404)
  154    206   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         207  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  155    208   
            }
         209  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  156    210   
            crate::error::GetSnapshotBlockError::AccessDeniedException(output) => {
         211  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  157    212   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         213  +
                /* RustType.kt:516 */
  158    214   
                #[allow(unused_mut)]
         215  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  159    216   
                let mut builder = ::http::Response::builder();
         217  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  160    218   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  161    219   
                    builder,
  162    220   
                    ::http::header::CONTENT_TYPE,
  163    221   
                    "application/octet-stream",
  164    222   
                );
         223  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  165    224   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  166    225   
                    builder,
  167    226   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  168    227   
                    "AccessDeniedException",
  169    228   
                );
         229  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  170    230   
                let content_length = payload.len();
  171    231   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  172    232   
                    builder,
  173    233   
                    ::http::header::CONTENT_LENGTH,
  174    234   
                    content_length,
  175    235   
                );
         236  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  176    237   
                builder
  177    238   
                    .status(403)
  178    239   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         240  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  179    241   
            }
         242  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  180    243   
            crate::error::GetSnapshotBlockError::RequestThrottledException(output) => {
         244  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  181    245   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         246  +
                /* RustType.kt:516 */
  182    247   
                #[allow(unused_mut)]
         248  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  183    249   
                let mut builder = ::http::Response::builder();
         250  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  184    251   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  185    252   
                    builder,
  186    253   
                    ::http::header::CONTENT_TYPE,
  187    254   
                    "application/octet-stream",
  188    255   
                );
         256  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  189    257   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  190    258   
                    builder,
  191    259   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  192    260   
                    "RequestThrottledException",
  193    261   
                );
         262  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  194    263   
                let content_length = payload.len();
  195    264   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  196    265   
                    builder,
  197    266   
                    ::http::header::CONTENT_LENGTH,
  198    267   
                    content_length,
  199    268   
                );
         269  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  200    270   
                builder
  201    271   
                    .status(400)
  202    272   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         273  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  203    274   
            }
         275  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  204    276   
            crate::error::GetSnapshotBlockError::ServiceQuotaExceededException(output) => {
         277  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  205    278   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         279  +
                /* RustType.kt:516 */
  206    280   
                #[allow(unused_mut)]
         281  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  207    282   
                let mut builder = ::http::Response::builder();
         283  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  208    284   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  209    285   
                    builder,
  210    286   
                    ::http::header::CONTENT_TYPE,
  211    287   
                    "application/octet-stream",
  212    288   
                );
         289  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  213    290   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  214    291   
                    builder,
  215    292   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  216    293   
                    "ServiceQuotaExceededException",
  217    294   
                );
         295  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  218    296   
                let content_length = payload.len();
  219    297   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  220    298   
                    builder,
  221    299   
                    ::http::header::CONTENT_LENGTH,
  222    300   
                    content_length,
  223    301   
                );
         302  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  224    303   
                builder
  225    304   
                    .status(402)
  226    305   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         306  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  227    307   
            }
         308  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  228    309   
            crate::error::GetSnapshotBlockError::ValidationException(output) => {
         310  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  229    311   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         312  +
                /* RustType.kt:516 */
  230    313   
                #[allow(unused_mut)]
         314  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  231    315   
                let mut builder = ::http::Response::builder();
         316  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  232    317   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  233    318   
                    builder,
  234    319   
                    ::http::header::CONTENT_TYPE,
  235    320   
                    "application/octet-stream",
  236    321   
                );
         322  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  237    323   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  238    324   
                    builder,
  239    325   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  240    326   
                    "ValidationException",
  241    327   
                );
         328  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  242    329   
                let content_length = payload.len();
  243    330   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  244    331   
                    builder,
  245    332   
                    ::http::header::CONTENT_LENGTH,
  246    333   
                    content_length,
  247    334   
                );
         335  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  248    336   
                builder
  249    337   
                    .status(400)
  250    338   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  251         -
            }
         339  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         340  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  252    341   
        }
         342  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  253    343   
    })
         344  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  254    345   
}
  255    346   
         347  +
/* HttpBindingGenerator.kt:542 */
  256    348   
pub fn ser_get_snapshot_block_headers(
  257    349   
    input: &crate::output::GetSnapshotBlockOutput,
  258    350   
    mut builder: ::http::response::Builder,
  259    351   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  260    352   
{
         353  +
    /* HttpBindingGenerator.kt:592 */
  261    354   
    if let ::std::option::Option::Some(inner_1) = &input.data_length {
         355  +
        /* HttpBindingGenerator.kt:690 */
  262    356   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
         357  +
        /* HttpBindingGenerator.kt:704 */
  263    358   
        let formatted_2 = encoder.encode();
         359  +
        /* HttpBindingGenerator.kt:705 */
  264    360   
        if !formatted_2.is_empty() {
         361  +
            /* HttpBindingGenerator.kt:706 */
  265    362   
            let header_value = formatted_2;
  266    363   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  267    364   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  268    365   
                    "data_length",
  269    366   
                    format!(
  270    367   
                        "`{}` cannot be used as a header value: {}",
  271    368   
                        &header_value, err
  272    369   
                    ),
  273    370   
                )
  274    371   
            })?;
  275    372   
            builder = builder.header("x-amz-Data-Length", header_value);
         373  +
            /* HttpBindingGenerator.kt:705 */
  276    374   
        }
         375  +
        /* HttpBindingGenerator.kt:592 */
  277    376   
    }
         377  +
    /* HttpBindingGenerator.kt:592 */
  278    378   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
         379  +
        /* HttpBindingGenerator.kt:704 */
  279    380   
        let formatted_4 = inner_3.as_str();
         381  +
        /* HttpBindingGenerator.kt:705 */
  280    382   
        if !formatted_4.is_empty() {
         383  +
            /* HttpBindingGenerator.kt:706 */
  281    384   
            let header_value = formatted_4;
  282    385   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  283    386   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  284    387   
                    "checksum_algorithm",
  285    388   
                    format!(
  286    389   
                        "`{}` cannot be used as a header value: {}",
  287    390   
                        &header_value, err
  288    391   
                    ),
  289    392   
                )
  290    393   
            })?;
  291    394   
            builder = builder.header("x-amz-Checksum-Algorithm", header_value);
         395  +
            /* HttpBindingGenerator.kt:705 */
  292    396   
        }
         397  +
        /* HttpBindingGenerator.kt:592 */
  293    398   
    }
         399  +
    /* HttpBindingGenerator.kt:592 */
  294    400   
    if let ::std::option::Option::Some(inner_5) = &input.checksum {
         401  +
        /* HttpBindingGenerator.kt:704 */
  295    402   
        let formatted_6 = inner_5.as_str();
         403  +
        /* HttpBindingGenerator.kt:705 */
  296    404   
        if !formatted_6.is_empty() {
         405  +
            /* HttpBindingGenerator.kt:706 */
  297    406   
            let header_value = formatted_6;
  298    407   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  299    408   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  300    409   
                    "checksum",
  301    410   
                    format!(
  302    411   
                        "`{}` cannot be used as a header value: {}",
  303    412   
                        &header_value, err
  304    413   
                    ),
  305    414   
                )
  306    415   
            })?;
  307    416   
            builder = builder.header("x-amz-Checksum", header_value);
         417  +
            /* HttpBindingGenerator.kt:705 */
  308    418   
        }
         419  +
        /* HttpBindingGenerator.kt:592 */
  309    420   
    }
         421  +
    /* HttpBindingGenerator.kt:555 */
  310    422   
    Ok(builder)
         423  +
    /* HttpBindingGenerator.kt:542 */
  311    424   
}

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

@@ -1,1 +32,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_snapshot_id(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}
   13     17   
          18  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   14     19   
pub fn de_block_index(
   15     20   
    value: &str,
   16     21   
) -> std::result::Result<
   17     22   
    i32,
   18     23   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   19     24   
> {
          25  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   20     26   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   21     28   
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   22     30   
}
   23     31   
          32  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   24     33   
pub fn de_block_token(
   25     34   
    value: &str,
   26     35   
) -> std::result::Result<
   27     36   
    ::std::string::String,
   28     37   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   29     38   
> {
          39  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   30     40   
    let value = value.to_owned();
          41  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   31     42   
    Ok(value)
          43  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   32     44   
}

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

@@ -1,1 +9,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_block_data_http_payload(
    3      4   
    payload: ::aws_smithy_types::byte_stream::ByteStream,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_types::byte_stream::ByteStream,
    6      7   
    ::aws_smithy_types::error::operation::BuildError,
    7      8   
> {
    8         -
    Ok(payload)
           9  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          10  +
    Ok(
          11  +
        /* HttpBoundProtocolPayloadGenerator.kt:374 */
          12  +
        payload, /* HttpBoundProtocolPayloadGenerator.kt:345 */
          13  +
    )
          14  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
    9     15   
}

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

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_internal_server_exception_error(
    3      4   
    value: &crate::error::InternalServerException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_internal_server_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::InternalServerException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.message {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("Message").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

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

@@ -1,1 +269,366 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_list_changed_blocks_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ListChangedBlocksInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::list_changed_blocks_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (_, m1, _)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("snapshots"),
   28     37   
                ),
   29     38   
                ::nom::sequence::preceded(
   30     39   
                    ::nom::bytes::complete::tag("/"),
   31     40   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   32     41   
                        ::nom::bytes::complete::take_until("/"),
   33     42   
                        ::nom::combinator::rest,
   34     43   
                    )),
   35     44   
                ),
   36     45   
                ::nom::sequence::preceded(
   37     46   
                    ::nom::bytes::complete::tag("/"),
   38     47   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("changedblocks"),
   39     48   
                ),
   40     49   
            ))(input_string)?;
   41     50   
        debug_assert_eq!("", input_string);
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   42     52   
        input = input.set_second_snapshot_id(
   43     53   
            crate::protocol_serde::shape_list_changed_blocks_input::de_second_snapshot_id(m1)?,
   44     54   
        );
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   45     56   
        let query_string = uri.query().unwrap_or("");
   46     57   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   47     59   
        let mut first_snapshot_id_seen = false;
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   48     61   
        let mut max_results_seen = false;
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   49     63   
        let mut next_token_seen = false;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   50     65   
        let mut starting_block_index_seen = false;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   51     67   
        for (k, v) in pairs {
          68  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   52     69   
            if !first_snapshot_id_seen && k == "firstSnapshotId" {
   53     70   
                input = input.set_first_snapshot_id(
   54     71   
                    crate::protocol_serde::shape_list_changed_blocks_input::de_first_snapshot_id(
   55     72   
                        &v,
   56     73   
                    )?,
   57     74   
                );
   58     75   
                first_snapshot_id_seen = true;
   59     76   
            }
          77  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   60     78   
            if !max_results_seen && k == "maxResults" {
   61     79   
                input = input.set_max_results(
   62     80   
                    crate::protocol_serde::shape_list_changed_blocks_input::de_max_results(&v)?,
   63     81   
                );
   64     82   
                max_results_seen = true;
   65     83   
            }
          84  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   66     85   
            if !next_token_seen && k == "pageToken" {
   67     86   
                input = input.set_next_token(
   68     87   
                    crate::protocol_serde::shape_list_changed_blocks_input::de_next_token(&v)?,
   69     88   
                );
   70     89   
                next_token_seen = true;
   71     90   
            }
          91  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   72     92   
            if !starting_block_index_seen && k == "startingBlockIndex" {
   73     93   
                input = input.set_starting_block_index(
   74     94   
                    crate::protocol_serde::shape_list_changed_blocks_input::de_starting_block_index(&v)?
   75     95   
                );
   76     96   
                starting_block_index_seen = true;
   77     97   
            }
          98  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   78     99   
        }
         100  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   79    101   
        input.build()?
         102  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   80    103   
    })
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   81    105   
}
   82    106   
         107  +
/* RustType.kt:516 */
   83    108   
#[allow(clippy::unnecessary_wraps)]
         109  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   84    110   
pub fn ser_list_changed_blocks_http_response(
   85    111   
    #[allow(unused_variables)] output: crate::output::ListChangedBlocksOutput,
   86    112   
) -> std::result::Result<
   87    113   
    ::aws_smithy_http_server::response::Response,
   88    114   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   89    115   
> {
         116  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   90    117   
    Ok({
         118  +
        /* RustType.kt:516 */
   91    119   
        #[allow(unused_mut)]
         120  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   92    121   
        let mut builder = ::http::Response::builder();
         122  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   93    123   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94    124   
            builder,
   95    125   
            ::http::header::CONTENT_TYPE,
   96    126   
            "application/json",
   97    127   
        );
         128  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   98    129   
        let http_status: u16 = 200;
   99    130   
        builder = builder.status(http_status);
         131  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
  100    132   
        let payload =
  101         -
            crate::protocol_serde::shape_list_changed_blocks_output::ser_list_changed_blocks_output_output_output(&output)?
  102         -
        ;
         133  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_list_changed_blocks_output::ser_list_changed_blocks_output_output_output(&output)?
         134  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
         135  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
  103    136   
        let content_length = payload.len();
  104    137   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    138   
            builder,
  106    139   
            ::http::header::CONTENT_LENGTH,
  107    140   
            content_length,
  108    141   
        );
         142  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
  109    143   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         144  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
  110    145   
        builder.body(body)?
         146  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
  111    147   
    })
         148  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
  112    149   
}
  113    150   
         151  +
/* RustType.kt:516 */
  114    152   
#[allow(clippy::unnecessary_wraps)]
         153  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
  115    154   
pub fn ser_list_changed_blocks_http_error(
  116    155   
    error: &crate::error::ListChangedBlocksError,
  117    156   
) -> std::result::Result<
  118    157   
    ::aws_smithy_http_server::response::Response,
  119    158   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  120    159   
> {
         160  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
  121    161   
    Ok({
         162  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
  122    163   
        match error {
         164  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  123    165   
            crate::error::ListChangedBlocksError::InternalServerException(output) => {
         166  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  124    167   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         168  +
                /* RustType.kt:516 */
  125    169   
                #[allow(unused_mut)]
         170  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  126    171   
                let mut builder = ::http::Response::builder();
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  127    173   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  128    174   
                    builder,
  129    175   
                    ::http::header::CONTENT_TYPE,
  130    176   
                    "application/json",
  131    177   
                );
         178  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  132    179   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  133    180   
                    builder,
  134    181   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  135    182   
                    "InternalServerException",
  136    183   
                );
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  137    185   
                let content_length = payload.len();
  138    186   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  139    187   
                    builder,
  140    188   
                    ::http::header::CONTENT_LENGTH,
  141    189   
                    content_length,
  142    190   
                );
         191  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  143    192   
                builder
  144    193   
                    .status(500)
  145    194   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         195  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  146    196   
            }
         197  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  147    198   
            crate::error::ListChangedBlocksError::ResourceNotFoundException(output) => {
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  148    200   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         201  +
                /* RustType.kt:516 */
  149    202   
                #[allow(unused_mut)]
         203  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  150    204   
                let mut builder = ::http::Response::builder();
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  151    206   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  152    207   
                    builder,
  153    208   
                    ::http::header::CONTENT_TYPE,
  154    209   
                    "application/json",
  155    210   
                );
         211  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  156    212   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  157    213   
                    builder,
  158    214   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  159    215   
                    "ResourceNotFoundException",
  160    216   
                );
         217  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  161    218   
                let content_length = payload.len();
  162    219   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  163    220   
                    builder,
  164    221   
                    ::http::header::CONTENT_LENGTH,
  165    222   
                    content_length,
  166    223   
                );
         224  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  167    225   
                builder
  168    226   
                    .status(404)
  169    227   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         228  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  170    229   
            }
         230  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  171    231   
            crate::error::ListChangedBlocksError::AccessDeniedException(output) => {
         232  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  172    233   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         234  +
                /* RustType.kt:516 */
  173    235   
                #[allow(unused_mut)]
         236  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  174    237   
                let mut builder = ::http::Response::builder();
         238  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  175    239   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  176    240   
                    builder,
  177    241   
                    ::http::header::CONTENT_TYPE,
  178    242   
                    "application/json",
  179    243   
                );
         244  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  180    245   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  181    246   
                    builder,
  182    247   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  183    248   
                    "AccessDeniedException",
  184    249   
                );
         250  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  185    251   
                let content_length = payload.len();
  186    252   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  187    253   
                    builder,
  188    254   
                    ::http::header::CONTENT_LENGTH,
  189    255   
                    content_length,
  190    256   
                );
         257  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  191    258   
                builder
  192    259   
                    .status(403)
  193    260   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         261  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  194    262   
            }
         263  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  195    264   
            crate::error::ListChangedBlocksError::RequestThrottledException(output) => {
         265  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  196    266   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         267  +
                /* RustType.kt:516 */
  197    268   
                #[allow(unused_mut)]
         269  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  198    270   
                let mut builder = ::http::Response::builder();
         271  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  199    272   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  200    273   
                    builder,
  201    274   
                    ::http::header::CONTENT_TYPE,
  202    275   
                    "application/json",
  203    276   
                );
         277  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  204    278   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  205    279   
                    builder,
  206    280   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  207    281   
                    "RequestThrottledException",
  208    282   
                );
         283  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  209    284   
                let content_length = payload.len();
  210    285   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  211    286   
                    builder,
  212    287   
                    ::http::header::CONTENT_LENGTH,
  213    288   
                    content_length,
  214    289   
                );
         290  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  215    291   
                builder
  216    292   
                    .status(400)
  217    293   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         294  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  218    295   
            }
         296  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  219    297   
            crate::error::ListChangedBlocksError::ServiceQuotaExceededException(output) => {
         298  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  220    299   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         300  +
                /* RustType.kt:516 */
  221    301   
                #[allow(unused_mut)]
         302  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  222    303   
                let mut builder = ::http::Response::builder();
         304  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  223    305   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  224    306   
                    builder,
  225    307   
                    ::http::header::CONTENT_TYPE,
  226    308   
                    "application/json",
  227    309   
                );
         310  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  228    311   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  229    312   
                    builder,
  230    313   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  231    314   
                    "ServiceQuotaExceededException",
  232    315   
                );
         316  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  233    317   
                let content_length = payload.len();
  234    318   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  235    319   
                    builder,
  236    320   
                    ::http::header::CONTENT_LENGTH,
  237    321   
                    content_length,
  238    322   
                );
         323  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  239    324   
                builder
  240    325   
                    .status(402)
  241    326   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         327  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  242    328   
            }
         329  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  243    330   
            crate::error::ListChangedBlocksError::ValidationException(output) => {
         331  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  244    332   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         333  +
                /* RustType.kt:516 */
  245    334   
                #[allow(unused_mut)]
         335  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  246    336   
                let mut builder = ::http::Response::builder();
         337  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  247    338   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  248    339   
                    builder,
  249    340   
                    ::http::header::CONTENT_TYPE,
  250    341   
                    "application/json",
  251    342   
                );
         343  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  252    344   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  253    345   
                    builder,
  254    346   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  255    347   
                    "ValidationException",
  256    348   
                );
         349  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  257    350   
                let content_length = payload.len();
  258    351   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  259    352   
                    builder,
  260    353   
                    ::http::header::CONTENT_LENGTH,
  261    354   
                    content_length,
  262    355   
                );
         356  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  263    357   
                builder
  264    358   
                    .status(400)
  265    359   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  266         -
            }
         360  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         361  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  267    362   
        }
         363  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  268    364   
    })
         365  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  269    366   
}

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

@@ -1,1 +52,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_second_snapshot_id(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}
   13     17   
          18  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   14     19   
pub fn de_first_snapshot_id(
   15     20   
    value: &str,
   16     21   
) -> std::result::Result<
   17     22   
    ::std::option::Option<::std::string::String>,
   18     23   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   19     24   
> {
          25  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   20     26   
    let value = value.to_owned();
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   21     28   
    Ok(Some(value))
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   22     30   
}
   23     31   
          32  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   24     33   
pub fn de_max_results(
   25     34   
    value: &str,
   26     35   
) -> std::result::Result<
   27     36   
    ::std::option::Option<i32>,
   28     37   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   29     38   
> {
          39  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   30     40   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          41  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   31     42   
    Ok(Some(value))
          43  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   32     44   
}
   33     45   
          46  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   34     47   
pub fn de_next_token(
   35     48   
    value: &str,
   36     49   
) -> std::result::Result<
   37     50   
    ::std::option::Option<::std::string::String>,
   38     51   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   39     52   
> {
          53  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   40     54   
    let value = value.to_owned();
          55  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   41     56   
    Ok(Some(value))
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   42     58   
}
   43     59   
          60  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   44     61   
pub fn de_starting_block_index(
   45     62   
    value: &str,
   46     63   
) -> std::result::Result<
   47     64   
    ::std::option::Option<i32>,
   48     65   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   49     66   
> {
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   50     68   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   51     70   
    Ok(Some(value))
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   52     72   
}

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

@@ -1,1 +55,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_list_changed_blocks_output_output_output(
    3      4   
    value: &crate::output::ListChangedBlocksOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_list_changed_blocks_output::ser_list_changed_blocks_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_list_changed_blocks_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::ListChangedBlocksOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.block_size {
          27  +
        /* JsonSerializerGenerator.kt:432 */
   20     28   
        object.key("BlockSize").number(
   21     29   
            #[allow(clippy::useless_conversion)]
   22     30   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   23     31   
        );
          32  +
        /* JsonSerializerGenerator.kt:382 */
   24     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:382 */
   25     35   
    if let Some(var_2) = &input.changed_blocks {
          36  +
        /* JsonSerializerGenerator.kt:484 */
   26     37   
        let mut array_3 = object.key("ChangedBlocks").start_array();
          38  +
        /* JsonSerializerGenerator.kt:524 */
   27     39   
        for item_4 in var_2 {
          40  +
            /* SerializerUtil.kt:42 */
   28     41   
            {
          42  +
                /* JsonSerializerGenerator.kt:495 */
   29     43   
                #[allow(unused_mut)]
          44  +
                /* JsonSerializerGenerator.kt:496 */
   30     45   
                let mut object_5 = array_3.value().start_object();
          46  +
                /* JsonSerializerGenerator.kt:375 */
   31     47   
                crate::protocol_serde::shape_changed_block::ser_changed_block(
   32     48   
                    &mut object_5,
   33     49   
                    item_4,
   34     50   
                )?;
          51  +
                /* JsonSerializerGenerator.kt:515 */
   35     52   
                object_5.finish();
          53  +
                /* SerializerUtil.kt:42 */
   36     54   
            }
          55  +
            /* JsonSerializerGenerator.kt:524 */
   37     56   
        }
          57  +
        /* JsonSerializerGenerator.kt:486 */
   38     58   
        array_3.finish();
          59  +
        /* JsonSerializerGenerator.kt:382 */
   39     60   
    }
          61  +
    /* JsonSerializerGenerator.kt:382 */
   40     62   
    if let Some(var_6) = &input.expiry_time {
          63  +
        /* JsonSerializerGenerator.kt:448 */
   41     64   
        object
   42     65   
            .key("ExpiryTime")
   43     66   
            .date_time(var_6, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
          67  +
        /* JsonSerializerGenerator.kt:382 */
   44     68   
    }
          69  +
    /* JsonSerializerGenerator.kt:382 */
   45     70   
    if let Some(var_7) = &input.next_token {
          71  +
        /* JsonSerializerGenerator.kt:423 */
   46     72   
        object.key("NextToken").string(var_7.as_str());
          73  +
        /* JsonSerializerGenerator.kt:382 */
   47     74   
    }
          75  +
    /* JsonSerializerGenerator.kt:382 */
   48     76   
    if let Some(var_8) = &input.volume_size {
          77  +
        /* JsonSerializerGenerator.kt:432 */
   49     78   
        object.key("VolumeSize").number(
   50     79   
            #[allow(clippy::useless_conversion)]
   51     80   
            ::aws_smithy_types::Number::NegInt((var_8.0).into()),
   52     81   
        );
          82  +
        /* JsonSerializerGenerator.kt:382 */
   53     83   
    }
          84  +
    /* JsonSerializerGenerator.kt:372 */
   54     85   
    Ok(())
          86  +
    /* JsonSerializerGenerator.kt:358 */
   55     87   
}