Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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))?
  273         -
            }
         370  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         371  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  274    372   
        }
         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))?
  290         -
            }
         393  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         394  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  291    395   
        }
         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   
}

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

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

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

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

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

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

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

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

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

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

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

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