Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +260,355 @@
    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_snapshot_blocks_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ListSnapshotBlocksInput,
    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_snapshot_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>>("blocks"),
   39     48   
                ),
   40     49   
            ))(input_string)?;
   41     50   
        debug_assert_eq!("", input_string);
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   42     52   
        input = input.set_snapshot_id(
   43     53   
            crate::protocol_serde::shape_list_snapshot_blocks_input::de_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 max_results_seen = false;
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   48     61   
        let mut next_token_seen = false;
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   49     63   
        let mut starting_block_index_seen = false;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   50     65   
        for (k, v) in pairs {
          66  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   51     67   
            if !max_results_seen && k == "maxResults" {
   52     68   
                input = input.set_max_results(
   53     69   
                    crate::protocol_serde::shape_list_snapshot_blocks_input::de_max_results(&v)?,
   54     70   
                );
   55     71   
                max_results_seen = true;
   56     72   
            }
          73  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   57     74   
            if !next_token_seen && k == "pageToken" {
   58     75   
                input = input.set_next_token(
   59     76   
                    crate::protocol_serde::shape_list_snapshot_blocks_input::de_next_token(&v)?,
   60     77   
                );
   61     78   
                next_token_seen = true;
   62     79   
            }
          80  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   63     81   
            if !starting_block_index_seen && k == "startingBlockIndex" {
   64     82   
                input = input.set_starting_block_index(
   65     83   
                    crate::protocol_serde::shape_list_snapshot_blocks_input::de_starting_block_index(&v)?
   66     84   
                );
   67     85   
                starting_block_index_seen = true;
   68     86   
            }
          87  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   69     88   
        }
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   70     90   
        input.build()?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   71     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   72     94   
}
   73     95   
          96  +
/* RustType.kt:516 */
   74     97   
#[allow(clippy::unnecessary_wraps)]
          98  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   75     99   
pub fn ser_list_snapshot_blocks_http_response(
   76    100   
    #[allow(unused_variables)] output: crate::output::ListSnapshotBlocksOutput,
   77    101   
) -> std::result::Result<
   78    102   
    ::aws_smithy_http_server::response::Response,
   79    103   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80    104   
> {
         105  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   81    106   
    Ok({
         107  +
        /* RustType.kt:516 */
   82    108   
        #[allow(unused_mut)]
         109  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   83    110   
        let mut builder = ::http::Response::builder();
         111  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   84    112   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    113   
            builder,
   86    114   
            ::http::header::CONTENT_TYPE,
   87    115   
            "application/json",
   88    116   
        );
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   89    118   
        let http_status: u16 = 200;
   90    119   
        builder = builder.status(http_status);
         120  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   91    121   
        let payload =
   92         -
            crate::protocol_serde::shape_list_snapshot_blocks_output::ser_list_snapshot_blocks_output_output_output(&output)?
   93         -
        ;
         122  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_list_snapshot_blocks_output::ser_list_snapshot_blocks_output_output_output(&output)?
         123  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
         124  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   94    125   
        let content_length = payload.len();
   95    126   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    127   
            builder,
   97    128   
            ::http::header::CONTENT_LENGTH,
   98    129   
            content_length,
   99    130   
        );
         131  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
  100    132   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
  101    134   
        builder.body(body)?
         135  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
  102    136   
    })
         137  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
  103    138   
}
  104    139   
         140  +
/* RustType.kt:516 */
  105    141   
#[allow(clippy::unnecessary_wraps)]
         142  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
  106    143   
pub fn ser_list_snapshot_blocks_http_error(
  107    144   
    error: &crate::error::ListSnapshotBlocksError,
  108    145   
) -> std::result::Result<
  109    146   
    ::aws_smithy_http_server::response::Response,
  110    147   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  111    148   
> {
         149  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
  112    150   
    Ok({
         151  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
  113    152   
        match error {
         153  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  114    154   
            crate::error::ListSnapshotBlocksError::InternalServerException(output) => {
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  115    156   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         157  +
                /* RustType.kt:516 */
  116    158   
                #[allow(unused_mut)]
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  117    160   
                let mut builder = ::http::Response::builder();
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  118    162   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  119    163   
                    builder,
  120    164   
                    ::http::header::CONTENT_TYPE,
  121    165   
                    "application/json",
  122    166   
                );
         167  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  123    168   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    169   
                    builder,
  125    170   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  126    171   
                    "InternalServerException",
  127    172   
                );
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  128    174   
                let content_length = payload.len();
  129    175   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  130    176   
                    builder,
  131    177   
                    ::http::header::CONTENT_LENGTH,
  132    178   
                    content_length,
  133    179   
                );
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  134    181   
                builder
  135    182   
                    .status(500)
  136    183   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         184  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  137    185   
            }
         186  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  138    187   
            crate::error::ListSnapshotBlocksError::ResourceNotFoundException(output) => {
         188  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  139    189   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         190  +
                /* RustType.kt:516 */
  140    191   
                #[allow(unused_mut)]
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  141    193   
                let mut builder = ::http::Response::builder();
         194  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  142    195   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  143    196   
                    builder,
  144    197   
                    ::http::header::CONTENT_TYPE,
  145    198   
                    "application/json",
  146    199   
                );
         200  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  147    201   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  148    202   
                    builder,
  149    203   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  150    204   
                    "ResourceNotFoundException",
  151    205   
                );
         206  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  152    207   
                let content_length = payload.len();
  153    208   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  154    209   
                    builder,
  155    210   
                    ::http::header::CONTENT_LENGTH,
  156    211   
                    content_length,
  157    212   
                );
         213  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  158    214   
                builder
  159    215   
                    .status(404)
  160    216   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         217  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  161    218   
            }
         219  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  162    220   
            crate::error::ListSnapshotBlocksError::AccessDeniedException(output) => {
         221  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  163    222   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         223  +
                /* RustType.kt:516 */
  164    224   
                #[allow(unused_mut)]
         225  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  165    226   
                let mut builder = ::http::Response::builder();
         227  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  166    228   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  167    229   
                    builder,
  168    230   
                    ::http::header::CONTENT_TYPE,
  169    231   
                    "application/json",
  170    232   
                );
         233  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  171    234   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  172    235   
                    builder,
  173    236   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  174    237   
                    "AccessDeniedException",
  175    238   
                );
         239  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  176    240   
                let content_length = payload.len();
  177    241   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  178    242   
                    builder,
  179    243   
                    ::http::header::CONTENT_LENGTH,
  180    244   
                    content_length,
  181    245   
                );
         246  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  182    247   
                builder
  183    248   
                    .status(403)
  184    249   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         250  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  185    251   
            }
         252  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  186    253   
            crate::error::ListSnapshotBlocksError::RequestThrottledException(output) => {
         254  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  187    255   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         256  +
                /* RustType.kt:516 */
  188    257   
                #[allow(unused_mut)]
         258  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  189    259   
                let mut builder = ::http::Response::builder();
         260  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  190    261   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  191    262   
                    builder,
  192    263   
                    ::http::header::CONTENT_TYPE,
  193    264   
                    "application/json",
  194    265   
                );
         266  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  195    267   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  196    268   
                    builder,
  197    269   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  198    270   
                    "RequestThrottledException",
  199    271   
                );
         272  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  200    273   
                let content_length = payload.len();
  201    274   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  202    275   
                    builder,
  203    276   
                    ::http::header::CONTENT_LENGTH,
  204    277   
                    content_length,
  205    278   
                );
         279  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  206    280   
                builder
  207    281   
                    .status(400)
  208    282   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         283  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  209    284   
            }
         285  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  210    286   
            crate::error::ListSnapshotBlocksError::ServiceQuotaExceededException(output) => {
         287  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  211    288   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         289  +
                /* RustType.kt:516 */
  212    290   
                #[allow(unused_mut)]
         291  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  213    292   
                let mut builder = ::http::Response::builder();
         293  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  214    294   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  215    295   
                    builder,
  216    296   
                    ::http::header::CONTENT_TYPE,
  217    297   
                    "application/json",
  218    298   
                );
         299  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  219    300   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  220    301   
                    builder,
  221    302   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  222    303   
                    "ServiceQuotaExceededException",
  223    304   
                );
         305  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  224    306   
                let content_length = payload.len();
  225    307   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  226    308   
                    builder,
  227    309   
                    ::http::header::CONTENT_LENGTH,
  228    310   
                    content_length,
  229    311   
                );
         312  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  230    313   
                builder
  231    314   
                    .status(402)
  232    315   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         316  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  233    317   
            }
         318  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  234    319   
            crate::error::ListSnapshotBlocksError::ValidationException(output) => {
         320  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  235    321   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         322  +
                /* RustType.kt:516 */
  236    323   
                #[allow(unused_mut)]
         324  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  237    325   
                let mut builder = ::http::Response::builder();
         326  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  238    327   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  239    328   
                    builder,
  240    329   
                    ::http::header::CONTENT_TYPE,
  241    330   
                    "application/json",
  242    331   
                );
         332  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  243    333   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  244    334   
                    builder,
  245    335   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  246    336   
                    "ValidationException",
  247    337   
                );
         338  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  248    339   
                let content_length = payload.len();
  249    340   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  250    341   
                    builder,
  251    342   
                    ::http::header::CONTENT_LENGTH,
  252    343   
                    content_length,
  253    344   
                );
         345  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  254    346   
                builder
  255    347   
                    .status(400)
  256    348   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  257         -
            }
         349  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         350  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  258    351   
        }
         352  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  259    353   
    })
         354  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  260    355   
}

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

@@ -1,1 +42,58 @@
    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_max_results(
   15     20   
    value: &str,
   16     21   
) -> std::result::Result<
   17     22   
    ::std::option::Option<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(Some(value))
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   22     30   
}
   23     31   
          32  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   24     33   
pub fn de_next_token(
   25     34   
    value: &str,
   26     35   
) -> std::result::Result<
   27     36   
    ::std::option::Option<::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(Some(value))
          43  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   32     44   
}
   33     45   
          46  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   34     47   
pub fn de_starting_block_index(
   35     48   
    value: &str,
   36     49   
) -> std::result::Result<
   37     50   
    ::std::option::Option<i32>,
   38     51   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   39     52   
> {
          53  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   40     54   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          55  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   41     56   
    Ok(Some(value))
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   42     58   
}

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

@@ -1,1 +49,81 @@
    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_snapshot_blocks_output_output_output(
    3      4   
    value: &crate::output::ListSnapshotBlocksOutput,
    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_snapshot_blocks_output::ser_list_snapshot_blocks_output_output(&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_list_snapshot_blocks_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::ListSnapshotBlocksOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.block_size {
          24  +
        /* JsonSerializerGenerator.kt:432 */
   17     25   
        object.key("BlockSize").number(
   18     26   
            #[allow(clippy::useless_conversion)]
   19     27   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   20     28   
        );
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   22     32   
    if let Some(var_2) = &input.blocks {
          33  +
        /* JsonSerializerGenerator.kt:484 */
   23     34   
        let mut array_3 = object.key("Blocks").start_array();
          35  +
        /* JsonSerializerGenerator.kt:524 */
   24     36   
        for item_4 in var_2 {
          37  +
            /* SerializerUtil.kt:42 */
   25     38   
            {
          39  +
                /* JsonSerializerGenerator.kt:495 */
   26     40   
                #[allow(unused_mut)]
          41  +
                /* JsonSerializerGenerator.kt:496 */
   27     42   
                let mut object_5 = array_3.value().start_object();
          43  +
                /* JsonSerializerGenerator.kt:375 */
   28     44   
                crate::protocol_serde::shape_block::ser_block(&mut object_5, item_4)?;
          45  +
                /* JsonSerializerGenerator.kt:515 */
   29     46   
                object_5.finish();
          47  +
                /* SerializerUtil.kt:42 */
   30     48   
            }
          49  +
            /* JsonSerializerGenerator.kt:524 */
   31     50   
        }
          51  +
        /* JsonSerializerGenerator.kt:486 */
   32     52   
        array_3.finish();
          53  +
        /* JsonSerializerGenerator.kt:382 */
   33     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:382 */
   34     56   
    if let Some(var_6) = &input.expiry_time {
          57  +
        /* JsonSerializerGenerator.kt:448 */
   35     58   
        object
   36     59   
            .key("ExpiryTime")
   37     60   
            .date_time(var_6, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
          61  +
        /* JsonSerializerGenerator.kt:382 */
   38     62   
    }
          63  +
    /* JsonSerializerGenerator.kt:382 */
   39     64   
    if let Some(var_7) = &input.next_token {
          65  +
        /* JsonSerializerGenerator.kt:423 */
   40     66   
        object.key("NextToken").string(var_7.as_str());
          67  +
        /* JsonSerializerGenerator.kt:382 */
   41     68   
    }
          69  +
    /* JsonSerializerGenerator.kt:382 */
   42     70   
    if let Some(var_8) = &input.volume_size {
          71  +
        /* JsonSerializerGenerator.kt:432 */
   43     72   
        object.key("VolumeSize").number(
   44     73   
            #[allow(clippy::useless_conversion)]
   45     74   
            ::aws_smithy_types::Number::NegInt((var_8.0).into()),
   46     75   
        );
          76  +
        /* JsonSerializerGenerator.kt:382 */
   47     77   
    }
          78  +
    /* JsonSerializerGenerator.kt:372 */
   48     79   
    Ok(())
          80  +
    /* JsonSerializerGenerator.kt:358 */
   49     81   
}

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

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

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

@@ -1,1 +85,113 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_block_data_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<
    5      6   
    ::aws_smithy_types::byte_stream::ByteStream,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
    8         -
    // replace the body with an empty body
           9  +
    /* HttpBindingGenerator.kt:299 */// replace the body with an empty body
    9     10   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     11   
    Ok(::aws_smithy_types::byte_stream::ByteStream::new(body))
          12  +
    /* HttpBindingGenerator.kt:230 */
   11     13   
}
   12     14   
          15  +
/* HttpBindingGenerator.kt:153 */
   13     16   
pub(crate) fn de_checksum_header(
   14     17   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   15     18   
) -> ::std::result::Result<
   16     19   
    ::std::option::Option<::std::string::String>,
   17     20   
    ::aws_smithy_http::header::ParseError,
   18     21   
> {
          22  +
    /* HttpBindingGenerator.kt:160 */
   19     23   
    let headers = header_map.get_all("x-amz-Checksum");
          24  +
    /* HttpBindingGenerator.kt:375 */
   20     25   
    ::aws_smithy_http::header::one_or_none(headers)
          26  +
    /* HttpBindingGenerator.kt:153 */
   21     27   
}
   22     28   
          29  +
/* HttpBindingGenerator.kt:153 */
   23     30   
pub(crate) fn de_checksum_algorithm_header(
   24     31   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   25     32   
) -> ::std::result::Result<
   26     33   
    ::std::option::Option<::std::string::String>,
   27     34   
    ::aws_smithy_http::header::ParseError,
   28     35   
> {
          36  +
    /* HttpBindingGenerator.kt:160 */
   29     37   
    let headers = header_map.get_all("x-amz-Checksum-Algorithm");
          38  +
    /* HttpBindingGenerator.kt:375 */
   30     39   
    ::aws_smithy_http::header::one_or_none(headers)
          40  +
    /* HttpBindingGenerator.kt:153 */
   31     41   
}
   32     42   
          43  +
/* HttpBindingGenerator.kt:153 */
   33     44   
pub(crate) fn de_data_length_header(
   34     45   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   35     46   
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
          47  +
    /* HttpBindingGenerator.kt:160 */
   36     48   
    let headers = header_map.get_all("x-amz-Data-Length");
          49  +
    /* HttpBindingGenerator.kt:404 */
   37     50   
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
          51  +
    /* HttpBindingGenerator.kt:468 */
   38     52   
    if var_1.len() > 1 {
   39     53   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   40     54   
            "expected one item but found {}",
   41     55   
            var_1.len()
   42     56   
        )))
   43     57   
    } else {
   44     58   
        let mut var_1 = var_1;
   45     59   
        Ok(var_1.pop())
   46     60   
    }
          61  +
    /* HttpBindingGenerator.kt:153 */
   47     62   
}
   48     63   
          64  +
/* HttpBindingGenerator.kt:153 */
   49     65   
pub(crate) fn de_progress_header(
   50     66   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   51     67   
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
          68  +
    /* HttpBindingGenerator.kt:160 */
   52     69   
    let headers = header_map.get_all("x-amz-Progress");
          70  +
    /* HttpBindingGenerator.kt:404 */
   53     71   
    let var_2 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
          72  +
    /* HttpBindingGenerator.kt:468 */
   54     73   
    if var_2.len() > 1 {
   55     74   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   56     75   
            "expected one item but found {}",
   57     76   
            var_2.len()
   58     77   
        )))
   59     78   
    } else {
   60     79   
        let mut var_2 = var_2;
   61     80   
        Ok(var_2.pop())
   62     81   
    }
          82  +
    /* HttpBindingGenerator.kt:153 */
   63     83   
}
   64     84   
          85  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   65     86   
pub fn de_snapshot_id(
   66     87   
    value: &str,
   67     88   
) -> std::result::Result<
   68     89   
    ::std::string::String,
   69     90   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   70     91   
> {
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
   71     93   
    let value = ::percent_encoding::percent_decode_str(value)
   72     94   
        .decode_utf8()?
   73     95   
        .into_owned();
          96  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   74     97   
    Ok(value)
          98  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   75     99   
}
   76    100   
         101  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   77    102   
pub fn de_block_index(
   78    103   
    value: &str,
   79    104   
) -> std::result::Result<
   80    105   
    i32,
   81    106   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   82    107   
> {
         108  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   83    109   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
         110  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   84    111   
    Ok(value)
         112  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   85    113   
}

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

@@ -1,1 +20,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_put_snapshot_block_output_output_output(
    3      4   
    value: &crate::output::PutSnapshotBlockOutput,
    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_put_snapshot_block_output::ser_put_snapshot_block_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_put_snapshot_block_output_output(
   16     22   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    #[allow(unused_variables)] input: &crate::output::PutSnapshotBlockOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:372 */
   19     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   20     28   
}

tmp-codegen-diff/codegen-server-test/ebs/rust-server-codegen/src/protocol_serde/shape_request_throttled_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_request_throttled_exception_error(
    3      4   
    value: &crate::error::RequestThrottledException,
    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_request_throttled_exception::ser_request_throttled_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_request_throttled_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::RequestThrottledException,
   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:382 */
   22     32   
    if let Some(var_2) = &input.reason {
          33  +
        /* JsonSerializerGenerator.kt:423 */
   23     34   
        object.key("Reason").string(var_2.as_str());
          35  +
        /* JsonSerializerGenerator.kt:382 */
   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_resource_not_found_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_resource_not_found_exception_error(
    3      4   
    value: &crate::error::ResourceNotFoundException,
    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_resource_not_found_exception::ser_resource_not_found_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_resource_not_found_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::ResourceNotFoundException,
   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:382 */
   22     32   
    if let Some(var_2) = &input.reason {
          33  +
        /* JsonSerializerGenerator.kt:423 */
   23     34   
        object.key("Reason").string(var_2.as_str());
          35  +
        /* JsonSerializerGenerator.kt:382 */
   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_service_quota_exceeded_exception.rs

@@ -1,1 +23,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_service_quota_exceeded_exception_error(
    3      4   
    value: &crate::error::ServiceQuotaExceededException,
    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_service_quota_exceeded_exception::ser_service_quota_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_service_quota_exceeded_exception(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::error::ServiceQuotaExceededException,
   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:382 */
   19     29   
    if let Some(var_2) = &input.reason {
          30  +
        /* JsonSerializerGenerator.kt:423 */
   20     31   
        object.key("Reason").string(var_2.as_str());
          32  +
        /* JsonSerializerGenerator.kt:382 */
   21     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:372 */
   22     35   
    Ok(())
          36  +
    /* JsonSerializerGenerator.kt:358 */
   23     37   
}

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

@@ -1,1 +381,546 @@
    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_start_snapshot_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StartSnapshotInput,
    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::start_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:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/json"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_start_snapshot::de_start_snapshot(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()?
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_start_snapshot_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::StartSnapshotOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/json",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 201;
   53     74   
        builder = builder.status(http_status);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   54     76   
        let payload =
   55         -
            crate::protocol_serde::shape_start_snapshot_output::ser_start_snapshot_output_output_output(&output)?
   56         -
        ;
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_start_snapshot_output::ser_start_snapshot_output_output_output(&output)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   57     80   
        let content_length = payload.len();
   58     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     82   
            builder,
   60     83   
            ::http::header::CONTENT_LENGTH,
   61     84   
            content_length,
   62     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   63     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   64     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   65     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   66     93   
}
   67     94   
          95  +
/* RustType.kt:516 */
   68     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   69     98   
pub fn ser_start_snapshot_http_error(
   70     99   
    error: &crate::error::StartSnapshotError,
   71    100   
) -> std::result::Result<
   72    101   
    ::aws_smithy_http_server::response::Response,
   73    102   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   75    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   76    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   77    109   
            crate::error::StartSnapshotError::InternalServerException(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   78    111   
                let payload = crate::protocol_serde::shape_internal_server_exception::ser_internal_server_exception_error(output)?;
         112  +
                /* RustType.kt:516 */
   79    113   
                #[allow(unused_mut)]
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   80    115   
                let mut builder = ::http::Response::builder();
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   81    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    118   
                    builder,
   83    119   
                    ::http::header::CONTENT_TYPE,
   84    120   
                    "application/json",
   85    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   86    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87    124   
                    builder,
   88    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89    126   
                    "InternalServerException",
   90    127   
                );
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   91    129   
                let content_length = payload.len();
   92    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93    131   
                    builder,
   94    132   
                    ::http::header::CONTENT_LENGTH,
   95    133   
                    content_length,
   96    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   97    136   
                builder
   98    137   
                    .status(500)
   99    138   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  100    140   
            }
         141  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  101    142   
            crate::error::StartSnapshotError::ResourceNotFoundException(output) => {
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  102    144   
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         145  +
                /* RustType.kt:516 */
  103    146   
                #[allow(unused_mut)]
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  104    148   
                let mut builder = ::http::Response::builder();
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  105    150   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  106    151   
                    builder,
  107    152   
                    ::http::header::CONTENT_TYPE,
  108    153   
                    "application/json",
  109    154   
                );
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  110    156   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  111    157   
                    builder,
  112    158   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  113    159   
                    "ResourceNotFoundException",
  114    160   
                );
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  115    162   
                let content_length = payload.len();
  116    163   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  117    164   
                    builder,
  118    165   
                    ::http::header::CONTENT_LENGTH,
  119    166   
                    content_length,
  120    167   
                );
         168  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  121    169   
                builder
  122    170   
                    .status(404)
  123    171   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  124    173   
            }
         174  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  125    175   
            crate::error::StartSnapshotError::AccessDeniedException(output) => {
         176  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  126    177   
                let payload = crate::protocol_serde::shape_access_denied_exception::ser_access_denied_exception_error(output)?;
         178  +
                /* RustType.kt:516 */
  127    179   
                #[allow(unused_mut)]
         180  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  128    181   
                let mut builder = ::http::Response::builder();
         182  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  129    183   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  130    184   
                    builder,
  131    185   
                    ::http::header::CONTENT_TYPE,
  132    186   
                    "application/json",
  133    187   
                );
         188  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  134    189   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  135    190   
                    builder,
  136    191   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  137    192   
                    "AccessDeniedException",
  138    193   
                );
         194  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  139    195   
                let content_length = payload.len();
  140    196   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  141    197   
                    builder,
  142    198   
                    ::http::header::CONTENT_LENGTH,
  143    199   
                    content_length,
  144    200   
                );
         201  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  145    202   
                builder
  146    203   
                    .status(403)
  147    204   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  148    206   
            }
         207  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  149    208   
            crate::error::StartSnapshotError::ConflictException(output) => {
         209  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  150    210   
                let payload =
  151    211   
                    crate::protocol_serde::shape_conflict_exception::ser_conflict_exception_error(
  152    212   
                        output,
  153    213   
                    )?;
         214  +
                /* RustType.kt:516 */
  154    215   
                #[allow(unused_mut)]
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  155    217   
                let mut builder = ::http::Response::builder();
         218  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  156    219   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  157    220   
                    builder,
  158    221   
                    ::http::header::CONTENT_TYPE,
  159    222   
                    "application/json",
  160    223   
                );
         224  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  161    225   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  162    226   
                    builder,
  163    227   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  164    228   
                    "ConflictException",
  165    229   
                );
         230  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  166    231   
                let content_length = payload.len();
  167    232   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  168    233   
                    builder,
  169    234   
                    ::http::header::CONTENT_LENGTH,
  170    235   
                    content_length,
  171    236   
                );
         237  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  172    238   
                builder
  173    239   
                    .status(503)
  174    240   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         241  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  175    242   
            }
         243  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  176    244   
            crate::error::StartSnapshotError::RequestThrottledException(output) => {
         245  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  177    246   
                let payload = crate::protocol_serde::shape_request_throttled_exception::ser_request_throttled_exception_error(output)?;
         247  +
                /* RustType.kt:516 */
  178    248   
                #[allow(unused_mut)]
         249  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  179    250   
                let mut builder = ::http::Response::builder();
         251  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  180    252   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  181    253   
                    builder,
  182    254   
                    ::http::header::CONTENT_TYPE,
  183    255   
                    "application/json",
  184    256   
                );
         257  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  185    258   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  186    259   
                    builder,
  187    260   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  188    261   
                    "RequestThrottledException",
  189    262   
                );
         263  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  190    264   
                let content_length = payload.len();
  191    265   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  192    266   
                    builder,
  193    267   
                    ::http::header::CONTENT_LENGTH,
  194    268   
                    content_length,
  195    269   
                );
         270  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  196    271   
                builder
  197    272   
                    .status(400)
  198    273   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         274  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  199    275   
            }
         276  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  200    277   
            crate::error::StartSnapshotError::ServiceQuotaExceededException(output) => {
         278  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  201    279   
                let payload = crate::protocol_serde::shape_service_quota_exceeded_exception::ser_service_quota_exceeded_exception_error(output)?;
         280  +
                /* RustType.kt:516 */
  202    281   
                #[allow(unused_mut)]
         282  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  203    283   
                let mut builder = ::http::Response::builder();
         284  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  204    285   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  205    286   
                    builder,
  206    287   
                    ::http::header::CONTENT_TYPE,
  207    288   
                    "application/json",
  208    289   
                );
         290  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  209    291   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  210    292   
                    builder,
  211    293   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  212    294   
                    "ServiceQuotaExceededException",
  213    295   
                );
         296  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  214    297   
                let content_length = payload.len();
  215    298   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  216    299   
                    builder,
  217    300   
                    ::http::header::CONTENT_LENGTH,
  218    301   
                    content_length,
  219    302   
                );
         303  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  220    304   
                builder
  221    305   
                    .status(402)
  222    306   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         307  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  223    308   
            }
         309  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  224    310   
            crate::error::StartSnapshotError::ConcurrentLimitExceededException(output) => {
         311  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  225    312   
                let payload = crate::protocol_serde::shape_concurrent_limit_exceeded_exception::ser_concurrent_limit_exceeded_exception_error(output)?;
         313  +
                /* RustType.kt:516 */
  226    314   
                #[allow(unused_mut)]
         315  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  227    316   
                let mut builder = ::http::Response::builder();
         317  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  228    318   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  229    319   
                    builder,
  230    320   
                    ::http::header::CONTENT_TYPE,
  231    321   
                    "application/json",
  232    322   
                );
         323  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  233    324   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  234    325   
                    builder,
  235    326   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  236    327   
                    "ConcurrentLimitExceededException",
  237    328   
                );
         329  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  238    330   
                let content_length = payload.len();
  239    331   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  240    332   
                    builder,
  241    333   
                    ::http::header::CONTENT_LENGTH,
  242    334   
                    content_length,
  243    335   
                );
         336  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  244    337   
                builder
  245    338   
                    .status(400)
  246    339   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         340  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  247    341   
            }
         342  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  248    343   
            crate::error::StartSnapshotError::ValidationException(output) => {
         344  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  249    345   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         346  +
                /* RustType.kt:516 */
  250    347   
                #[allow(unused_mut)]
         348  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  251    349   
                let mut builder = ::http::Response::builder();
         350  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  252    351   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  253    352   
                    builder,
  254    353   
                    ::http::header::CONTENT_TYPE,
  255    354   
                    "application/json",
  256    355   
                );
         356  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  257    357   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  258    358   
                    builder,
  259    359   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  260    360   
                    "ValidationException",
  261    361   
                );
         362  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  262    363   
                let content_length = payload.len();
  263    364   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  264    365   
                    builder,
  265    366   
                    ::http::header::CONTENT_LENGTH,
  266    367   
                    content_length,
  267    368   
                );
         369  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  268    370   
                builder
  269    371   
                    .status(400)
  270    372   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  271         -
            }
         373  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         374  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  272    375   
        }
         376  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  273    377   
    })
         378  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  274    379   
}
  275    380   
         381  +
/* JsonParserGenerator.kt:148 */
  276    382   
pub(crate) fn de_start_snapshot(
  277    383   
    value: &[u8],
  278    384   
    mut builder: crate::input::start_snapshot_input::Builder,
  279    385   
) -> ::std::result::Result<
  280    386   
    crate::input::start_snapshot_input::Builder,
  281    387   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  282    388   
> {
         389  +
    /* JsonParserGenerator.kt:153 */
  283    390   
    let mut tokens_owned =
  284    391   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  285    392   
            .peekable();
  286    393   
    let tokens = &mut tokens_owned;
  287    394   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         395  +
    /* JsonParserGenerator.kt:684 */
  288    396   
    loop {
         397  +
        /* JsonParserGenerator.kt:685 */
  289    398   
        match tokens.next().transpose()? {
         399  +
            /* JsonParserGenerator.kt:686 */
  290    400   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  291    401   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         402  +
                /* JsonParserGenerator.kt:260 */
  292    403   
                match key.to_unescaped()?.as_ref() {
         404  +
                    /* JsonParserGenerator.kt:262 */
  293    405   
                    "ClientToken" => {
         406  +
                        /* JsonParserGenerator.kt:272 */
  294    407   
                        builder = builder.set_client_token(
         408  +
                            /* JsonParserGenerator.kt:354 */
  295    409   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  296    410   
                                tokens.next(),
  297    411   
                            )?
  298         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  299         -
                            .transpose()?,
         412  +
                            .map(|s|
         413  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         414  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         415  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         416  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  300    417   
                        );
         418  +
                        /* JsonParserGenerator.kt:262 */
  301    419   
                    }
         420  +
                    /* JsonParserGenerator.kt:262 */
  302    421   
                    "Description" => {
         422  +
                        /* JsonParserGenerator.kt:272 */
  303    423   
                        builder = builder.set_description(
         424  +
                            /* JsonParserGenerator.kt:354 */
  304    425   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  305    426   
                                tokens.next(),
  306    427   
                            )?
  307         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  308         -
                            .transpose()?,
         428  +
                            .map(|s|
         429  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         430  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         431  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         432  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  309    433   
                        );
         434  +
                        /* JsonParserGenerator.kt:262 */
  310    435   
                    }
         436  +
                    /* JsonParserGenerator.kt:262 */
  311    437   
                    "Encrypted" => {
         438  +
                        /* JsonParserGenerator.kt:272 */
  312    439   
                        builder = builder.set_encrypted(
         440  +
                            /* JsonParserGenerator.kt:298 */
  313    441   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  314    442   
                                tokens.next(),
  315         -
                            )?,
         443  +
                            )?, /* JsonParserGenerator.kt:272 */
  316    444   
                        );
         445  +
                        /* JsonParserGenerator.kt:262 */
  317    446   
                    }
         447  +
                    /* JsonParserGenerator.kt:262 */
  318    448   
                    "KmsKeyArn" => {
         449  +
                        /* JsonParserGenerator.kt:272 */
  319    450   
                        builder = builder.set_kms_key_arn(
         451  +
                            /* JsonParserGenerator.kt:354 */
  320    452   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  321    453   
                                tokens.next(),
  322    454   
                            )?
  323         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  324         -
                            .transpose()?,
         455  +
                            .map(|s|
         456  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         457  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         458  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         459  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  325    460   
                        );
         461  +
                        /* JsonParserGenerator.kt:262 */
  326    462   
                    }
         463  +
                    /* JsonParserGenerator.kt:262 */
  327    464   
                    "ParentSnapshotId" => {
         465  +
                        /* JsonParserGenerator.kt:272 */
  328    466   
                        builder = builder.set_parent_snapshot_id(
         467  +
                            /* JsonParserGenerator.kt:354 */
  329    468   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  330    469   
                                tokens.next(),
  331    470   
                            )?
  332         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  333         -
                            .transpose()?,
         471  +
                            .map(|s|
         472  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         473  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         474  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         475  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  334    476   
                        );
         477  +
                        /* JsonParserGenerator.kt:262 */
  335    478   
                    }
         479  +
                    /* JsonParserGenerator.kt:262 */
  336    480   
                    "Tags" => {
  337         -
                        builder =
  338         -
                            builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens)?);
         481  +
                        /* JsonParserGenerator.kt:272 */
         482  +
                        builder = builder.set_tags(
         483  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_tags::de_tags(tokens)?
         484  +
                        /* JsonParserGenerator.kt:272 */);
         485  +
                        /* JsonParserGenerator.kt:262 */
  339    486   
                    }
         487  +
                    /* JsonParserGenerator.kt:262 */
  340    488   
                    "Timeout" => {
         489  +
                        /* JsonParserGenerator.kt:272 */
  341    490   
                        builder = builder.set_timeout(
         491  +
                            /* JsonParserGenerator.kt:365 */
  342    492   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  343    493   
                                tokens.next(),
  344    494   
                            )?
  345    495   
                            .map(i32::try_from)
  346         -
                            .transpose()?,
         496  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  347    497   
                        );
         498  +
                        /* JsonParserGenerator.kt:262 */
  348    499   
                    }
         500  +
                    /* JsonParserGenerator.kt:262 */
  349    501   
                    "VolumeSize" => {
         502  +
                        /* JsonParserGenerator.kt:276 */
  350    503   
                        if let Some(v) =
         504  +
                            /* JsonParserGenerator.kt:365 */
  351    505   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  352         -
                                tokens.next(),
  353         -
                            )?
  354         -
                            .map(i64::try_from)
  355         -
                            .transpose()?
         506  +
                                    tokens.next(),
         507  +
                                )?
         508  +
                                .map(i64::try_from)
         509  +
                                .transpose()?
         510  +
                        /* JsonParserGenerator.kt:278 */
  356    511   
                        {
  357    512   
                            builder = builder.set_volume_size(v);
  358    513   
                        }
         514  +
                        /* JsonParserGenerator.kt:262 */
  359    515   
                    }
  360         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         516  +
                    /* JsonParserGenerator.kt:290 */
         517  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  361    518   
                }
         519  +
                /* JsonParserGenerator.kt:686 */
  362    520   
            }
         521  +
            /* JsonParserGenerator.kt:695 */
  363    522   
            other => {
  364    523   
                return Err(
  365    524   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  366    525   
                        "expected object key or end object, found: {:?}",
  367    526   
                        other
  368    527   
                    )),
  369    528   
                )
  370         -
            }
         529  +
            } /* JsonParserGenerator.kt:685 */
  371    530   
        }
         531  +
        /* JsonParserGenerator.kt:684 */
  372    532   
    }
         533  +
    /* JsonParserGenerator.kt:250 */
  373    534   
    if tokens.next().is_some() {
         535  +
        /* JsonParserGenerator.kt:251 */
  374    536   
        return Err(
  375    537   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  376    538   
                "found more JSON tokens after completing parsing",
  377    539   
            ),
  378    540   
        );
         541  +
        /* JsonParserGenerator.kt:250 */
  379    542   
    }
         543  +
    /* JsonParserGenerator.kt:163 */
  380    544   
    Ok(builder)
         545  +
    /* JsonParserGenerator.kt:148 */
  381    546   
}

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

@@ -1,1 +67,114 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_start_snapshot_output_output_output(
    3      4   
    value: &crate::output::StartSnapshotOutput,
    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_start_snapshot_output::ser_start_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_start_snapshot_output_output(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::output::StartSnapshotOutput,
   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.description {
          36  +
        /* JsonSerializerGenerator.kt:423 */
   26     37   
        object.key("Description").string(var_2.as_str());
          38  +
        /* JsonSerializerGenerator.kt:382 */
   27     39   
    }
          40  +
    /* JsonSerializerGenerator.kt:382 */
   28     41   
    if let Some(var_3) = &input.kms_key_arn {
          42  +
        /* JsonSerializerGenerator.kt:423 */
   29     43   
        object.key("KmsKeyArn").string(var_3.as_str());
          44  +
        /* JsonSerializerGenerator.kt:382 */
   30     45   
    }
          46  +
    /* JsonSerializerGenerator.kt:382 */
   31     47   
    if let Some(var_4) = &input.owner_id {
          48  +
        /* JsonSerializerGenerator.kt:423 */
   32     49   
        object.key("OwnerId").string(var_4.as_str());
          50  +
        /* JsonSerializerGenerator.kt:382 */
   33     51   
    }
          52  +
    /* JsonSerializerGenerator.kt:382 */
   34     53   
    if let Some(var_5) = &input.parent_snapshot_id {
          54  +
        /* JsonSerializerGenerator.kt:423 */
   35     55   
        object.key("ParentSnapshotId").string(var_5.as_str());
          56  +
        /* JsonSerializerGenerator.kt:382 */
   36     57   
    }
          58  +
    /* JsonSerializerGenerator.kt:382 */
   37     59   
    if let Some(var_6) = &input.snapshot_id {
          60  +
        /* JsonSerializerGenerator.kt:423 */
   38     61   
        object.key("SnapshotId").string(var_6.as_str());
          62  +
        /* JsonSerializerGenerator.kt:382 */
   39     63   
    }
          64  +
    /* JsonSerializerGenerator.kt:382 */
   40     65   
    if let Some(var_7) = &input.start_time {
          66  +
        /* JsonSerializerGenerator.kt:448 */
   41     67   
        object
   42     68   
            .key("StartTime")
   43     69   
            .date_time(var_7, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
          70  +
        /* JsonSerializerGenerator.kt:382 */
   44     71   
    }
          72  +
    /* JsonSerializerGenerator.kt:382 */
   45     73   
    if let Some(var_8) = &input.status {
          74  +
        /* JsonSerializerGenerator.kt:423 */
   46     75   
        object.key("Status").string(var_8.as_str());
          76  +
        /* JsonSerializerGenerator.kt:382 */
   47     77   
    }
          78  +
    /* JsonSerializerGenerator.kt:382 */
   48     79   
    if let Some(var_9) = &input.tags {
          80  +
        /* JsonSerializerGenerator.kt:484 */
   49     81   
        let mut array_10 = object.key("Tags").start_array();
          82  +
        /* JsonSerializerGenerator.kt:524 */
   50     83   
        for item_11 in var_9 {
          84  +
            /* SerializerUtil.kt:42 */
   51     85   
            {
          86  +
                /* JsonSerializerGenerator.kt:495 */
   52     87   
                #[allow(unused_mut)]
          88  +
                /* JsonSerializerGenerator.kt:496 */
   53     89   
                let mut object_12 = array_10.value().start_object();
          90  +
                /* JsonSerializerGenerator.kt:375 */
   54     91   
                crate::protocol_serde::shape_tag::ser_tag(&mut object_12, item_11)?;
          92  +
                /* JsonSerializerGenerator.kt:515 */
   55     93   
                object_12.finish();
          94  +
                /* SerializerUtil.kt:42 */
   56     95   
            }
          96  +
            /* JsonSerializerGenerator.kt:524 */
   57     97   
        }
          98  +
        /* JsonSerializerGenerator.kt:486 */
   58     99   
        array_10.finish();
         100  +
        /* JsonSerializerGenerator.kt:382 */
   59    101   
    }
         102  +
    /* JsonSerializerGenerator.kt:382 */
   60    103   
    if let Some(var_13) = &input.volume_size {
         104  +
        /* JsonSerializerGenerator.kt:432 */
   61    105   
        object.key("VolumeSize").number(
   62    106   
            #[allow(clippy::useless_conversion)]
   63    107   
            ::aws_smithy_types::Number::NegInt((var_13.0).into()),
   64    108   
        );
         109  +
        /* JsonSerializerGenerator.kt:382 */
   65    110   
    }
         111  +
    /* JsonSerializerGenerator.kt:372 */
   66    112   
    Ok(())
         113  +
    /* JsonSerializerGenerator.kt:358 */
   67    114   
}

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

@@ -1,1 +77,113 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_tag(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::Tag,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.key {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("Key").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:382 */
    9     14   
    if let Some(var_2) = &input.value {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("Value").string(var_2.as_str());
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}
   14     23   
          24  +
/* JsonParserGenerator.kt:516 */
   15     25   
pub(crate) fn de_tag<'a, I>(
   16     26   
    tokens: &mut ::std::iter::Peekable<I>,
   17     27   
) -> ::std::result::Result<
   18     28   
    Option<crate::model::tag::Builder>,
   19     29   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   20     30   
>
   21     31   
where
   22     32   
    I: Iterator<
   23     33   
        Item = Result<
   24     34   
            ::aws_smithy_json::deserialize::Token<'a>,
   25     35   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   26     36   
        >,
   27     37   
    >,
   28     38   
{
          39  +
    /* JsonParserGenerator.kt:712 */
   29     40   
    match tokens.next().transpose()? {
          41  +
        /* JsonParserGenerator.kt:713 */
   30     42   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   31     43   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          44  +
            /* RustType.kt:516 */
   32     45   
            #[allow(unused_mut)]
          46  +
            /* JsonParserGenerator.kt:526 */
   33     47   
            let mut builder = crate::model::tag::Builder::default();
          48  +
            /* JsonParserGenerator.kt:684 */
   34     49   
            loop {
          50  +
                /* JsonParserGenerator.kt:685 */
   35     51   
                match tokens.next().transpose()? {
          52  +
                    /* JsonParserGenerator.kt:686 */
   36     53   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   37     54   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          55  +
                        /* JsonParserGenerator.kt:260 */
   38     56   
                        match key.to_unescaped()?.as_ref() {
          57  +
                            /* JsonParserGenerator.kt:262 */
   39     58   
                            "Key" => {
          59  +
                                /* JsonParserGenerator.kt:272 */
   40     60   
                                builder = builder.set_key(
   41         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   42         -
                                        tokens.next(),
   43         -
                                    )?
   44         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   45         -
                                    .transpose()?,
   46         -
                                );
          61  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          62  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          63  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          64  +
                                        /* JsonParserGenerator.kt:339 */)
          65  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          66  +
                                /* JsonParserGenerator.kt:272 */);
          67  +
                                /* JsonParserGenerator.kt:262 */
   47     68   
                            }
          69  +
                            /* JsonParserGenerator.kt:262 */
   48     70   
                            "Value" => {
          71  +
                                /* JsonParserGenerator.kt:272 */
   49     72   
                                builder = builder.set_value(
   50         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   51         -
                                        tokens.next(),
   52         -
                                    )?
   53         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   54         -
                                    .transpose()?,
   55         -
                                );
          73  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          74  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          75  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          76  +
                                        /* JsonParserGenerator.kt:339 */)
          77  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          78  +
                                /* JsonParserGenerator.kt:272 */);
          79  +
                                /* JsonParserGenerator.kt:262 */
   56     80   
                            }
   57         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          81  +
                            /* JsonParserGenerator.kt:290 */
          82  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   58     83   
                        }
          84  +
                        /* JsonParserGenerator.kt:686 */
   59     85   
                    }
          86  +
                    /* JsonParserGenerator.kt:695 */
   60     87   
                    other => {
   61     88   
                        return Err(
   62     89   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63     90   
                                format!("expected object key or end object, found: {:?}", other),
   64     91   
                            ),
   65     92   
                        )
   66         -
                    }
          93  +
                    } /* JsonParserGenerator.kt:685 */
   67     94   
                }
          95  +
                /* JsonParserGenerator.kt:684 */
   68     96   
            }
          97  +
            /* JsonParserGenerator.kt:540 */
   69     98   
            Ok(Some(builder))
          99  +
            /* JsonParserGenerator.kt:713 */
   70    100   
        }
   71         -
        _ => Err(
   72         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   73         -
                "expected start object or null",
   74         -
            ),
   75         -
        ),
         101  +
        /* JsonParserGenerator.kt:722 */
         102  +
        _ => {
         103  +
            /* JsonParserGenerator.kt:723 */
         104  +
            Err(
         105  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         106  +
                    "expected start object or null",
         107  +
                ),
         108  +
            )
         109  +
            /* JsonParserGenerator.kt:722 */
         110  +
        } /* JsonParserGenerator.kt:712 */
   76    111   
    }
         112  +
    /* JsonParserGenerator.kt:516 */
   77    113   
}

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

@@ -1,1 +50,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_tags<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::tags_unconstrained::TagsUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = crate::protocol_serde::shape_tag::de_tag(tokens)?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_tag::de_tag(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   28     42   
                        if let Some(value) = value {
   29     43   
                            items.push(value);
   30         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   31     47   
                            return Err(
   32     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     49   
                                    "dense list cannot contain null values",
   34     50   
                                ),
   35     51   
                            );
   36     52   
                        }
   37         -
                    }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   38     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   39     57   
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   40     59   
            Ok(Some(
   41     60   
                crate::unconstrained::tags_unconstrained::TagsUnconstrained(items),
   42     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   43     63   
        }
   44         -
        _ => Err(
   45         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
                "expected start array or null",
   47         -
            ),
   48         -
        ),
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
          68  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          69  +
                    "expected start array or null",
          70  +
                ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   49     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   50     76   
}

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

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_validation_exception_error(
    3      4   
    value: &crate::error::ValidationException,
    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_validation_exception::ser_validation_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_validation_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::ValidationException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.field_list {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_2 = object.key("fieldList").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_3 in var_1 {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
   23     34   
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
   24     36   
                let mut object_4 = array_2.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
   25     38   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
   26     40   
                object_4.finish();
          41  +
                /* SerializerUtil.kt:42 */
   27     42   
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
   28     44   
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
   29     46   
        array_2.finish();
          47  +
        /* JsonSerializerGenerator.kt:382 */
   30     48   
    }
          49  +
    /* SerializerUtil.kt:42 */
   31     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
   32     52   
        object.key("message").string(input.message.as_str());
          53  +
        /* SerializerUtil.kt:42 */
   33     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:372 */
   34     56   
    Ok(())
          57  +
    /* JsonSerializerGenerator.kt:358 */
   35     58   
}

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

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_validation_exception_field(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::ValidationExceptionField,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* SerializerUtil.kt:42 */
    6      8   
    {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("path").string(input.path.as_str());
          11  +
        /* SerializerUtil.kt:42 */
    8     12   
    }
          13  +
    /* SerializerUtil.kt:42 */
    9     14   
    {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("message").string(input.message.as_str());
          17  +
        /* SerializerUtil.kt:42 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`Ebs`].
    3      4   
///
    4      5   
/// Constructed via [`Ebs::builder`].
    5      6   
pub struct EbsBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    complete_snapshot: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    get_snapshot_block: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    list_changed_blocks: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    list_snapshot_blocks: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    put_snapshot_block: Option<::aws_smithy_http_server::routing::Route<Body>>,
   11     12   
    start_snapshot: Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -1504,1505 +1563,1565 @@
 1524   1525   
            "com.amazonaws.ebs",
 1525   1526   
            "Ebs",
 1526   1527   
        );
 1527   1528   
 1528   1529   
    const VERSION: Option<&'static str> = Some("2019-11-02");
 1529   1530   
 1530   1531   
    type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
 1531   1532   
 1532   1533   
    type Operations = Operation;
 1533   1534   
}
        1535  +
/* ServiceConfigGenerator.kt:178 */
 1534   1536   
/// Configuration for the [`Ebs`]. This is the central place where to register and
 1535   1537   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 1536   1538   
///
 1537   1539   
/// ```rust,no_run
 1538   1540   
/// # use ebs::EbsConfig;
 1539   1541   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 1540   1542   
/// # use ::tower::layer::util::Identity;
 1541   1543   
/// # let authentication_plugin = IdentityPlugin;
 1542   1544   
/// # let authorization_plugin = IdentityPlugin;
 1543   1545   
/// # let server_request_id_provider_layer = Identity::new();
@@ -1617,1619 +1676,1679 @@
 1637   1639   
 1638   1640   
    /// Build the configuration.
 1639   1641   
    pub fn build(self) -> super::EbsConfig<L, H, M> {
 1640   1642   
        super::EbsConfig {
 1641   1643   
            layers: self.layers,
 1642   1644   
            http_plugins: self.http_plugins,
 1643   1645   
            model_plugins: self.model_plugins,
 1644   1646   
        }
 1645   1647   
    }
 1646   1648   
}
        1649  +
/* ScopeMacroGenerator.kt:81 */
 1647   1650   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 1648   1651   
///
 1649   1652   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 1650   1653   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 1651   1654   
///
 1652   1655   
/// # Example
 1653   1656   
///
 1654   1657   
/// ```rust
 1655   1658   
/// scope! {
 1656   1659   
///     /// Includes [`CompleteSnapshot`], excluding all other operations.