Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

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

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

@@ -1,1 +284,388 @@
    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_internal::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))?
         349  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  257    350   
            }
         351  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  258    352   
            crate::error::ListSnapshotBlocksError::InternalServerError(output) => {
         353  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  259    354   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         355  +
                /* RustType.kt:516 */
  260    356   
                #[allow(unused_mut)]
         357  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  261    358   
                let mut builder = ::http::Response::builder();
         359  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  262    360   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  263    361   
                    builder,
  264    362   
                    ::http::header::CONTENT_TYPE,
  265    363   
                    "application/json",
  266    364   
                );
         365  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  267    366   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  268    367   
                    builder,
  269    368   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  270    369   
                    "InternalServerError",
  271    370   
                );
         371  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  272    372   
                let content_length = payload.len();
  273    373   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  274    374   
                    builder,
  275    375   
                    ::http::header::CONTENT_LENGTH,
  276    376   
                    content_length,
  277    377   
                );
         378  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  278    379   
                builder
  279    380   
                    .status(500)
  280    381   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         382  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         383  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  281    384   
        }
  282         -
        }
         385  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  283    386   
    })
         387  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  284    388   
}

tmp-codegen-diff/codegen-server-test-python/ebs/rust-server-codegen-python/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-python/ebs/rust-server-codegen-python/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).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-python/ebs/rust-server-codegen-python/src/protocol_serde/shape_put_snapshot_block.rs

@@ -1,1 +344,461 @@
    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_internal::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))?
         367  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  277    368   
            }
         369  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  278    370   
            crate::error::PutSnapshotBlockError::InternalServerError(output) => {
         371  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  279    372   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         373  +
                /* RustType.kt:516 */
  280    374   
                #[allow(unused_mut)]
         375  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  281    376   
                let mut builder = ::http::Response::builder();
         377  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  282    378   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  283    379   
                    builder,
  284    380   
                    ::http::header::CONTENT_TYPE,
  285    381   
                    "application/json",
  286    382   
                );
         383  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  287    384   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  288    385   
                    builder,
  289    386   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  290    387   
                    "InternalServerError",
  291    388   
                );
         389  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  292    390   
                let content_length = payload.len();
  293    391   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  294    392   
                    builder,
  295    393   
                    ::http::header::CONTENT_LENGTH,
  296    394   
                    content_length,
  297    395   
                );
         396  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  298    397   
                builder
  299    398   
                    .status(500)
  300    399   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         400  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         401  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  301    402   
        }
  302         -
        }
         403  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  303    404   
    })
         405  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  304    406   
}
  305    407   
         408  +
/* HttpBindingGenerator.kt:542 */
  306    409   
pub fn ser_put_snapshot_block_headers(
  307    410   
    input: &crate::output::PutSnapshotBlockOutput,
  308    411   
    mut builder: ::http::response::Builder,
  309    412   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  310    413   
{
         414  +
    /* HttpBindingGenerator.kt:592 */
  311    415   
    if let ::std::option::Option::Some(inner_1) = &input.checksum_algorithm {
         416  +
        /* HttpBindingGenerator.kt:704 */
  312    417   
        let formatted_2 = inner_1.as_str();
         418  +
        /* HttpBindingGenerator.kt:705 */
  313    419   
        if !formatted_2.is_empty() {
         420  +
            /* HttpBindingGenerator.kt:706 */
  314    421   
            let header_value = formatted_2;
  315    422   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  316    423   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  317    424   
                    "checksum_algorithm",
  318    425   
                    format!(
  319    426   
                        "`{}` cannot be used as a header value: {}",
  320    427   
                        &header_value, err
  321    428   
                    ),
  322    429   
                )
  323    430   
            })?;
  324    431   
            builder = builder.header("x-amz-Checksum-Algorithm", header_value);
         432  +
            /* HttpBindingGenerator.kt:705 */
  325    433   
        }
         434  +
        /* HttpBindingGenerator.kt:592 */
  326    435   
    }
         436  +
    /* HttpBindingGenerator.kt:592 */
  327    437   
    if let ::std::option::Option::Some(inner_3) = &input.checksum {
         438  +
        /* HttpBindingGenerator.kt:704 */
  328    439   
        let formatted_4 = inner_3.as_str();
         440  +
        /* HttpBindingGenerator.kt:705 */
  329    441   
        if !formatted_4.is_empty() {
         442  +
            /* HttpBindingGenerator.kt:706 */
  330    443   
            let header_value = formatted_4;
  331    444   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  332    445   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  333    446   
                    "checksum",
  334    447   
                    format!(
  335    448   
                        "`{}` cannot be used as a header value: {}",
  336    449   
                        &header_value, err
  337    450   
                    ),
  338    451   
                )
  339    452   
            })?;
  340    453   
            builder = builder.header("x-amz-Checksum", header_value);
         454  +
            /* HttpBindingGenerator.kt:705 */
  341    455   
        }
         456  +
        /* HttpBindingGenerator.kt:592 */
  342    457   
    }
         458  +
    /* HttpBindingGenerator.kt:555 */
  343    459   
    Ok(builder)
         460  +
    /* HttpBindingGenerator.kt:542 */
  344    461   
}

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

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

tmp-codegen-diff/codegen-server-test-python/ebs/rust-server-codegen-python/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-python/ebs/rust-server-codegen-python/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-python/ebs/rust-server-codegen-python/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-python/ebs/rust-server-codegen-python/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-python/ebs/rust-server-codegen-python/src/protocol_serde/shape_start_snapshot.rs

@@ -1,1 +405,579 @@
    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_internal::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))?
         373  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  271    374   
            }
         375  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  272    376   
            crate::error::StartSnapshotError::InternalServerError(output) => {
         377  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  273    378   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         379  +
                /* RustType.kt:516 */
  274    380   
                #[allow(unused_mut)]
         381  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  275    382   
                let mut builder = ::http::Response::builder();
         383  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  276    384   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  277    385   
                    builder,
  278    386   
                    ::http::header::CONTENT_TYPE,
  279    387   
                    "application/json",
  280    388   
                );
         389  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  281    390   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  282    391   
                    builder,
  283    392   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  284    393   
                    "InternalServerError",
  285    394   
                );
         395  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  286    396   
                let content_length = payload.len();
  287    397   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  288    398   
                    builder,
  289    399   
                    ::http::header::CONTENT_LENGTH,
  290    400   
                    content_length,
  291    401   
                );
         402  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  292    403   
                builder
  293    404   
                    .status(500)
  294    405   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         406  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         407  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  295    408   
        }
  296         -
        }
         409  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  297    410   
    })
         411  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  298    412   
}
  299    413   
         414  +
/* JsonParserGenerator.kt:148 */
  300    415   
pub(crate) fn de_start_snapshot(
  301    416   
    value: &[u8],
  302    417   
    mut builder: crate::input::start_snapshot_input_internal::Builder,
  303    418   
) -> ::std::result::Result<
  304    419   
    crate::input::start_snapshot_input_internal::Builder,
  305    420   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  306    421   
> {
         422  +
    /* JsonParserGenerator.kt:153 */
  307    423   
    let mut tokens_owned =
  308    424   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  309    425   
            .peekable();
  310    426   
    let tokens = &mut tokens_owned;
  311    427   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         428  +
    /* JsonParserGenerator.kt:684 */
  312    429   
    loop {
         430  +
        /* JsonParserGenerator.kt:685 */
  313    431   
        match tokens.next().transpose()? {
         432  +
            /* JsonParserGenerator.kt:686 */
  314    433   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  315    434   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         435  +
                /* JsonParserGenerator.kt:260 */
  316    436   
                match key.to_unescaped()?.as_ref() {
         437  +
                    /* JsonParserGenerator.kt:262 */
  317    438   
                    "ClientToken" => {
         439  +
                        /* JsonParserGenerator.kt:272 */
  318    440   
                        builder = builder.set_client_token(
         441  +
                            /* JsonParserGenerator.kt:354 */
  319    442   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  320    443   
                                tokens.next(),
  321    444   
                            )?
  322         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  323         -
                            .transpose()?,
         445  +
                            .map(|s|
         446  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         447  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         448  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         449  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  324    450   
                        );
         451  +
                        /* JsonParserGenerator.kt:262 */
  325    452   
                    }
         453  +
                    /* JsonParserGenerator.kt:262 */
  326    454   
                    "Description" => {
         455  +
                        /* JsonParserGenerator.kt:272 */
  327    456   
                        builder = builder.set_description(
         457  +
                            /* JsonParserGenerator.kt:354 */
  328    458   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  329    459   
                                tokens.next(),
  330    460   
                            )?
  331         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  332         -
                            .transpose()?,
         461  +
                            .map(|s|
         462  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         463  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         464  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         465  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  333    466   
                        );
         467  +
                        /* JsonParserGenerator.kt:262 */
  334    468   
                    }
         469  +
                    /* JsonParserGenerator.kt:262 */
  335    470   
                    "Encrypted" => {
         471  +
                        /* JsonParserGenerator.kt:272 */
  336    472   
                        builder = builder.set_encrypted(
         473  +
                            /* JsonParserGenerator.kt:298 */
  337    474   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  338    475   
                                tokens.next(),
  339         -
                            )?,
         476  +
                            )?, /* JsonParserGenerator.kt:272 */
  340    477   
                        );
         478  +
                        /* JsonParserGenerator.kt:262 */
  341    479   
                    }
         480  +
                    /* JsonParserGenerator.kt:262 */
  342    481   
                    "KmsKeyArn" => {
         482  +
                        /* JsonParserGenerator.kt:272 */
  343    483   
                        builder = builder.set_kms_key_arn(
         484  +
                            /* JsonParserGenerator.kt:354 */
  344    485   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  345    486   
                                tokens.next(),
  346    487   
                            )?
  347         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  348         -
                            .transpose()?,
         488  +
                            .map(|s|
         489  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         490  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         491  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         492  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  349    493   
                        );
         494  +
                        /* JsonParserGenerator.kt:262 */
  350    495   
                    }
         496  +
                    /* JsonParserGenerator.kt:262 */
  351    497   
                    "ParentSnapshotId" => {
         498  +
                        /* JsonParserGenerator.kt:272 */
  352    499   
                        builder = builder.set_parent_snapshot_id(
         500  +
                            /* JsonParserGenerator.kt:354 */
  353    501   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  354    502   
                                tokens.next(),
  355    503   
                            )?
  356         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  357         -
                            .transpose()?,
         504  +
                            .map(|s|
         505  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         506  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         507  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         508  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  358    509   
                        );
         510  +
                        /* JsonParserGenerator.kt:262 */
  359    511   
                    }
         512  +
                    /* JsonParserGenerator.kt:262 */
  360    513   
                    "Tags" => {
  361         -
                        builder =
  362         -
                            builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens)?);
         514  +
                        /* JsonParserGenerator.kt:272 */
         515  +
                        builder = builder.set_tags(
         516  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_tags::de_tags(tokens)?
         517  +
                        /* JsonParserGenerator.kt:272 */);
         518  +
                        /* JsonParserGenerator.kt:262 */
  363    519   
                    }
         520  +
                    /* JsonParserGenerator.kt:262 */
  364    521   
                    "Timeout" => {
         522  +
                        /* JsonParserGenerator.kt:272 */
  365    523   
                        builder = builder.set_timeout(
         524  +
                            /* JsonParserGenerator.kt:365 */
  366    525   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  367    526   
                                tokens.next(),
  368    527   
                            )?
  369    528   
                            .map(i32::try_from)
  370         -
                            .transpose()?,
         529  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  371    530   
                        );
         531  +
                        /* JsonParserGenerator.kt:262 */
  372    532   
                    }
         533  +
                    /* JsonParserGenerator.kt:262 */
  373    534   
                    "VolumeSize" => {
         535  +
                        /* JsonParserGenerator.kt:276 */
  374    536   
                        if let Some(v) =
         537  +
                            /* JsonParserGenerator.kt:365 */
  375    538   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  376    539   
                                    tokens.next(),
  377    540   
                                )?
  378    541   
                                .map(i64::try_from)
  379    542   
                                .transpose()?
         543  +
                        /* JsonParserGenerator.kt:278 */
  380    544   
                        {
  381    545   
                            builder = builder.set_volume_size(v);
  382    546   
                        }
         547  +
                        /* JsonParserGenerator.kt:262 */
  383    548   
                    }
  384         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         549  +
                    /* JsonParserGenerator.kt:290 */
         550  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  385    551   
                }
         552  +
                /* JsonParserGenerator.kt:686 */
  386    553   
            }
         554  +
            /* JsonParserGenerator.kt:695 */
  387    555   
            other => {
  388    556   
                return Err(
  389    557   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  390    558   
                        "expected object key or end object, found: {:?}",
  391    559   
                        other
  392    560   
                    )),
  393    561   
                )
         562  +
            } /* JsonParserGenerator.kt:685 */
  394    563   
        }
         564  +
        /* JsonParserGenerator.kt:684 */
  395    565   
    }
  396         -
    }
         566  +
    /* JsonParserGenerator.kt:250 */
  397    567   
    if tokens.next().is_some() {
         568  +
        /* JsonParserGenerator.kt:251 */
  398    569   
        return Err(
  399    570   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  400    571   
                "found more JSON tokens after completing parsing",
  401    572   
            ),
  402    573   
        );
         574  +
        /* JsonParserGenerator.kt:250 */
  403    575   
    }
         576  +
    /* JsonParserGenerator.kt:163 */
  404    577   
    Ok(builder)
         578  +
    /* JsonParserGenerator.kt:148 */
  405    579   
}

tmp-codegen-diff/codegen-server-test-python/ebs/rust-server-codegen-python/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).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-python/ebs/rust-server-codegen-python/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_internal::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_internal::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   
                        )
          93  +
                    } /* JsonParserGenerator.kt:685 */
   66     94   
                }
          95  +
                /* JsonParserGenerator.kt:684 */
   67     96   
            }
   68         -
            }
          97  +
            /* JsonParserGenerator.kt:540 */
   69     98   
            Ok(Some(builder))
          99  +
            /* JsonParserGenerator.kt:713 */
   70    100   
        }
   71         -
        _ => Err(
         101  +
        /* JsonParserGenerator.kt:722 */
         102  +
        _ => {
         103  +
            /* JsonParserGenerator.kt:723 */
         104  +
            Err(
   72    105   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   73    106   
                    "expected start object or null",
   74    107   
                ),
   75         -
        ),
         108  +
            )
         109  +
            /* JsonParserGenerator.kt:722 */
         110  +
        } /* JsonParserGenerator.kt:712 */
   76    111   
    }
         112  +
    /* JsonParserGenerator.kt:516 */
   77    113   
}

tmp-codegen-diff/codegen-server-test-python/ebs/rust-server-codegen-python/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   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   37     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   38     57   
            }
   39         -
            }
          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(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   45     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     69   
                    "expected start array or null",
   47     70   
                ),
   48         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   49     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   50     76   
}

tmp-codegen-diff/codegen-server-test-python/ebs/rust-server-codegen-python/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-python/ebs/rust-server-codegen-python/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   
}