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

@@ -1,1 +20,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_put_snapshot_block_output_output_output(
    3      4   
    value: &crate::output::PutSnapshotBlockOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_put_snapshot_block_output::ser_put_snapshot_block_output_output(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_put_snapshot_block_output_output(
   16     22   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    #[allow(unused_variables)] input: &crate::output::PutSnapshotBlockOutput,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:372 */
   19     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   20     28   
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -1,1 +101,148 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* PythonServerModuleGenerator.kt:41 */
    2      3   
#[::pyo3::pymodule]
    3         -
#[::pyo3(name = "ebs")]
           4  +
#[pyo3(name = "ebs")]
    4      5   
pub fn python_library(py: ::pyo3::Python<'_>, m: &::pyo3::types::PyModule) -> ::pyo3::PyResult<()> {
           6  +
    /* PythonServerModuleGenerator.kt:65 */
    5      7   
    let input = ::pyo3::types::PyModule::new(py, "input")?;
    6      8   
    let output = ::pyo3::types::PyModule::new(py, "output")?;
    7      9   
    let error = ::pyo3::types::PyModule::new(py, "error")?;
          10  +
    /* PythonServerModuleGenerator.kt:96 */
    8     11   
    error.add_class::<crate::error::InternalServerError>()?;
          12  +
    /* PythonServerModuleGenerator.kt:96 */
    9     13   
    error.add_class::<crate::error::ValidationException>()?;
          14  +
    /* PythonServerModuleGenerator.kt:79 */
   10     15   
    let model = ::pyo3::types::PyModule::new(py, "model")?;
          16  +
    /* PythonServerModuleGenerator.kt:96 */
   11     17   
    model.add_class::<crate::model::ValidationExceptionField>()?;
          18  +
    /* PythonServerModuleGenerator.kt:96 */
   12     19   
    error.add_class::<crate::error::ConcurrentLimitExceededException>()?;
          20  +
    /* PythonServerModuleGenerator.kt:96 */
   13     21   
    error.add_class::<crate::error::ServiceQuotaExceededException>()?;
          22  +
    /* PythonServerModuleGenerator.kt:96 */
   14     23   
    model.add_class::<crate::model::ServiceQuotaExceededExceptionReason>()?;
          24  +
    /* PythonServerModuleGenerator.kt:96 */
   15     25   
    error.add_class::<crate::error::RequestThrottledException>()?;
          26  +
    /* PythonServerModuleGenerator.kt:96 */
   16     27   
    model.add_class::<crate::model::RequestThrottledExceptionReason>()?;
          28  +
    /* PythonServerModuleGenerator.kt:96 */
   17     29   
    error.add_class::<crate::error::ConflictException>()?;
          30  +
    /* PythonServerModuleGenerator.kt:96 */
   18     31   
    error.add_class::<crate::error::AccessDeniedException>()?;
          32  +
    /* PythonServerModuleGenerator.kt:96 */
   19     33   
    model.add_class::<crate::model::AccessDeniedExceptionReason>()?;
          34  +
    /* PythonServerModuleGenerator.kt:96 */
   20     35   
    error.add_class::<crate::error::ResourceNotFoundException>()?;
          36  +
    /* PythonServerModuleGenerator.kt:96 */
   21     37   
    model.add_class::<crate::model::ResourceNotFoundExceptionReason>()?;
          38  +
    /* PythonServerModuleGenerator.kt:96 */
   22     39   
    error.add_class::<crate::error::InternalServerException>()?;
          40  +
    /* PythonServerModuleGenerator.kt:96 */
   23     41   
    output.add_class::<crate::output::StartSnapshotOutput>()?;
          42  +
    /* PythonServerModuleGenerator.kt:96 */
   24     43   
    model.add_class::<crate::model::Status>()?;
          44  +
    /* PythonServerModuleGenerator.kt:96 */
   25     45   
    model.add_class::<crate::model::Tag>()?;
          46  +
    /* PythonServerModuleGenerator.kt:96 */
   26     47   
    input.add_class::<crate::input::StartSnapshotInput>()?;
          48  +
    /* PythonServerModuleGenerator.kt:96 */
   27     49   
    output.add_class::<crate::output::PutSnapshotBlockOutput>()?;
          50  +
    /* PythonServerModuleGenerator.kt:96 */
   28     51   
    model.add_class::<crate::model::ChecksumAlgorithm>()?;
          52  +
    /* PythonServerModuleGenerator.kt:96 */
   29     53   
    input.add_class::<crate::input::PutSnapshotBlockInput>()?;
          54  +
    /* PythonServerModuleGenerator.kt:96 */
   30     55   
    output.add_class::<crate::output::ListSnapshotBlocksOutput>()?;
          56  +
    /* PythonServerModuleGenerator.kt:96 */
   31     57   
    model.add_class::<crate::model::Block>()?;
          58  +
    /* PythonServerModuleGenerator.kt:96 */
   32     59   
    input.add_class::<crate::input::ListSnapshotBlocksInput>()?;
          60  +
    /* PythonServerModuleGenerator.kt:96 */
   33     61   
    output.add_class::<crate::output::ListChangedBlocksOutput>()?;
          62  +
    /* PythonServerModuleGenerator.kt:96 */
   34     63   
    model.add_class::<crate::model::ChangedBlock>()?;
          64  +
    /* PythonServerModuleGenerator.kt:96 */
   35     65   
    input.add_class::<crate::input::ListChangedBlocksInput>()?;
          66  +
    /* PythonServerModuleGenerator.kt:96 */
   36     67   
    output.add_class::<crate::output::GetSnapshotBlockOutput>()?;
          68  +
    /* PythonServerModuleGenerator.kt:96 */
   37     69   
    input.add_class::<crate::input::GetSnapshotBlockInput>()?;
          70  +
    /* PythonServerModuleGenerator.kt:96 */
   38     71   
    output.add_class::<crate::output::CompleteSnapshotOutput>()?;
          72  +
    /* PythonServerModuleGenerator.kt:96 */
   39     73   
    input.add_class::<crate::input::CompleteSnapshotInput>()?;
          74  +
    /* PythonServerModuleGenerator.kt:96 */
   40     75   
    model.add_class::<crate::model::ChecksumAggregationMethod>()?;
          76  +
    /* PythonServerModuleGenerator.kt:105 */
   41     77   
    ::pyo3::py_run!(py, input, "import sys; sys.modules['ebs.input'] = input");
   42     78   
    m.add_submodule(input)?;
   43     79   
    ::pyo3::py_run!(py, output, "import sys; sys.modules['ebs.output'] = output");
   44     80   
    m.add_submodule(output)?;
   45     81   
    ::pyo3::py_run!(py, error, "import sys; sys.modules['ebs.error'] = error");
   46     82   
    m.add_submodule(error)?;
          83  +
    /* PythonServerModuleGenerator.kt:117 */
   47     84   
    ::pyo3::py_run!(py, model, "import sys; sys.modules['ebs.model'] = model");
   48     85   
    m.add_submodule(model)?;
          86  +
    /* PythonServerModuleGenerator.kt:129 */
   49     87   
    let types = ::pyo3::types::PyModule::new(py, "types")?;
   50     88   
    types.add_class::<::aws_smithy_http_server_python::types::Blob>()?;
   51     89   
    types.add_class::<::aws_smithy_http_server_python::types::DateTime>()?;
   52     90   
    types.add_class::<::aws_smithy_http_server_python::types::Format>()?;
   53     91   
    types.add_class::<::aws_smithy_http_server_python::types::ByteStream>()?;
   54     92   
    ::pyo3::py_run!(py, types, "import sys; sys.modules['ebs.types'] = types");
   55     93   
    m.add_submodule(types)?;
          94  +
    /* PythonServerModuleGenerator.kt:149 */
   56     95   
    let socket = ::pyo3::types::PyModule::new(py, "socket")?;
   57     96   
    socket.add_class::<::aws_smithy_http_server_python::PySocket>()?;
   58     97   
    ::pyo3::py_run!(py, socket, "import sys; sys.modules['ebs.socket'] = socket");
   59     98   
    m.add_submodule(socket)?;
          99  +
    /* PythonServerModuleGenerator.kt:166 */
   60    100   
    let logging = ::pyo3::types::PyModule::new(py, "logging")?;
   61    101   
    logging.add_function(::pyo3::wrap_pyfunction!(
   62    102   
        ::aws_smithy_http_server_python::py_tracing_event,
   63    103   
        m
   64    104   
    )?)?;
   65    105   
    logging.add_class::<::aws_smithy_http_server_python::PyTracingHandler>()?;
   66    106   
    ::pyo3::py_run!(
   67    107   
        py,
   68    108   
        logging,
   69    109   
        "import sys; sys.modules['ebs.logging'] = logging"
   70    110   
    );
   71    111   
    m.add_submodule(logging)?;
         112  +
    /* PythonServerModuleGenerator.kt:183 */
   72    113   
    let middleware = ::pyo3::types::PyModule::new(py, "middleware")?;
   73    114   
    middleware.add_class::<::aws_smithy_http_server_python::PyRequest>()?;
   74    115   
    middleware.add_class::<::aws_smithy_http_server_python::PyResponse>()?;
   75    116   
    middleware.add_class::<::aws_smithy_http_server_python::PyMiddlewareException>()?;
   76    117   
    pyo3::py_run!(
   77    118   
        py,
   78    119   
        middleware,
   79    120   
        "import sys; sys.modules['ebs.middleware'] = middleware"
   80    121   
    );
   81    122   
    m.add_submodule(middleware)?;
         123  +
    /* PythonServerModuleGenerator.kt:201 */
   82    124   
    let tls = ::pyo3::types::PyModule::new(py, "tls")?;
   83    125   
    tls.add_class::<::aws_smithy_http_server_python::tls::PyTlsConfig>()?;
   84    126   
    pyo3::py_run!(py, tls, "import sys; sys.modules['ebs.tls'] = tls");
   85    127   
    m.add_submodule(tls)?;
         128  +
    /* PythonServerModuleGenerator.kt:217 */
   86    129   
    let aws_lambda = ::pyo3::types::PyModule::new(py, "aws_lambda")?;
   87    130   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyLambdaContext>()?;
   88    131   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyClientApplication>()?;
   89    132   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyClientContext>()?;
   90    133   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyCognitoIdentity>()?;
   91    134   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyConfig>()?;
   92    135   
    pyo3::py_run!(
   93    136   
        py,
   94    137   
        aws_lambda,
   95    138   
        "import sys; sys.modules['ebs.aws_lambda'] = aws_lambda"
   96    139   
    );
   97    140   
    m.add_submodule(aws_lambda)?;
         141  +
    /* PythonServerModuleGenerator.kt:238 */
   98    142   
    m.add_class::<crate::python_server_application::App>()?;
         143  +
    /* PythonServerModuleGenerator.kt:243 */
   99    144   
    m.add("CODEGEN_VERSION", "ci")?;
         145  +
    /* PythonServerModuleGenerator.kt:58 */
  100    146   
    Ok(())
         147  +
    /* PythonServerModuleGenerator.kt:41 */
  101    148   
}

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

@@ -1,1 +284,290 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* PythonServerOperationHandlerGenerator.kt:61 */
    2      3   
/// Python handler for operation `StartSnapshot`.
    3      4   
pub(crate) async fn start_snapshot(
    4      5   
    input: crate::input::StartSnapshotInput,
    5      6   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
    6      7   
    handler: ::aws_smithy_http_server_python::PyHandler,
    7      8   
) -> std::result::Result<crate::output::StartSnapshotOutput, crate::error::StartSnapshotError> {
    8      9   
    // Async block used to run the handler and catch any Python error.
    9     10   
    let result = if handler.is_coroutine {
   10     11   
        ::tracing::trace!(
   11     12   
            name = "start_snapshot",
   12     13   
            "executing python handler coroutine"
   13     14   
        );
   14     15   
        let result = ::pyo3::Python::with_gil(|py| {
   15     16   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   16     17   
            let coroutine = if handler.args == 1 {
   17     18   
                pyhandler.call1((input,))?
   18     19   
            } else {
   19     20   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   20     21   
            };
   21     22   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   22     23   
        })?;
   23     24   
        result.await.and_then(|r| {
   24     25   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::StartSnapshotOutput>(py))
   25     26   
        })
   26     27   
    } else {
   27     28   
        ::tracing::trace!(name = "start_snapshot", "executing python handler function");
   28     29   
        ::pyo3::Python::with_gil(|py| {
   29     30   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   30     31   
            let output = if handler.args == 1 {
   31     32   
                pyhandler.call1((input,))?
   32     33   
            } else {
   33     34   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   34     35   
            };
   35     36   
            output.extract::<crate::output::StartSnapshotOutput>()
   36     37   
        })
   37     38   
    };
   38     39   
    // Catch and record a Python traceback.
   39     40   
    result.map_err(|e| {
   40     41   
        let rich_py_err =
   41     42   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   42     43   
                e.clone_ref(py)
   43     44   
            }));
   44     45   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   45     46   
        e.into()
   46     47   
    })
   47     48   
}
   48     49   
          50  +
/* PythonServerOperationHandlerGenerator.kt:61 */
   49     51   
/// Python handler for operation `PutSnapshotBlock`.
   50     52   
pub(crate) async fn put_snapshot_block(
   51     53   
    input: crate::input::PutSnapshotBlockInput,
   52     54   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
   53     55   
    handler: ::aws_smithy_http_server_python::PyHandler,
   54     56   
) -> std::result::Result<crate::output::PutSnapshotBlockOutput, crate::error::PutSnapshotBlockError>
   55     57   
{
   56     58   
    // Async block used to run the handler and catch any Python error.
   57     59   
    let result = if handler.is_coroutine {
   58     60   
        ::tracing::trace!(
   59     61   
            name = "put_snapshot_block",
   60     62   
            "executing python handler coroutine"
   61     63   
        );
   62     64   
        let result = ::pyo3::Python::with_gil(|py| {
   63     65   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   64     66   
            let coroutine = if handler.args == 1 {
   65     67   
                pyhandler.call1((input,))?
   66     68   
            } else {
   67     69   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   68     70   
            };
   69     71   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   70     72   
        })?;
   71     73   
        result.await.and_then(|r| {
   72     74   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::PutSnapshotBlockOutput>(py))
   73     75   
        })
   74     76   
    } else {
   75     77   
        ::tracing::trace!(
   76     78   
            name = "put_snapshot_block",
   77     79   
            "executing python handler function"
   78     80   
        );
   79     81   
        ::pyo3::Python::with_gil(|py| {
   80     82   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   81     83   
            let output = if handler.args == 1 {
   82     84   
                pyhandler.call1((input,))?
   83     85   
            } else {
   84     86   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   85     87   
            };
   86     88   
            output.extract::<crate::output::PutSnapshotBlockOutput>()
   87     89   
        })
   88     90   
    };
   89     91   
    // Catch and record a Python traceback.
   90     92   
    result.map_err(|e| {
   91     93   
        let rich_py_err =
   92     94   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   93     95   
                e.clone_ref(py)
   94     96   
            }));
   95     97   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   96     98   
        e.into()
   97     99   
    })
   98    100   
}
   99    101   
         102  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  100    103   
/// Python handler for operation `ListSnapshotBlocks`.
  101    104   
pub(crate) async fn list_snapshot_blocks(
  102    105   
    input: crate::input::ListSnapshotBlocksInput,
  103    106   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  104    107   
    handler: ::aws_smithy_http_server_python::PyHandler,
  105    108   
) -> std::result::Result<
  106    109   
    crate::output::ListSnapshotBlocksOutput,
  107    110   
    crate::error::ListSnapshotBlocksError,
  108    111   
> {
  109    112   
    // Async block used to run the handler and catch any Python error.
  110    113   
    let result = if handler.is_coroutine {
  111    114   
        ::tracing::trace!(
  112    115   
            name = "list_snapshot_blocks",
  113    116   
            "executing python handler coroutine"
  114    117   
        );
  115    118   
        let result = ::pyo3::Python::with_gil(|py| {
  116    119   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  117    120   
            let coroutine = if handler.args == 1 {
  118    121   
                pyhandler.call1((input,))?
  119    122   
            } else {
  120    123   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  121    124   
            };
  122    125   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  123    126   
        })?;
  124    127   
        result.await.and_then(|r| {
  125    128   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ListSnapshotBlocksOutput>(py))
  126    129   
        })
  127    130   
    } else {
  128    131   
        ::tracing::trace!(
  129    132   
            name = "list_snapshot_blocks",
  130    133   
            "executing python handler function"
  131    134   
        );
  132    135   
        ::pyo3::Python::with_gil(|py| {
  133    136   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  134    137   
            let output = if handler.args == 1 {
  135    138   
                pyhandler.call1((input,))?
  136    139   
            } else {
  137    140   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  138    141   
            };
  139    142   
            output.extract::<crate::output::ListSnapshotBlocksOutput>()
  140    143   
        })
  141    144   
    };
  142    145   
    // Catch and record a Python traceback.
  143    146   
    result.map_err(|e| {
  144    147   
        let rich_py_err =
  145    148   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  146    149   
                e.clone_ref(py)
  147    150   
            }));
  148    151   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  149    152   
        e.into()
  150    153   
    })
  151    154   
}
  152    155   
         156  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  153    157   
/// Python handler for operation `ListChangedBlocks`.
  154    158   
pub(crate) async fn list_changed_blocks(
  155    159   
    input: crate::input::ListChangedBlocksInput,
  156    160   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  157    161   
    handler: ::aws_smithy_http_server_python::PyHandler,
  158    162   
) -> std::result::Result<crate::output::ListChangedBlocksOutput, crate::error::ListChangedBlocksError>
  159    163   
{
  160    164   
    // Async block used to run the handler and catch any Python error.
  161    165   
    let result = if handler.is_coroutine {
  162    166   
        ::tracing::trace!(
  163    167   
            name = "list_changed_blocks",
  164    168   
            "executing python handler coroutine"
  165    169   
        );
  166    170   
        let result = ::pyo3::Python::with_gil(|py| {
  167    171   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  168    172   
            let coroutine = if handler.args == 1 {
  169    173   
                pyhandler.call1((input,))?
  170    174   
            } else {
  171    175   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  172    176   
            };
  173    177   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  174    178   
        })?;
  175    179   
        result.await.and_then(|r| {
  176    180   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ListChangedBlocksOutput>(py))
  177    181   
        })
  178    182   
    } else {
  179    183   
        ::tracing::trace!(
  180    184   
            name = "list_changed_blocks",
  181    185   
            "executing python handler function"
  182    186   
        );
  183    187   
        ::pyo3::Python::with_gil(|py| {
  184    188   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  185    189   
            let output = if handler.args == 1 {
  186    190   
                pyhandler.call1((input,))?
  187    191   
            } else {
  188    192   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  189    193   
            };
  190    194   
            output.extract::<crate::output::ListChangedBlocksOutput>()
  191    195   
        })
  192    196   
    };
  193    197   
    // Catch and record a Python traceback.
  194    198   
    result.map_err(|e| {
  195    199   
        let rich_py_err =
  196    200   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  197    201   
                e.clone_ref(py)
  198    202   
            }));
  199    203   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  200    204   
        e.into()
  201    205   
    })
  202    206   
}
  203    207   
         208  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  204    209   
/// Python handler for operation `GetSnapshotBlock`.
  205    210   
pub(crate) async fn get_snapshot_block(
  206    211   
    input: crate::input::GetSnapshotBlockInput,
  207    212   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  208    213   
    handler: ::aws_smithy_http_server_python::PyHandler,
  209    214   
) -> std::result::Result<crate::output::GetSnapshotBlockOutput, crate::error::GetSnapshotBlockError>
  210    215   
{
  211    216   
    // Async block used to run the handler and catch any Python error.
  212    217   
    let result = if handler.is_coroutine {
  213    218   
        ::tracing::trace!(
  214    219   
            name = "get_snapshot_block",
  215    220   
            "executing python handler coroutine"
  216    221   
        );
  217    222   
        let result = ::pyo3::Python::with_gil(|py| {
  218    223   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  219    224   
            let coroutine = if handler.args == 1 {
  220    225   
                pyhandler.call1((input,))?
  221    226   
            } else {
  222    227   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  223    228   
            };
  224    229   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  225    230   
        })?;
  226    231   
        result.await.and_then(|r| {
  227    232   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GetSnapshotBlockOutput>(py))
  228    233   
        })
  229    234   
    } else {
  230    235   
        ::tracing::trace!(
  231    236   
            name = "get_snapshot_block",
  232    237   
            "executing python handler function"
  233    238   
        );
  234    239   
        ::pyo3::Python::with_gil(|py| {
  235    240   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  236    241   
            let output = if handler.args == 1 {
  237    242   
                pyhandler.call1((input,))?
  238    243   
            } else {
  239    244   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  240    245   
            };
  241    246   
            output.extract::<crate::output::GetSnapshotBlockOutput>()
  242    247   
        })
  243    248   
    };
  244    249   
    // Catch and record a Python traceback.
  245    250   
    result.map_err(|e| {
  246    251   
        let rich_py_err =
  247    252   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  248    253   
                e.clone_ref(py)
  249    254   
            }));
  250    255   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  251    256   
        e.into()
  252    257   
    })
  253    258   
}
  254    259   
         260  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  255    261   
/// Python handler for operation `CompleteSnapshot`.
  256    262   
pub(crate) async fn complete_snapshot(
  257    263   
    input: crate::input::CompleteSnapshotInput,
  258    264   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  259    265   
    handler: ::aws_smithy_http_server_python::PyHandler,
  260    266   
) -> std::result::Result<crate::output::CompleteSnapshotOutput, crate::error::CompleteSnapshotError>
  261    267   
{
  262    268   
    // Async block used to run the handler and catch any Python error.
  263    269   
    let result = if handler.is_coroutine {
  264    270   
        ::tracing::trace!(

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

@@ -1,1 +254,278 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* PythonApplicationGenerator.kt:386 */
    2      3   
#[allow(clippy::tabs_in_doc_comments)]
    3      4   
/// Main Python application, used to register operations and context and start multiple
    4      5   
/// workers on the same shared socket.
    5      6   
///
    6      7   
/// Operations can be registered using the application object as a decorator (`@app.operation_name`).
    7      8   
///
    8      9   
/// Here's a full example to get you started:
    9     10   
///
   10     11   
/// ```python
          12  +
/* PythonApplicationGenerator.kt:399 */
   11     13   
/// from ebs import input
   12     14   
/// from ebs import output
          15  +
/* PythonApplicationGenerator.kt:406 */
   13     16   
/// from ebs import error
          17  +
/* PythonApplicationGenerator.kt:408 */
   14     18   
/// from ebs import middleware
   15     19   
/// from ebs import App
   16     20   
///
   17     21   
/// @dataclass
   18     22   
/// class Context:
   19     23   
///     counter: int = 0
   20     24   
///
   21     25   
/// app = App()
   22     26   
/// app.context(Context())
   23     27   
///
   24     28   
/// @app.request_middleware
   25     29   
/// def request_middleware(request: middleware::Request):
   26     30   
///     if request.get_header("x-amzn-id") != "secret":
   27     31   
///         raise middleware.MiddlewareException("Unsupported `x-amz-id` header", 401)
   28     32   
///
          33  +
/* PythonApplicationGenerator.kt:441 */
   29     34   
/// # <p>Seals and completes the snapshot after all of the required blocks of data have been
   30     35   
/// #             written to it. Completing the snapshot changes the status to <code>completed</code>. You
   31     36   
/// #             cannot write new blocks to a snapshot after it has been completed.</p>
   32     37   
/// @app.complete_snapshot
   33     38   
/// def complete_snapshot(input: input::CompleteSnapshotInput, ctx: Context) -> output::CompleteSnapshotOutput:
   34     39   
///     raise NotImplementedError
   35     40   
///
   36     41   
/// # <p>Returns the data in a block in an Amazon Elastic Block Store snapshot.</p>
   37     42   
/// @app.get_snapshot_block
   38     43   
/// def get_snapshot_block(input: input::GetSnapshotBlockInput, ctx: Context) -> output::GetSnapshotBlockOutput:
   39     44   
///     raise NotImplementedError
   40     45   
///
   41     46   
/// # <p>Returns information about the blocks that are different between two
   42     47   
/// #             Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.</p>
   43     48   
/// @app.list_changed_blocks
   44     49   
/// def list_changed_blocks(input: input::ListChangedBlocksInput, ctx: Context) -> output::ListChangedBlocksOutput:
   45     50   
///     raise NotImplementedError
   46     51   
///
   47     52   
/// # <p>Returns information about the blocks in an Amazon Elastic Block Store snapshot.</p>
   48     53   
/// @app.list_snapshot_blocks
   49     54   
/// def list_snapshot_blocks(input: input::ListSnapshotBlocksInput, ctx: Context) -> output::ListSnapshotBlocksOutput:
   50     55   
///     raise NotImplementedError
   51     56   
///
   52     57   
/// # <p>Writes a block of data to a snapshot. If the specified block contains
   53     58   
/// #             data, the existing data is overwritten. The target snapshot must be in the
   54     59   
/// #                 <code>pending</code> state.</p>
   55     60   
/// #     	    <p>Data written to a snapshot must be aligned with 512-byte sectors.</p>
   56     61   
/// @app.put_snapshot_block
   57     62   
/// def put_snapshot_block(input: input::PutSnapshotBlockInput, ctx: Context) -> output::PutSnapshotBlockOutput:
   58     63   
///     raise NotImplementedError
   59     64   
///
   60     65   
/// # <p>Creates a new Amazon EBS snapshot. The new snapshot enters the <code>pending</code> state
   61     66   
/// #             after the request completes. </p>
   62     67   
/// #         <p>After creating the snapshot, use <a href="https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html"> PutSnapshotBlock</a> to
   63     68   
/// #             write blocks of data to the snapshot.</p>
   64     69   
/// @app.start_snapshot
   65     70   
/// def start_snapshot(input: input::StartSnapshotInput, ctx: Context) -> output::StartSnapshotOutput:
   66     71   
///     raise NotImplementedError
          72  +
/* PythonApplicationGenerator.kt:428 */
   67     73   
///
   68     74   
/// app.run()
   69     75   
/// ```
   70     76   
///
   71     77   
/// Any of operations above can be written as well prepending the `async` keyword and
   72     78   
/// the Python application will automatically handle it and schedule it on the event loop for you.
          79  +
/* PythonApplicationGenerator.kt:112 */
   73     80   
#[::pyo3::pyclass]
   74     81   
#[derive(Debug)]
   75     82   
/// :generic Ctx:
   76     83   
/// :extends typing.Generic\[Ctx\]:
   77     84   
/// :rtype None:
   78     85   
pub struct App {
   79     86   
    handlers: ::std::collections::HashMap<String, ::aws_smithy_http_server_python::PyHandler>,
   80     87   
    middlewares: Vec<::aws_smithy_http_server_python::PyMiddlewareHandler>,
   81     88   
    context: Option<::pyo3::PyObject>,
   82     89   
    workers: ::parking_lot::Mutex<Vec<::pyo3::PyObject>>,
   83     90   
}
          91  +
/* PythonApplicationGenerator.kt:149 */
   84     92   
impl Default for App {
   85     93   
    fn default() -> Self {
   86     94   
        Self {
   87     95   
            handlers: Default::default(),
   88     96   
            middlewares: vec![],
   89     97   
            context: None,
   90     98   
            workers: ::parking_lot::Mutex::new(vec![]),
   91     99   
        }
   92    100   
    }
   93    101   
}
         102  +
/* PythonApplicationGenerator.kt:131 */
   94    103   
impl Clone for App {
   95    104   
    fn clone(&self) -> Self {
   96    105   
        Self {
   97    106   
            handlers: self.handlers.clone(),
   98    107   
            middlewares: self.middlewares.clone(),
   99    108   
            context: self.context.clone(),
  100    109   
            workers: ::parking_lot::Mutex::new(vec![]),
  101    110   
        }
  102    111   
    }
  103    112   
}
         113  +
/* PythonApplicationGenerator.kt:168 */
  104    114   
impl ::aws_smithy_http_server_python::PyApp for App {
         115  +
    /* PythonApplicationGenerator.kt:174 */
  105    116   
    fn workers(&self) -> &::parking_lot::Mutex<Vec<::pyo3::PyObject>> {
  106    117   
        &self.workers
  107    118   
    }
  108    119   
    fn context(&self) -> &Option<::pyo3::PyObject> {
  109    120   
        &self.context
  110    121   
    }
  111    122   
    fn handlers(
  112    123   
        &mut self,
  113    124   
    ) -> &mut ::std::collections::HashMap<String, ::aws_smithy_http_server_python::PyHandler> {
  114    125   
        &mut self.handlers
  115    126   
    }
         127  +
    /* PythonApplicationGenerator.kt:189 */
  116    128   
    fn build_service(
  117    129   
        &mut self,
  118    130   
        event_loop: &::pyo3::PyAny,
  119    131   
    ) -> ::pyo3::PyResult<
  120    132   
        ::tower::util::BoxCloneService<
  121    133   
            ::http::Request<::aws_smithy_http_server::body::Body>,
  122    134   
            ::http::Response<::aws_smithy_http_server::body::BoxBody>,
  123    135   
            std::convert::Infallible,
  124    136   
        >,
  125    137   
    > {
         138  +
        /* PythonApplicationGenerator.kt:201 */
  126    139   
        let builder = crate::service::Ebs::builder_without_plugins();
         140  +
        /* PythonApplicationGenerator.kt:209 */
  127    141   
        let complete_snapshot_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  128    142   
        let handler = self
  129    143   
            .handlers
  130    144   
            .get("complete_snapshot")
  131    145   
            .expect("Python handler for operation `complete_snapshot` not found")
  132    146   
            .clone();
  133    147   
        let builder = builder.complete_snapshot(move |input, state| {
  134    148   
            ::pyo3_asyncio::tokio::scope(
  135    149   
                complete_snapshot_locals.clone(),
  136    150   
                crate::python_operation_adaptor::complete_snapshot(input, state, handler.clone()),
  137    151   
            )
  138    152   
        });
         153  +
        /* PythonApplicationGenerator.kt:209 */
  139    154   
        let get_snapshot_block_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  140    155   
        let handler = self
  141    156   
            .handlers
  142    157   
            .get("get_snapshot_block")
  143    158   
            .expect("Python handler for operation `get_snapshot_block` not found")
  144    159   
            .clone();
  145    160   
        let builder = builder.get_snapshot_block(move |input, state| {
  146    161   
            ::pyo3_asyncio::tokio::scope(
  147    162   
                get_snapshot_block_locals.clone(),
  148    163   
                crate::python_operation_adaptor::get_snapshot_block(input, state, handler.clone()),
  149    164   
            )
  150    165   
        });
         166  +
        /* PythonApplicationGenerator.kt:209 */
  151    167   
        let list_changed_blocks_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  152    168   
        let handler = self
  153    169   
            .handlers
  154    170   
            .get("list_changed_blocks")
  155    171   
            .expect("Python handler for operation `list_changed_blocks` not found")
  156    172   
            .clone();
  157    173   
        let builder = builder.list_changed_blocks(move |input, state| {
  158    174   
            ::pyo3_asyncio::tokio::scope(
  159    175   
                list_changed_blocks_locals.clone(),
  160    176   
                crate::python_operation_adaptor::list_changed_blocks(input, state, handler.clone()),
  161    177   
            )
  162    178   
        });
         179  +
        /* PythonApplicationGenerator.kt:209 */
  163    180   
        let list_snapshot_blocks_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  164    181   
        let handler = self
  165    182   
            .handlers
  166    183   
            .get("list_snapshot_blocks")
  167    184   
            .expect("Python handler for operation `list_snapshot_blocks` not found")
  168    185   
            .clone();
  169    186   
        let builder = builder.list_snapshot_blocks(move |input, state| {
  170    187   
            ::pyo3_asyncio::tokio::scope(
  171    188   
                list_snapshot_blocks_locals.clone(),
  172    189   
                crate::python_operation_adaptor::list_snapshot_blocks(
  173    190   
                    input,
  174    191   
                    state,
  175    192   
                    handler.clone(),
  176    193   
                ),
  177    194   
            )
  178    195   
        });
         196  +
        /* PythonApplicationGenerator.kt:209 */
  179    197   
        let put_snapshot_block_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  180    198   
        let handler = self
  181    199   
            .handlers
  182    200   
            .get("put_snapshot_block")
  183    201   
            .expect("Python handler for operation `put_snapshot_block` not found")
  184    202   
            .clone();
  185    203   
        let builder = builder.put_snapshot_block(move |input, state| {
  186    204   
            ::pyo3_asyncio::tokio::scope(
  187    205   
                put_snapshot_block_locals.clone(),
  188    206   
                crate::python_operation_adaptor::put_snapshot_block(input, state, handler.clone()),
  189    207   
            )
  190    208   
        });
         209  +
        /* PythonApplicationGenerator.kt:209 */
  191    210   
        let start_snapshot_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  192    211   
        let handler = self
  193    212   
            .handlers
  194    213   
            .get("start_snapshot")
  195    214   
            .expect("Python handler for operation `start_snapshot` not found")
  196    215   
            .clone();
  197    216   
        let builder = builder.start_snapshot(move |input, state| {
  198    217   
            ::pyo3_asyncio::tokio::scope(
  199    218   
                start_snapshot_locals.clone(),
  200    219   
                crate::python_operation_adaptor::start_snapshot(input, state, handler.clone()),
  201    220   
            )
  202    221   
        });
         222  +
        /* PythonApplicationGenerator.kt:220 */
  203    223   
        let mut service = ::tower::util::BoxCloneService::new(builder.build().expect("one or more operations do not have a registered handler; this is a bug in the Python code generator, please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"));
  204    224   
  205    225   
        {
  206    226   
            use ::tower::Layer;
  207    227   
            ::tracing::trace!("adding middlewares to rust python router");
  208    228   
            let mut middlewares = self.middlewares.clone();
  209    229   
            // Reverse the middlewares, so they run with same order as they defined
  210    230   
            middlewares.reverse();
  211    231   
            for handler in middlewares {
  212    232   
                ::tracing::trace!(name = &handler.name, "adding python middleware");
  213    233   
                let locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  214    234   
                let layer = ::aws_smithy_http_server_python::PyMiddlewareLayer::<
  215    235   
                    ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  216    236   
                >::new(handler, locals);
  217    237   
                service = ::tower::util::BoxCloneService::new(layer.layer(service));
  218    238   
            }
  219    239   
        }
  220    240   
        Ok(service)
         241  +
        /* PythonApplicationGenerator.kt:189 */
  221    242   
    }
         243  +
    /* PythonApplicationGenerator.kt:168 */
  222    244   
}
         245  +
/* PythonApplicationGenerator.kt:247 */
  223    246   
#[::pyo3::pymethods]
  224    247   
impl App {
         248  +
    /* PythonApplicationGenerator.kt:260 */
  225    249   
    /// Create a new [App].
  226    250   
    #[new]
  227    251   
    pub fn new() -> Self {
  228    252   
        Self::default()
  229    253   
    }
  230    254   
  231    255   
    /// Register a context object that will be shared between handlers.
  232    256   
    ///
  233    257   
    /// :param context Ctx:
  234    258   
    /// :rtype None:
@@ -277,301 +391,422 @@
  297    321   
        py: pyo3::Python,
  298    322   
        socket: &pyo3::PyCell<::aws_smithy_http_server_python::PySocket>,
  299    323   
        worker_number: isize,
  300    324   
        tls: Option<::aws_smithy_http_server_python::tls::PyTlsConfig>,
  301    325   
    ) -> pyo3::PyResult<()> {
  302    326   
        use ::aws_smithy_http_server_python::PyApp;
  303    327   
        let event_loop = self.configure_python_event_loop(py)?;
  304    328   
        let service = self.build_and_configure_service(py, event_loop)?;
  305    329   
        self.start_hyper_worker(py, socket, event_loop, service, worker_number, tls)
  306    330   
    }
         331  +
    /* PythonApplicationGenerator.kt:366 */
  307    332   
    /// Method to register `complete_snapshot` Python implementation inside the handlers map.
  308    333   
    /// It can be used as a function decorator in Python.
  309    334   
    ///
  310    335   
    /// :param func typing.Union\[typing.Callable\[\[ebs.input.CompleteSnapshotInput, Ctx\], typing.Union\[ebs.output.CompleteSnapshotOutput, typing.Awaitable\[ebs.output.CompleteSnapshotOutput\]\]\], typing.Callable\[\[ebs.input.CompleteSnapshotInput\], typing.Union\[ebs.output.CompleteSnapshotOutput, typing.Awaitable\[ebs.output.CompleteSnapshotOutput\]\]\]\]:
  311    336   
    /// :rtype None:
  312    337   
    #[pyo3(text_signature = "($self, func)")]
  313    338   
    pub fn complete_snapshot(
  314    339   
        &mut self,
  315    340   
        py: ::pyo3::Python,
  316    341   
        func: ::pyo3::PyObject,
  317    342   
    ) -> ::pyo3::PyResult<()> {
  318    343   
        use ::aws_smithy_http_server_python::PyApp;
  319    344   
        self.register_operation(py, "complete_snapshot", func)
  320    345   
    }
         346  +
    /* PythonApplicationGenerator.kt:366 */
  321    347   
    /// Method to register `get_snapshot_block` Python implementation inside the handlers map.
  322    348   
    /// It can be used as a function decorator in Python.
  323    349   
    ///
  324    350   
    /// :param func typing.Union\[typing.Callable\[\[ebs.input.GetSnapshotBlockInput, Ctx\], typing.Union\[ebs.output.GetSnapshotBlockOutput, typing.Awaitable\[ebs.output.GetSnapshotBlockOutput\]\]\], typing.Callable\[\[ebs.input.GetSnapshotBlockInput\], typing.Union\[ebs.output.GetSnapshotBlockOutput, typing.Awaitable\[ebs.output.GetSnapshotBlockOutput\]\]\]\]:
  325    351   
    /// :rtype None:
  326    352   
    #[pyo3(text_signature = "($self, func)")]
  327    353   
    pub fn get_snapshot_block(
  328    354   
        &mut self,
  329    355   
        py: ::pyo3::Python,
  330    356   
        func: ::pyo3::PyObject,
  331    357   
    ) -> ::pyo3::PyResult<()> {
  332    358   
        use ::aws_smithy_http_server_python::PyApp;
  333    359   
        self.register_operation(py, "get_snapshot_block", func)
  334    360   
    }
         361  +
    /* PythonApplicationGenerator.kt:366 */
  335    362   
    /// Method to register `list_changed_blocks` Python implementation inside the handlers map.
  336    363   
    /// It can be used as a function decorator in Python.
  337    364   
    ///
  338    365   
    /// :param func typing.Union\[typing.Callable\[\[ebs.input.ListChangedBlocksInput, Ctx\], typing.Union\[ebs.output.ListChangedBlocksOutput, typing.Awaitable\[ebs.output.ListChangedBlocksOutput\]\]\], typing.Callable\[\[ebs.input.ListChangedBlocksInput\], typing.Union\[ebs.output.ListChangedBlocksOutput, typing.Awaitable\[ebs.output.ListChangedBlocksOutput\]\]\]\]:
  339    366   
    /// :rtype None:
  340    367   
    #[pyo3(text_signature = "($self, func)")]
  341    368   
    pub fn list_changed_blocks(
  342    369   
        &mut self,
  343    370   
        py: ::pyo3::Python,
  344    371   
        func: ::pyo3::PyObject,
  345    372   
    ) -> ::pyo3::PyResult<()> {
  346    373   
        use ::aws_smithy_http_server_python::PyApp;
  347    374   
        self.register_operation(py, "list_changed_blocks", func)
  348    375   
    }
         376  +
    /* PythonApplicationGenerator.kt:366 */
  349    377   
    /// Method to register `list_snapshot_blocks` Python implementation inside the handlers map.
  350    378   
    /// It can be used as a function decorator in Python.
  351    379   
    ///
  352    380   
    /// :param func typing.Union\[typing.Callable\[\[ebs.input.ListSnapshotBlocksInput, Ctx\], typing.Union\[ebs.output.ListSnapshotBlocksOutput, typing.Awaitable\[ebs.output.ListSnapshotBlocksOutput\]\]\], typing.Callable\[\[ebs.input.ListSnapshotBlocksInput\], typing.Union\[ebs.output.ListSnapshotBlocksOutput, typing.Awaitable\[ebs.output.ListSnapshotBlocksOutput\]\]\]\]:
  353    381   
    /// :rtype None:
  354    382   
    #[pyo3(text_signature = "($self, func)")]
  355    383   
    pub fn list_snapshot_blocks(
  356    384   
        &mut self,
  357    385   
        py: ::pyo3::Python,
  358    386   
        func: ::pyo3::PyObject,
  359    387   
    ) -> ::pyo3::PyResult<()> {
  360    388   
        use ::aws_smithy_http_server_python::PyApp;
  361    389   
        self.register_operation(py, "list_snapshot_blocks", func)
  362    390   
    }
         391  +
    /* PythonApplicationGenerator.kt:366 */
  363    392   
    /// Method to register `put_snapshot_block` Python implementation inside the handlers map.
  364    393   
    /// It can be used as a function decorator in Python.
  365    394   
    ///
  366    395   
    /// :param func typing.Union\[typing.Callable\[\[ebs.input.PutSnapshotBlockInput, Ctx\], typing.Union\[ebs.output.PutSnapshotBlockOutput, typing.Awaitable\[ebs.output.PutSnapshotBlockOutput\]\]\], typing.Callable\[\[ebs.input.PutSnapshotBlockInput\], typing.Union\[ebs.output.PutSnapshotBlockOutput, typing.Awaitable\[ebs.output.PutSnapshotBlockOutput\]\]\]\]:
  367    396   
    /// :rtype None:
  368    397   
    #[pyo3(text_signature = "($self, func)")]
  369    398   
    pub fn put_snapshot_block(
  370    399   
        &mut self,
  371    400   
        py: ::pyo3::Python,
  372    401   
        func: ::pyo3::PyObject,
  373    402   
    ) -> ::pyo3::PyResult<()> {
  374    403   
        use ::aws_smithy_http_server_python::PyApp;
  375    404   
        self.register_operation(py, "put_snapshot_block", func)
  376    405   
    }
         406  +
    /* PythonApplicationGenerator.kt:366 */
  377    407   
    /// Method to register `start_snapshot` Python implementation inside the handlers map.
  378    408   
    /// It can be used as a function decorator in Python.
  379    409   
    ///
  380    410   
    /// :param func typing.Union\[typing.Callable\[\[ebs.input.StartSnapshotInput, Ctx\], typing.Union\[ebs.output.StartSnapshotOutput, typing.Awaitable\[ebs.output.StartSnapshotOutput\]\]\], typing.Callable\[\[ebs.input.StartSnapshotInput\], typing.Union\[ebs.output.StartSnapshotOutput, typing.Awaitable\[ebs.output.StartSnapshotOutput\]\]\]\]:
  381    411   
    /// :rtype None:
  382    412   
    #[pyo3(text_signature = "($self, func)")]
  383    413   
    pub fn start_snapshot(
  384    414   
        &mut self,
  385    415   
        py: ::pyo3::Python,
  386    416   
        func: ::pyo3::PyObject,
  387    417   
    ) -> ::pyo3::PyResult<()> {
  388    418   
        use ::aws_smithy_http_server_python::PyApp;
  389    419   
        self.register_operation(py, "start_snapshot", func)
  390    420   
    }
         421  +
    /* PythonApplicationGenerator.kt:247 */
  391    422   
}

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

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

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

@@ -1,1 +0,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::body::SdkBody;
    3      4   
pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
    4      5   
pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
    5         -
pub use ::aws_smithy_types::byte_stream::ByteStream;
           6  +
/* SmithyTypesPubUseExtra.kt:86 */ pub use ::aws_smithy_types::byte_stream::ByteStream;
    6      7   
#[cfg(feature = "rt-tokio")]
    7      8   
pub use ::aws_smithy_types::byte_stream::FsBuilder;
    8      9   
#[cfg(feature = "rt-tokio")]
    9     10   
pub use ::aws_smithy_types::byte_stream::Length;
   10     11   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
          12  +
/* ServerRequiredCustomizations.kt:69 */
   11     13   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
   12     14   
pub use ::aws_smithy_types::Blob;
   13         -
pub use ::aws_smithy_types::DateTime;
          15  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;

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

@@ -1,1 +42,52 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
pub(crate) mod tags_unconstrained {
    4      4   
           5  +
    /* UnconstrainedCollectionGenerator.kt:77 */
    5      6   
    #[derive(Debug, Clone)]
    6      7   
    pub(crate) struct TagsUnconstrained(
    7      8   
        pub(crate) std::vec::Vec<crate::model::tag_internal::Builder>,
    8      9   
    );
    9     10   
   10     11   
    impl From<TagsUnconstrained>
   11     12   
        for crate::constrained::MaybeConstrained<
   12     13   
            crate::constrained::tags_constrained::TagsConstrained,
   13     14   
        >
   14     15   
    {
   15     16   
        fn from(value: TagsUnconstrained) -> Self {
   16     17   
            Self::Unconstrained(value)
   17     18   
        }
   18     19   
    }
          20  +
    /* UnconstrainedCollectionGenerator.kt:97 */
   19     21   
    impl std::convert::TryFrom<TagsUnconstrained>
   20     22   
        for crate::constrained::tags_constrained::TagsConstrained
   21     23   
    {
          24  +
        /* UnconstrainedCollectionGenerator.kt:98 */
   22     25   
        type Error = crate::model::tags_internal::ConstraintViolation;
          26  +
        /* UnconstrainedCollectionGenerator.kt:100 */
   23     27   
        fn try_from(value: TagsUnconstrained) -> std::result::Result<Self, Self::Error> {
          28  +
            /* UnconstrainedCollectionGenerator.kt:127 */
   24     29   
            let res: ::std::result::Result<
   25     30   
                ::std::vec::Vec<crate::model::Tag>,
   26     31   
                (usize, crate::model::tag_internal::ConstraintViolation),
   27     32   
            > = value
   28     33   
                .0
   29     34   
                .into_iter()
   30     35   
                .enumerate()
   31     36   
                .map(|(idx, inner)| {
   32     37   
                    inner
   33     38   
                        .try_into()
   34     39   
                        .map_err(|inner_violation| (idx, inner_violation))
   35     40   
                })
   36     41   
                .collect();
   37     42   
            let inner =
   38     43   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
          44  +
            /* UnconstrainedCollectionGenerator.kt:191 */
   39     45   
            Ok(Self(inner))
          46  +
            /* UnconstrainedCollectionGenerator.kt:100 */
   40     47   
        }
          48  +
        /* UnconstrainedCollectionGenerator.kt:97 */
   41     49   
    }
          50  +
          51  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   42     52   
}