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.rs

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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