Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_operation_with_nested_structure.rs

@@ -1,1 +162,231 @@
    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_operation_with_nested_structure_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::OperationWithNestedStructureInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::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::aws_json::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 =
   18     23   
            crate::input::operation_with_nested_structure_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   23     31   
        let bytes = ::hyper::body::to_bytes(body).await?;
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   24     33   
        if !bytes.is_empty() {
          34  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   25     35   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   26     36   
                &headers,
   27     37   
                Some("application/x-amz-json-1.0"),
   28     38   
            )?;
   29     39   
            input = crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure(bytes.as_ref(), input)?;
          40  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   30     41   
        }
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   31     43   
        input.build()?
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   32     45   
    })
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   33     47   
}
   34     48   
          49  +
/* RustType.kt:516 */
   35     50   
#[allow(clippy::unnecessary_wraps)]
          51  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   36     52   
pub fn ser_operation_with_nested_structure_http_response(
   37     53   
    #[allow(unused_variables)] output: crate::output::OperationWithNestedStructureOutput,
   38     54   
) -> std::result::Result<
   39     55   
    ::aws_smithy_http_server::response::Response,
   40     56   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   41     57   
> {
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   42     59   
    Ok({
          60  +
        /* RustType.kt:516 */
   43     61   
        #[allow(unused_mut)]
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   44     63   
        let mut builder = ::http::Response::builder();
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   45     65   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     66   
            builder,
   47     67   
            ::http::header::CONTENT_TYPE,
   48     68   
            "application/x-amz-json-1.0",
   49     69   
        );
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   50     71   
        let http_status: u16 = 200;
   51     72   
        builder = builder.status(http_status);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   52     74   
        let payload =
   53         -
            crate::protocol_serde::shape_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output_output(&output)?
   54         -
        ;
          75  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output_output(&output)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   55     78   
        let content_length = payload.len();
   56     79   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     80   
            builder,
   58     81   
            ::http::header::CONTENT_LENGTH,
   59     82   
            content_length,
   60     83   
        );
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   61     85   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   62     87   
        builder.body(body)?
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     89   
    })
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   64     91   
}
   65     92   
          93  +
/* RustType.kt:516 */
   66     94   
#[allow(clippy::unnecessary_wraps)]
          95  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   67     96   
pub fn ser_operation_with_nested_structure_http_error(
   68     97   
    error: &crate::error::OperationWithNestedStructureError,
   69     98   
) -> std::result::Result<
   70     99   
    ::aws_smithy_http_server::response::Response,
   71    100   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   72    101   
> {
         102  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   73    103   
    Ok({
         104  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   74    105   
        match error {
         106  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   75    107   
            crate::error::OperationWithNestedStructureError::ValidationException(output) => {
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   76    109   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         110  +
                /* RustType.kt:516 */
   77    111   
                #[allow(unused_mut)]
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   78    113   
                let mut builder = ::http::Response::builder();
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   79    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    116   
                    builder,
   81    117   
                    ::http::header::CONTENT_TYPE,
   82    118   
                    "application/x-amz-json-1.0",
   83    119   
                );
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   84    121   
                let content_length = payload.len();
   85    122   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    123   
                    builder,
   87    124   
                    ::http::header::CONTENT_LENGTH,
   88    125   
                    content_length,
   89    126   
                );
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   90    128   
                builder
   91    129   
                    .status(400)
   92    130   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   93    132   
            }
         133  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   94    134   
            crate::error::OperationWithNestedStructureError::InternalServerError(output) => {
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   95    136   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         137  +
                /* RustType.kt:516 */
   96    138   
                #[allow(unused_mut)]
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   97    140   
                let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   98    142   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    143   
                    builder,
  100    144   
                    ::http::header::CONTENT_TYPE,
  101    145   
                    "application/x-amz-json-1.0",
  102    146   
                );
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  103    148   
                let content_length = payload.len();
  104    149   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    150   
                    builder,
  106    151   
                    ::http::header::CONTENT_LENGTH,
  107    152   
                    content_length,
  108    153   
                );
         154  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  109    155   
                builder
  110    156   
                    .status(500)
  111    157   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  112         -
            }
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         159  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  113    160   
        }
         161  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  114    162   
    })
         163  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  115    164   
}
  116    165   
         166  +
/* JsonParserGenerator.kt:148 */
  117    167   
pub(crate) fn de_operation_with_nested_structure(
  118    168   
    value: &[u8],
  119    169   
    mut builder: crate::input::operation_with_nested_structure_input_internal::Builder,
  120    170   
) -> ::std::result::Result<
  121    171   
    crate::input::operation_with_nested_structure_input_internal::Builder,
  122    172   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  123    173   
> {
         174  +
    /* JsonParserGenerator.kt:153 */
  124    175   
    let mut tokens_owned =
  125    176   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  126    177   
            .peekable();
  127    178   
    let tokens = &mut tokens_owned;
  128    179   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         180  +
    /* JsonParserGenerator.kt:684 */
  129    181   
    loop {
         182  +
        /* JsonParserGenerator.kt:685 */
  130    183   
        match tokens.next().transpose()? {
         184  +
            /* JsonParserGenerator.kt:686 */
  131    185   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  132    186   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         187  +
                /* JsonParserGenerator.kt:260 */
  133    188   
                match key.to_unescaped()?.as_ref() {
         189  +
                    /* JsonParserGenerator.kt:262 */
  134    190   
                    "topLevel" => {
         191  +
                        /* JsonParserGenerator.kt:276 */
  135    192   
                        if let Some(v) =
         193  +
                            /* JsonParserGenerator.kt:544 */
  136    194   
                            crate::protocol_serde::shape_top_level::de_top_level(tokens)?
         195  +
                        /* JsonParserGenerator.kt:278 */
  137    196   
                        {
  138    197   
                            builder = builder.set_top_level(v);
  139    198   
                        }
         199  +
                        /* JsonParserGenerator.kt:262 */
  140    200   
                    }
  141         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         201  +
                    /* JsonParserGenerator.kt:290 */
         202  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  142    203   
                }
         204  +
                /* JsonParserGenerator.kt:686 */
  143    205   
            }
         206  +
            /* JsonParserGenerator.kt:695 */
  144    207   
            other => {
  145    208   
                return Err(
  146    209   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  147    210   
                        "expected object key or end object, found: {:?}",
  148    211   
                        other
  149    212   
                    )),
  150    213   
                )
  151         -
            }
         214  +
            } /* JsonParserGenerator.kt:685 */
  152    215   
        }
         216  +
        /* JsonParserGenerator.kt:684 */
  153    217   
    }
         218  +
    /* JsonParserGenerator.kt:250 */
  154    219   
    if tokens.next().is_some() {
         220  +
        /* JsonParserGenerator.kt:251 */
  155    221   
        return Err(
  156    222   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  157    223   
                "found more JSON tokens after completing parsing",
  158    224   
            ),
  159    225   
        );
         226  +
        /* JsonParserGenerator.kt:250 */
  160    227   
    }
         228  +
    /* JsonParserGenerator.kt:163 */
  161    229   
    Ok(builder)
         230  +
    /* JsonParserGenerator.kt:148 */
  162    231   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_operation_with_nested_structure_output.rs

@@ -1,1 +48,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_operation_with_nested_structure_output_output_output(
    3      4   
    value: &crate::output::OperationWithNestedStructureOutput,
    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_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_operation_with_nested_structure_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::OperationWithNestedStructureOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* SerializerUtil.kt:42 */
   16     23   
    {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_1 = object.key("dialog").start_object();
          28  +
        /* JsonSerializerGenerator.kt:375 */
   19     29   
        crate::protocol_serde::shape_dialog::ser_dialog(&mut object_1, &input.dialog)?;
          30  +
        /* JsonSerializerGenerator.kt:515 */
   20     31   
        object_1.finish();
          32  +
        /* SerializerUtil.kt:42 */
   21     33   
    }
          34  +
    /* SerializerUtil.kt:46 */
   22     35   
    {
          36  +
        /* JsonSerializerGenerator.kt:484 */
   23     37   
        let mut array_2 = object.key("dialogList").start_array();
          38  +
        /* JsonSerializerGenerator.kt:524 */
   24     39   
        for item_3 in &input.dialog_list {
          40  +
            /* SerializerUtil.kt:42 */
   25     41   
            {
          42  +
                /* JsonSerializerGenerator.kt:495 */
   26     43   
                #[allow(unused_mut)]
          44  +
                /* JsonSerializerGenerator.kt:496 */
   27     45   
                let mut object_4 = array_2.value().start_object();
          46  +
                /* JsonSerializerGenerator.kt:375 */
   28     47   
                crate::protocol_serde::shape_dialog::ser_dialog(&mut object_4, item_3)?;
          48  +
                /* JsonSerializerGenerator.kt:515 */
   29     49   
                object_4.finish();
          50  +
                /* SerializerUtil.kt:42 */
   30     51   
            }
          52  +
            /* JsonSerializerGenerator.kt:524 */
   31     53   
        }
          54  +
        /* JsonSerializerGenerator.kt:486 */
   32     55   
        array_2.finish();
          56  +
        /* SerializerUtil.kt:46 */
   33     57   
    }
          58  +
    /* SerializerUtil.kt:46 */
   34     59   
    {
          60  +
        /* JsonSerializerGenerator.kt:495 */
   35     61   
        #[allow(unused_mut)]
          62  +
        /* JsonSerializerGenerator.kt:496 */
   36     63   
        let mut object_5 = object.key("dialogMap").start_object();
          64  +
        /* JsonSerializerGenerator.kt:537 */
   37     65   
        for (key_6, value_7) in &input.dialog_map {
          66  +
            /* SerializerUtil.kt:42 */
   38     67   
            {
          68  +
                /* JsonSerializerGenerator.kt:495 */
   39     69   
                #[allow(unused_mut)]
          70  +
                /* JsonSerializerGenerator.kt:496 */
   40     71   
                let mut object_8 = object_5.key(key_6.as_str()).start_object();
          72  +
                /* JsonSerializerGenerator.kt:375 */
   41     73   
                crate::protocol_serde::shape_dialog::ser_dialog(&mut object_8, value_7)?;
          74  +
                /* JsonSerializerGenerator.kt:515 */
   42     75   
                object_8.finish();
          76  +
                /* SerializerUtil.kt:42 */
   43     77   
            }
          78  +
            /* JsonSerializerGenerator.kt:537 */
   44     79   
        }
          80  +
        /* JsonSerializerGenerator.kt:515 */
   45     81   
        object_5.finish();
          82  +
        /* SerializerUtil.kt:46 */
   46     83   
    }
          84  +
    /* JsonSerializerGenerator.kt:372 */
   47     85   
    Ok(())
          86  +
    /* JsonSerializerGenerator.kt:358 */
   48     87   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_operation_with_required_members.rs

@@ -1,1 +88,125 @@
    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_operation_with_required_members_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::OperationWithRequiredMembersInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::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::aws_json::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 =
   18     23   
            crate::input::operation_with_required_members_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     31   
        input.build()
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     33   
    })
          34  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     35   
}
   26     36   
          37  +
/* RustType.kt:516 */
   27     38   
#[allow(clippy::unnecessary_wraps)]
          39  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     40   
pub fn ser_operation_with_required_members_http_response(
   29     41   
    #[allow(unused_variables)] output: crate::output::OperationWithRequiredMembersOutput,
   30     42   
) -> std::result::Result<
   31     43   
    ::aws_smithy_http_server::response::Response,
   32     44   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   33     45   
> {
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     47   
    Ok({
          48  +
        /* RustType.kt:516 */
   35     49   
        #[allow(unused_mut)]
          50  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     51   
        let mut builder = ::http::Response::builder();
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     54   
            builder,
   39     55   
            ::http::header::CONTENT_TYPE,
   40     56   
            "application/x-amz-json-1.0",
   41     57   
        );
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     59   
        let http_status: u16 = 200;
   43     60   
        builder = builder.status(http_status);
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     62   
        let payload =
   45         -
            crate::protocol_serde::shape_operation_with_required_members_output::ser_operation_with_required_members_output_output_output(&output)?
   46         -
        ;
          63  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_operation_with_required_members_output::ser_operation_with_required_members_output_output_output(&output)?
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     66   
        let content_length = payload.len();
   48     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     68   
            builder,
   50     69   
            ::http::header::CONTENT_LENGTH,
   51     70   
            content_length,
   52     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     73   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     75   
        builder.body(body)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     77   
    })
          78  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     79   
}
   57     80   
          81  +
/* RustType.kt:516 */
   58     82   
#[allow(clippy::unnecessary_wraps)]
          83  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   59     84   
pub fn ser_operation_with_required_members_http_error(
   60     85   
    error: &crate::error::OperationWithRequiredMembersError,
   61     86   
) -> std::result::Result<
   62     87   
    ::aws_smithy_http_server::response::Response,
   63     88   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   64     89   
> {
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   65     91   
    Ok({
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   66     93   
        match error {
          94  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   67     95   
            crate::error::OperationWithRequiredMembersError::InternalServerError(output) => {
          96  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   68     97   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          98  +
                /* RustType.kt:516 */
   69     99   
                #[allow(unused_mut)]
         100  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   70    101   
                let mut builder = ::http::Response::builder();
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   71    103   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72    104   
                    builder,
   73    105   
                    ::http::header::CONTENT_TYPE,
   74    106   
                    "application/x-amz-json-1.0",
   75    107   
                );
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   76    109   
                let content_length = payload.len();
   77    110   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78    111   
                    builder,
   79    112   
                    ::http::header::CONTENT_LENGTH,
   80    113   
                    content_length,
   81    114   
                );
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   82    116   
                builder
   83    117   
                    .status(500)
   84    118   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   85         -
            }
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         120  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   86    121   
        }
         122  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   87    123   
    })
         124  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   88    125   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_operation_with_required_members_output.rs

@@ -1,1 +93,150 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_operation_with_required_members_output_output_output(
    3      4   
    value: &crate::output::OperationWithRequiredMembersOutput,
    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_operation_with_required_members_output::ser_operation_with_required_members_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_operation_with_required_members_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::OperationWithRequiredMembersOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* SerializerUtil.kt:42 */
   16     23   
    {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object
   18     26   
            .key("requiredString")
   19     27   
            .string(input.required_string.as_str());
          28  +
        /* SerializerUtil.kt:42 */
   20     29   
    }
          30  +
    /* SerializerUtil.kt:42 */
   21     31   
    {
          32  +
        /* JsonSerializerGenerator.kt:424 */
   22     33   
        object
   23     34   
            .key("requiredBoolean")
   24     35   
            .boolean(input.required_boolean);
          36  +
        /* SerializerUtil.kt:42 */
   25     37   
    }
          38  +
    /* SerializerUtil.kt:42 */
   26     39   
    {
          40  +
        /* JsonSerializerGenerator.kt:484 */
   27     41   
        let mut array_1 = object.key("requiredList").start_array();
          42  +
        /* JsonSerializerGenerator.kt:524 */
   28     43   
        for item_2 in &input.required_list {
          44  +
            /* SerializerUtil.kt:42 */
   29     45   
            {
          46  +
                /* JsonSerializerGenerator.kt:423 */
   30     47   
                array_1.value().string(item_2.as_str());
          48  +
                /* SerializerUtil.kt:42 */
   31     49   
            }
          50  +
            /* JsonSerializerGenerator.kt:524 */
   32     51   
        }
          52  +
        /* JsonSerializerGenerator.kt:486 */
   33     53   
        array_1.finish();
          54  +
        /* SerializerUtil.kt:42 */
   34     55   
    }
          56  +
    /* SerializerUtil.kt:42 */
   35     57   
    {
          58  +
        /* JsonSerializerGenerator.kt:448 */
   36     59   
        object.key("requiredTimestamp").date_time(
   37     60   
            &input.required_timestamp,
   38     61   
            ::aws_smithy_types::date_time::Format::EpochSeconds,
   39     62   
        )?;
          63  +
        /* SerializerUtil.kt:42 */
   40     64   
    }
          65  +
    /* SerializerUtil.kt:42 */
   41     66   
    {
          67  +
        /* JsonSerializerGenerator.kt:439 */
   42     68   
        object
   43     69   
            .key("requiredBlob")
   44     70   
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.required_blob));
          71  +
        /* SerializerUtil.kt:42 */
   45     72   
    }
          73  +
    /* SerializerUtil.kt:42 */
   46     74   
    {
          75  +
        /* JsonSerializerGenerator.kt:432 */
   47     76   
        object.key("requiredByte").number(
   48     77   
            #[allow(clippy::useless_conversion)]
   49     78   
            ::aws_smithy_types::Number::NegInt((input.required_byte).into()),
   50     79   
        );
          80  +
        /* SerializerUtil.kt:42 */
   51     81   
    }
          82  +
    /* SerializerUtil.kt:42 */
   52     83   
    {
          84  +
        /* JsonSerializerGenerator.kt:432 */
   53     85   
        object.key("requiredShort").number(
   54     86   
            #[allow(clippy::useless_conversion)]
   55     87   
            ::aws_smithy_types::Number::NegInt((input.required_short).into()),
   56     88   
        );
          89  +
        /* SerializerUtil.kt:42 */
   57     90   
    }
          91  +
    /* SerializerUtil.kt:42 */
   58     92   
    {
          93  +
        /* JsonSerializerGenerator.kt:432 */
   59     94   
        object.key("requiredInteger").number(
   60     95   
            #[allow(clippy::useless_conversion)]
   61     96   
            ::aws_smithy_types::Number::NegInt((input.required_integer).into()),
   62     97   
        );
          98  +
        /* SerializerUtil.kt:42 */
   63     99   
    }
         100  +
    /* SerializerUtil.kt:42 */
   64    101   
    {
         102  +
        /* JsonSerializerGenerator.kt:432 */
   65    103   
        object.key("requiredLong").number(
   66    104   
            #[allow(clippy::useless_conversion)]
   67    105   
            ::aws_smithy_types::Number::NegInt((input.required_long).into()),
   68    106   
        );
         107  +
        /* SerializerUtil.kt:42 */
   69    108   
    }
         109  +
    /* SerializerUtil.kt:42 */
   70    110   
    {
         111  +
        /* JsonSerializerGenerator.kt:432 */
   71    112   
        object.key("requiredFloat").number(
   72    113   
            #[allow(clippy::useless_conversion)]
   73    114   
            ::aws_smithy_types::Number::Float((input.required_float).into()),
   74    115   
        );
         116  +
        /* SerializerUtil.kt:42 */
   75    117   
    }
         118  +
    /* SerializerUtil.kt:42 */
   76    119   
    {
         120  +
        /* JsonSerializerGenerator.kt:432 */
   77    121   
        object.key("requiredDouble").number(
   78    122   
            #[allow(clippy::useless_conversion)]
   79    123   
            ::aws_smithy_types::Number::Float((input.required_double).into()),
   80    124   
        );
         125  +
        /* SerializerUtil.kt:42 */
   81    126   
    }
         127  +
    /* SerializerUtil.kt:42 */
   82    128   
    {
         129  +
        /* JsonSerializerGenerator.kt:495 */
   83    130   
        #[allow(unused_mut)]
         131  +
        /* JsonSerializerGenerator.kt:496 */
   84    132   
        let mut object_3 = object.key("requiredMap").start_object();
         133  +
        /* JsonSerializerGenerator.kt:537 */
   85    134   
        for (key_4, value_5) in &input.required_map {
         135  +
            /* SerializerUtil.kt:42 */
   86    136   
            {
         137  +
                /* JsonSerializerGenerator.kt:423 */
   87    138   
                object_3.key(key_4.as_str()).string(value_5.as_str());
         139  +
                /* SerializerUtil.kt:42 */
   88    140   
            }
         141  +
            /* JsonSerializerGenerator.kt:537 */
   89    142   
        }
         143  +
        /* JsonSerializerGenerator.kt:515 */
   90    144   
        object_3.finish();
         145  +
        /* SerializerUtil.kt:42 */
   91    146   
    }
         147  +
    /* JsonSerializerGenerator.kt:372 */
   92    148   
    Ok(())
         149  +
    /* JsonSerializerGenerator.kt:358 */
   93    150   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +151,223 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_put_with_content_encoding_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::PutWithContentEncodingInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::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::aws_json::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::put_with_content_encoding_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/x-amz-json-1.0"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_put_with_content_encoding_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::PutWithContentEncodingOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.0",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
   51         -
        let payload = "";
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          73  +
        let payload =
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   52     77   
        let content_length = payload.len();
   53     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     79   
            builder,
   55     80   
            ::http::header::CONTENT_LENGTH,
   56     81   
            content_length,
   57     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   58     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   59     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   60     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   61     90   
}
   62     91   
          92  +
/* RustType.kt:516 */
   63     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   64     95   
pub fn ser_put_with_content_encoding_http_error(
   65     96   
    error: &crate::error::PutWithContentEncodingError,
   66     97   
) -> std::result::Result<
   67     98   
    ::aws_smithy_http_server::response::Response,
   68     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   70    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   71    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   72    106   
            crate::error::PutWithContentEncodingError::InternalServerError(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   73    108   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         109  +
                /* RustType.kt:516 */
   74    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   75    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    115   
                    builder,
   78    116   
                    ::http::header::CONTENT_TYPE,
   79    117   
                    "application/x-amz-json-1.0",
   80    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    120   
                let content_length = payload.len();
   82    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    122   
                    builder,
   84    123   
                    ::http::header::CONTENT_LENGTH,
   85    124   
                    content_length,
   86    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    127   
                builder
   88    128   
                    .status(500)
   89    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90         -
            }
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         131  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   91    132   
        }
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    134   
    })
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    136   
}
   94    137   
         138  +
/* JsonParserGenerator.kt:148 */
   95    139   
pub(crate) fn de_put_with_content_encoding(
   96    140   
    value: &[u8],
   97    141   
    mut builder: crate::input::put_with_content_encoding_input_internal::Builder,
   98    142   
) -> ::std::result::Result<
   99    143   
    crate::input::put_with_content_encoding_input_internal::Builder,
  100    144   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  101    145   
> {
         146  +
    /* JsonParserGenerator.kt:153 */
  102    147   
    let mut tokens_owned =
  103    148   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  104    149   
            .peekable();
  105    150   
    let tokens = &mut tokens_owned;
  106    151   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         152  +
    /* JsonParserGenerator.kt:684 */
  107    153   
    loop {
         154  +
        /* JsonParserGenerator.kt:685 */
  108    155   
        match tokens.next().transpose()? {
         156  +
            /* JsonParserGenerator.kt:686 */
  109    157   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  110    158   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         159  +
                /* JsonParserGenerator.kt:260 */
  111    160   
                match key.to_unescaped()?.as_ref() {
         161  +
                    /* JsonParserGenerator.kt:262 */
  112    162   
                    "encoding" => {
         163  +
                        /* JsonParserGenerator.kt:272 */
  113    164   
                        builder = builder.set_encoding(
         165  +
                            /* JsonParserGenerator.kt:354 */
  114    166   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  115    167   
                                tokens.next(),
  116    168   
                            )?
  117         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  118         -
                            .transpose()?,
         169  +
                            .map(|s|
         170  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         171  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         172  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         173  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  119    174   
                        );
         175  +
                        /* JsonParserGenerator.kt:262 */
  120    176   
                    }
         177  +
                    /* JsonParserGenerator.kt:262 */
  121    178   
                    "data" => {
         179  +
                        /* JsonParserGenerator.kt:272 */
  122    180   
                        builder = builder.set_data(
         181  +
                            /* JsonParserGenerator.kt:354 */
  123    182   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  124    183   
                                tokens.next(),
  125    184   
                            )?
  126         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  127         -
                            .transpose()?,
         185  +
                            .map(|s|
         186  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         187  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         188  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         189  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  128    190   
                        );
         191  +
                        /* JsonParserGenerator.kt:262 */
  129    192   
                    }
  130         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         193  +
                    /* JsonParserGenerator.kt:290 */
         194  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  131    195   
                }
         196  +
                /* JsonParserGenerator.kt:686 */
  132    197   
            }
         198  +
            /* JsonParserGenerator.kt:695 */
  133    199   
            other => {
  134    200   
                return Err(
  135    201   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  136    202   
                        "expected object key or end object, found: {:?}",
  137    203   
                        other
  138    204   
                    )),
  139    205   
                )
  140         -
            }
         206  +
            } /* JsonParserGenerator.kt:685 */
  141    207   
        }
         208  +
        /* JsonParserGenerator.kt:684 */
  142    209   
    }
         210  +
    /* JsonParserGenerator.kt:250 */
  143    211   
    if tokens.next().is_some() {
         212  +
        /* JsonParserGenerator.kt:251 */
  144    213   
        return Err(
  145    214   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  146    215   
                "found more JSON tokens after completing parsing",
  147    216   
            ),
  148    217   
        );
         218  +
        /* JsonParserGenerator.kt:250 */
  149    219   
    }
         220  +
    /* JsonParserGenerator.kt:163 */
  150    221   
    Ok(builder)
         222  +
    /* JsonParserGenerator.kt:148 */
  151    223   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_simple_scalar_properties.rs

@@ -1,1 +155,219 @@
    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_simple_scalar_properties_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::SimpleScalarPropertiesInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::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::aws_json::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::simple_scalar_properties_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/x-amz-json-1.0"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(
   30     40   
                    bytes.as_ref(),
   31     41   
                    input,
   32     42   
                )?;
          43  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   33     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     50   
}
   37     51   
          52  +
/* RustType.kt:516 */
   38     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     55   
pub fn ser_simple_scalar_properties_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
   41     57   
) -> std::result::Result<
   42     58   
    ::aws_smithy_http_server::response::Response,
   43     59   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   44     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   45     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   46     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   47     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_TYPE,
   51     71   
            "application/x-amz-json-1.0",
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   53     74   
        let http_status: u16 = 200;
   54     75   
        builder = builder.status(http_status);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   55     77   
        let payload =
   56         -
            crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
   57         -
        ;
          78  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   58     81   
        let content_length = payload.len();
   59     82   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     83   
            builder,
   61     84   
            ::http::header::CONTENT_LENGTH,
   62     85   
            content_length,
   63     86   
        );
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   64     88   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   65     90   
        builder.body(body)?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   66     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   67     94   
}
   68     95   
          96  +
/* RustType.kt:516 */
   69     97   
#[allow(clippy::unnecessary_wraps)]
          98  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   70     99   
pub fn ser_simple_scalar_properties_http_error(
   71    100   
    error: &crate::error::SimpleScalarPropertiesError,
   72    101   
) -> std::result::Result<
   73    102   
    ::aws_smithy_http_server::response::Response,
   74    103   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   75    104   
> {
         105  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   76    106   
    Ok({
         107  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   77    108   
        match error {
         109  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   78    110   
            crate::error::SimpleScalarPropertiesError::InternalServerError(output) => {
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   79    112   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         113  +
                /* RustType.kt:516 */
   80    114   
                #[allow(unused_mut)]
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   81    116   
                let mut builder = ::http::Response::builder();
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   82    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    119   
                    builder,
   84    120   
                    ::http::header::CONTENT_TYPE,
   85    121   
                    "application/x-amz-json-1.0",
   86    122   
                );
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   87    124   
                let content_length = payload.len();
   88    125   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    126   
                    builder,
   90    127   
                    ::http::header::CONTENT_LENGTH,
   91    128   
                    content_length,
   92    129   
                );
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   93    131   
                builder
   94    132   
                    .status(500)
   95    133   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   96         -
            }
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         135  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   97    136   
        }
         137  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   98    138   
    })
         139  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   99    140   
}
  100    141   
         142  +
/* JsonParserGenerator.kt:148 */
  101    143   
pub(crate) fn de_simple_scalar_properties(
  102    144   
    value: &[u8],
  103    145   
    mut builder: crate::input::simple_scalar_properties_input_internal::Builder,
  104    146   
) -> ::std::result::Result<
  105    147   
    crate::input::simple_scalar_properties_input_internal::Builder,
  106    148   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  107    149   
> {
         150  +
    /* JsonParserGenerator.kt:153 */
  108    151   
    let mut tokens_owned =
  109    152   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  110    153   
            .peekable();
  111    154   
    let tokens = &mut tokens_owned;
  112    155   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         156  +
    /* JsonParserGenerator.kt:684 */
  113    157   
    loop {
         158  +
        /* JsonParserGenerator.kt:685 */
  114    159   
        match tokens.next().transpose()? {
         160  +
            /* JsonParserGenerator.kt:686 */
  115    161   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  116    162   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         163  +
                /* JsonParserGenerator.kt:260 */
  117    164   
                match key.to_unescaped()?.as_ref() {
         165  +
                    /* JsonParserGenerator.kt:262 */
  118    166   
                    "floatValue" => {
         167  +
                        /* JsonParserGenerator.kt:272 */
  119    168   
                        builder = builder.set_float_value(
         169  +
                            /* JsonParserGenerator.kt:361 */
  120    170   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  121    171   
                                tokens.next(),
  122    172   
                            )?
  123         -
                            .map(|v| v.to_f32_lossy()),
         173  +
                            .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
  124    174   
                        );
         175  +
                        /* JsonParserGenerator.kt:262 */
  125    176   
                    }
         177  +
                    /* JsonParserGenerator.kt:262 */
  126    178   
                    "doubleValue" => {
         179  +
                        /* JsonParserGenerator.kt:272 */
  127    180   
                        builder = builder.set_double_value(
         181  +
                            /* JsonParserGenerator.kt:363 */
  128    182   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  129    183   
                                tokens.next(),
  130    184   
                            )?
  131         -
                            .map(|v| v.to_f64_lossy()),
         185  +
                            .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
  132    186   
                        );
         187  +
                        /* JsonParserGenerator.kt:262 */
  133    188   
                    }
  134         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         189  +
                    /* JsonParserGenerator.kt:290 */
         190  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  135    191   
                }
         192  +
                /* JsonParserGenerator.kt:686 */
  136    193   
            }
         194  +
            /* JsonParserGenerator.kt:695 */
  137    195   
            other => {
  138    196   
                return Err(
  139    197   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  140    198   
                        "expected object key or end object, found: {:?}",
  141    199   
                        other
  142    200   
                    )),
  143    201   
                )
  144         -
            }
         202  +
            } /* JsonParserGenerator.kt:685 */
  145    203   
        }
         204  +
        /* JsonParserGenerator.kt:684 */
  146    205   
    }
         206  +
    /* JsonParserGenerator.kt:250 */
  147    207   
    if tokens.next().is_some() {
         208  +
        /* JsonParserGenerator.kt:251 */
  148    209   
        return Err(
  149    210   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  150    211   
                "found more JSON tokens after completing parsing",
  151    212   
            ),
  152    213   
        );
         214  +
        /* JsonParserGenerator.kt:250 */
  153    215   
    }
         216  +
    /* JsonParserGenerator.kt:163 */
  154    217   
    Ok(builder)
         218  +
    /* JsonParserGenerator.kt:148 */
  155    219   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_simple_scalar_properties_output.rs

@@ -1,1 +29,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_simple_scalar_properties_output_output_output(
    3      4   
    value: &crate::output::SimpleScalarPropertiesOutput,
    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_simple_scalar_properties_output::ser_simple_scalar_properties_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_simple_scalar_properties_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::SimpleScalarPropertiesOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.float_value {
          24  +
        /* JsonSerializerGenerator.kt:432 */
   17     25   
        object.key("floatValue").number(
   18     26   
            #[allow(clippy::useless_conversion)]
   19     27   
            ::aws_smithy_types::Number::Float((*var_1).into()),
   20     28   
        );
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   22     32   
    if let Some(var_2) = &input.double_value {
          33  +
        /* JsonSerializerGenerator.kt:432 */
   23     34   
        object.key("doubleValue").number(
   24     35   
            #[allow(clippy::useless_conversion)]
   25     36   
            ::aws_smithy_types::Number::Float((*var_2).into()),
   26     37   
        );
          38  +
        /* JsonSerializerGenerator.kt:382 */
   27     39   
    }
          40  +
    /* JsonSerializerGenerator.kt:372 */
   28     41   
    Ok(())
          42  +
    /* JsonSerializerGenerator.kt:358 */
   29     43   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_string_list.rs

@@ -1,1 +52,78 @@
    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_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::string::String>>,
    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 = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
   41         -
                    }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   42     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   43     61   
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
          70  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          71  +
                    "expected start array or null",
          72  +
                ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_string_map.rs

@@ -1,1 +60,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_string_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    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::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                        .transpose()?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
   49         -
                    }
          67  +
                    } /* JsonParserGenerator.kt:685 */
   50     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   51     70   
            }
          71  +
            /* JsonParserGenerator.kt:504 */
   52     72   
            Ok(Some(map))
          73  +
            /* JsonParserGenerator.kt:713 */
   53     74   
        }
   54         -
        _ => Err(
   55         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56         -
                "expected start object or null",
   57         -
            ),
   58         -
        ),
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(
          79  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          80  +
                    "expected start object or null",
          81  +
                ),
          82  +
            )
          83  +
            /* JsonParserGenerator.kt:722 */
          84  +
        } /* JsonParserGenerator.kt:712 */
   59     85   
    }
          86  +
    /* JsonParserGenerator.kt:460 */
   60     87   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_test_string_list.rs

@@ -1,1 +52,78 @@
    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_test_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::string::String>>,
    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 = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
   41         -
                    }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   42     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   43     61   
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
          70  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          71  +
                    "expected start array or null",
          72  +
                ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_test_string_map.rs

@@ -1,1 +60,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_test_string_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    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::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                        .transpose()?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
   49         -
                    }
          67  +
                    } /* JsonParserGenerator.kt:685 */
   50     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   51     70   
            }
          71  +
            /* JsonParserGenerator.kt:504 */
   52     72   
            Ok(Some(map))
          73  +
            /* JsonParserGenerator.kt:713 */
   53     74   
        }
   54         -
        _ => Err(
   55         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56         -
                "expected start object or null",
   57         -
            ),
   58         -
        ),
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(
          79  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          80  +
                    "expected start object or null",
          81  +
                ),
          82  +
            )
          83  +
            /* JsonParserGenerator.kt:722 */
          84  +
        } /* JsonParserGenerator.kt:712 */
   59     85   
    }
          86  +
    /* JsonParserGenerator.kt:460 */
   60     87   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/rust-server-codegen-python/src/protocol_serde/shape_top_level.rs

@@ -1,1 +67,107 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_top_level<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::top_level_internal::Builder>,
    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::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::top_level_internal::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key
   25         -
                        .to_unescaped()?
   26         -
                        .as_ref()
   27         -
                    {
   28         -
                        "dialog" => {
   29         -
                            if let Some(v) = crate::protocol_serde::shape_dialog::de_dialog(tokens)?
   30         -
                            {
   31         -
                                builder = builder.set_dialog(v);
          32  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
          34  +
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
          36  +
                            "dialog" => {
          37  +
                                /* JsonParserGenerator.kt:276 */
          38  +
                                if let Some(v) =
          39  +
                                    /* JsonParserGenerator.kt:544 */
          40  +
                                    crate::protocol_serde::shape_dialog::de_dialog(tokens)?
          41  +
                                /* JsonParserGenerator.kt:278 */
          42  +
                                {
          43  +
                                    builder = builder.set_dialog(v);
          44  +
                                }
          45  +
                                /* JsonParserGenerator.kt:262 */
   32     46   
                            }
   33         -
                        }
   34         -
                        "dialogList" => {
   35         -
                            if let Some(v) =
   36         -
                                crate::protocol_serde::shape_dialog_list::de_dialog_list(tokens)?
   37         -
                            {
   38         -
                                builder = builder.set_dialog_list(v);
          47  +
                            /* JsonParserGenerator.kt:262 */
          48  +
                            "dialogList" => {
          49  +
                                /* JsonParserGenerator.kt:276 */
          50  +
                                if let Some(v) =
          51  +
                                    /* JsonParserGenerator.kt:451 */
          52  +
                                    crate::protocol_serde::shape_dialog_list::de_dialog_list(
          53  +
                                            tokens,
          54  +
                                        )?
          55  +
                                /* JsonParserGenerator.kt:278 */
          56  +
                                {
          57  +
                                    builder = builder.set_dialog_list(v);
          58  +
                                }
          59  +
                                /* JsonParserGenerator.kt:262 */
   39     60   
                            }
   40         -
                        }
   41         -
                        "dialogMap" => {
   42         -
                            if let Some(v) =
   43         -
                                crate::protocol_serde::shape_dialog_map::de_dialog_map(tokens)?
   44         -
                            {
   45         -
                                builder = builder.set_dialog_map(v);
          61  +
                            /* JsonParserGenerator.kt:262 */
          62  +
                            "dialogMap" => {
          63  +
                                /* JsonParserGenerator.kt:276 */
          64  +
                                if let Some(v) =
          65  +
                                    /* JsonParserGenerator.kt:509 */
          66  +
                                    crate::protocol_serde::shape_dialog_map::de_dialog_map(
          67  +
                                            tokens,
          68  +
                                        )?
          69  +
                                /* JsonParserGenerator.kt:278 */
          70  +
                                {
          71  +
                                    builder = builder.set_dialog_map(v);
          72  +
                                }
          73  +
                                /* JsonParserGenerator.kt:262 */
   46     74   
                            }
          75  +
                            /* JsonParserGenerator.kt:290 */
          76  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   47     77   
                        }
   48         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   49         -
                    },
          78  +
                        /* JsonParserGenerator.kt:686 */
          79  +
                    }
          80  +
                    /* JsonParserGenerator.kt:695 */
   50     81   
                    other => {
   51     82   
                        return Err(
   52     83   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53     84   
                                format!("expected object key or end object, found: {:?}", other),
   54     85   
                            ),
   55     86   
                        )
   56         -
                    }
          87  +
                    } /* JsonParserGenerator.kt:685 */
   57     88   
                }
          89  +
                /* JsonParserGenerator.kt:684 */
   58     90   
            }
          91  +
            /* JsonParserGenerator.kt:540 */
   59     92   
            Ok(Some(builder))
          93  +
            /* JsonParserGenerator.kt:713 */
   60     94   
        }
   61         -
        _ => Err(
   62         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63         -
                "expected start object or null",
   64         -
            ),
   65         -
        ),
          95  +
        /* JsonParserGenerator.kt:722 */
          96  +
        _ => {
          97  +
            /* JsonParserGenerator.kt:723 */
          98  +
            Err(
          99  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         100  +
                    "expected start object or null",
         101  +
                ),
         102  +
            )
         103  +
            /* JsonParserGenerator.kt:722 */
         104  +
        } /* JsonParserGenerator.kt:712 */
   66    105   
    }
         106  +
    /* JsonParserGenerator.kt:516 */
   67    107   
}

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

@@ -1,1 +38,62 @@
    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  +
    /* ServerAwsJson.kt:95 */
   11     15   
    object
   12     16   
        .key("__type")
   13     17   
        .string("smithy.framework#ValidationException");
          18  +
    /* JsonSerializerGenerator.kt:227 */
   14     19   
    object.finish();
   15     20   
    Ok(out)
          21  +
    /* JsonSerializerGenerator.kt:213 */
   16     22   
}
   17     23   
          24  +
/* JsonSerializerGenerator.kt:358 */
   18     25   
pub fn ser_validation_exception(
   19     26   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   20     27   
    input: &crate::error::ValidationException,
   21     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* SerializerUtil.kt:42 */
   22     30   
    {
          31  +
        /* JsonSerializerGenerator.kt:423 */
   23     32   
        object.key("message").string(input.message.as_str());
          33  +
        /* SerializerUtil.kt:42 */
   24     34   
    }
          35  +
    /* JsonSerializerGenerator.kt:382 */
   25     36   
    if let Some(var_1) = &input.field_list {
          37  +
        /* JsonSerializerGenerator.kt:484 */
   26     38   
        let mut array_2 = object.key("fieldList").start_array();
          39  +
        /* JsonSerializerGenerator.kt:524 */
   27     40   
        for item_3 in var_1 {
          41  +
            /* SerializerUtil.kt:42 */
   28     42   
            {
          43  +
                /* JsonSerializerGenerator.kt:495 */
   29     44   
                #[allow(unused_mut)]
          45  +
                /* JsonSerializerGenerator.kt:496 */
   30     46   
                let mut object_4 = array_2.value().start_object();
          47  +
                /* JsonSerializerGenerator.kt:375 */
   31     48   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          49  +
                /* JsonSerializerGenerator.kt:515 */
   32     50   
                object_4.finish();
          51  +
                /* SerializerUtil.kt:42 */
   33     52   
            }
          53  +
            /* JsonSerializerGenerator.kt:524 */
   34     54   
        }
          55  +
        /* JsonSerializerGenerator.kt:486 */
   35     56   
        array_2.finish();
          57  +
        /* JsonSerializerGenerator.kt:382 */
   36     58   
    }
          59  +
    /* JsonSerializerGenerator.kt:372 */
   37     60   
    Ok(())
          61  +
    /* JsonSerializerGenerator.kt:358 */
   38     62   
}

tmp-codegen-diff/codegen-server-test-python/json_rpc10/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/json_rpc10/rust-server-codegen-python/src/python_module_export.rs

@@ -1,1 +137,196 @@
    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 = "json_rpc10")]
           4  +
#[pyo3(name = "json_rpc10")]
    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   
    output.add_class::<crate::output::OperationWithNestedStructureOutput>()?;
          20  +
    /* PythonServerModuleGenerator.kt:96 */
   13     21   
    model.add_class::<crate::model::Dialog>()?;
          22  +
    /* PythonServerModuleGenerator.kt:96 */
   14     23   
    model.add_class::<crate::model::Farewell>()?;
          24  +
    /* PythonServerModuleGenerator.kt:96 */
   15     25   
    input.add_class::<crate::input::OperationWithNestedStructureInput>()?;
          26  +
    /* PythonServerModuleGenerator.kt:96 */
   16     27   
    model.add_class::<crate::model::TopLevel>()?;
          28  +
    /* PythonServerModuleGenerator.kt:96 */
   17     29   
    output.add_class::<crate::output::OperationWithRequiredMembersOutput>()?;
          30  +
    /* PythonServerModuleGenerator.kt:96 */
   18     31   
    input.add_class::<crate::input::OperationWithRequiredMembersInput>()?;
          32  +
    /* PythonServerModuleGenerator.kt:96 */
   19     33   
    output.add_class::<crate::output::OperationWithDefaultsOutput>()?;
          34  +
    /* PythonServerModuleGenerator.kt:96 */
   20     35   
    model.add_class::<crate::model::TestEnum>()?;
          36  +
    /* PythonServerModuleGenerator.kt:96 */
   21     37   
    input.add_class::<crate::input::OperationWithDefaultsInput>()?;
          38  +
    /* PythonServerModuleGenerator.kt:96 */
   22     39   
    model.add_class::<crate::model::ClientOptionalDefaults>()?;
          40  +
    /* PythonServerModuleGenerator.kt:96 */
   23     41   
    model.add_class::<crate::model::Defaults>()?;
          42  +
    /* PythonServerModuleGenerator.kt:96 */
   24     43   
    output.add_class::<crate::output::ContentTypeParametersOutput>()?;
          44  +
    /* PythonServerModuleGenerator.kt:96 */
   25     45   
    input.add_class::<crate::input::ContentTypeParametersInput>()?;
          46  +
    /* PythonServerModuleGenerator.kt:96 */
   26     47   
    output.add_class::<crate::output::PutWithContentEncodingOutput>()?;
          48  +
    /* PythonServerModuleGenerator.kt:96 */
   27     49   
    input.add_class::<crate::input::PutWithContentEncodingInput>()?;
          50  +
    /* PythonServerModuleGenerator.kt:96 */
   28     51   
    output.add_class::<crate::output::HostWithPathOperationOutput>()?;
          52  +
    /* PythonServerModuleGenerator.kt:96 */
   29     53   
    input.add_class::<crate::input::HostWithPathOperationInput>()?;
          54  +
    /* PythonServerModuleGenerator.kt:96 */
   30     55   
    output.add_class::<crate::output::EndpointWithHostLabelOperationOutput>()?;
          56  +
    /* PythonServerModuleGenerator.kt:96 */
   31     57   
    input.add_class::<crate::input::EndpointWithHostLabelOperationInput>()?;
          58  +
    /* PythonServerModuleGenerator.kt:96 */
   32     59   
    output.add_class::<crate::output::EndpointOperationOutput>()?;
          60  +
    /* PythonServerModuleGenerator.kt:96 */
   33     61   
    input.add_class::<crate::input::EndpointOperationInput>()?;
          62  +
    /* PythonServerModuleGenerator.kt:96 */
   34     63   
    output.add_class::<crate::output::JsonUnionsOutput>()?;
          64  +
    /* PythonServerModuleGenerator.kt:89 */
   35     65   
    model.add_class::<crate::model::PyUnionMarkerMyUnion>()?;
          66  +
    /* PythonServerModuleGenerator.kt:96 */
   36     67   
    model.add_class::<crate::model::GreetingStruct>()?;
          68  +
    /* PythonServerModuleGenerator.kt:96 */
   37     69   
    model.add_class::<crate::model::FooEnum>()?;
          70  +
    /* PythonServerModuleGenerator.kt:96 */
   38     71   
    input.add_class::<crate::input::JsonUnionsInput>()?;
          72  +
    /* PythonServerModuleGenerator.kt:96 */
   39     73   
    error.add_class::<crate::error::FooError>()?;
          74  +
    /* PythonServerModuleGenerator.kt:96 */
   40     75   
    error.add_class::<crate::error::ComplexError>()?;
          76  +
    /* PythonServerModuleGenerator.kt:96 */
   41     77   
    model.add_class::<crate::model::ComplexNestedErrorData>()?;
          78  +
    /* PythonServerModuleGenerator.kt:96 */
   42     79   
    error.add_class::<crate::error::InvalidGreeting>()?;
          80  +
    /* PythonServerModuleGenerator.kt:96 */
   43     81   
    output.add_class::<crate::output::GreetingWithErrorsOutput>()?;
          82  +
    /* PythonServerModuleGenerator.kt:96 */
   44     83   
    input.add_class::<crate::input::GreetingWithErrorsInput>()?;
          84  +
    /* PythonServerModuleGenerator.kt:96 */
   45     85   
    output.add_class::<crate::output::SimpleScalarPropertiesOutput>()?;
          86  +
    /* PythonServerModuleGenerator.kt:96 */
   46     87   
    input.add_class::<crate::input::SimpleScalarPropertiesInput>()?;
          88  +
    /* PythonServerModuleGenerator.kt:96 */
   47     89   
    output.add_class::<crate::output::EmptyInputAndEmptyOutputOutput>()?;
          90  +
    /* PythonServerModuleGenerator.kt:96 */
   48     91   
    input.add_class::<crate::input::EmptyInputAndEmptyOutputInput>()?;
          92  +
    /* PythonServerModuleGenerator.kt:96 */
   49     93   
    output.add_class::<crate::output::NoInputAndOutputOutput>()?;
          94  +
    /* PythonServerModuleGenerator.kt:96 */
   50     95   
    input.add_class::<crate::input::NoInputAndOutputInput>()?;
          96  +
    /* PythonServerModuleGenerator.kt:96 */
   51     97   
    output.add_class::<crate::output::NoInputAndNoOutputOutput>()?;
          98  +
    /* PythonServerModuleGenerator.kt:96 */
   52     99   
    input.add_class::<crate::input::NoInputAndNoOutputInput>()?;
         100  +
    /* PythonServerModuleGenerator.kt:105 */
   53    101   
    ::pyo3::py_run!(
   54    102   
        py,
   55    103   
        input,
   56    104   
        "import sys; sys.modules['json_rpc10.input'] = input"
   57    105   
    );
   58    106   
    m.add_submodule(input)?;
   59    107   
    ::pyo3::py_run!(
   60    108   
        py,
   61    109   
        output,
   62    110   
        "import sys; sys.modules['json_rpc10.output'] = output"
   63    111   
    );
   64    112   
    m.add_submodule(output)?;
   65    113   
    ::pyo3::py_run!(
   66    114   
        py,
   67    115   
        error,
   68    116   
        "import sys; sys.modules['json_rpc10.error'] = error"
   69    117   
    );
   70    118   
    m.add_submodule(error)?;
         119  +
    /* PythonServerModuleGenerator.kt:117 */
   71    120   
    ::pyo3::py_run!(
   72    121   
        py,
   73    122   
        model,
   74    123   
        "import sys; sys.modules['json_rpc10.model'] = model"
   75    124   
    );
   76    125   
    m.add_submodule(model)?;
         126  +
    /* PythonServerModuleGenerator.kt:129 */
   77    127   
    let types = ::pyo3::types::PyModule::new(py, "types")?;
   78    128   
    types.add_class::<::aws_smithy_http_server_python::types::Blob>()?;
   79    129   
    types.add_class::<::aws_smithy_http_server_python::types::DateTime>()?;
   80    130   
    types.add_class::<::aws_smithy_http_server_python::types::Format>()?;
   81    131   
    types.add_class::<::aws_smithy_http_server_python::types::ByteStream>()?;
   82    132   
    ::pyo3::py_run!(
   83    133   
        py,
   84    134   
        types,
   85    135   
        "import sys; sys.modules['json_rpc10.types'] = types"
   86    136   
    );
   87    137   
    m.add_submodule(types)?;
         138  +
    /* PythonServerModuleGenerator.kt:149 */
   88    139   
    let socket = ::pyo3::types::PyModule::new(py, "socket")?;
   89    140   
    socket.add_class::<::aws_smithy_http_server_python::PySocket>()?;
   90    141   
    ::pyo3::py_run!(
   91    142   
        py,
   92    143   
        socket,
   93    144   
        "import sys; sys.modules['json_rpc10.socket'] = socket"
   94    145   
    );
   95    146   
    m.add_submodule(socket)?;
         147  +
    /* PythonServerModuleGenerator.kt:166 */
   96    148   
    let logging = ::pyo3::types::PyModule::new(py, "logging")?;
   97    149   
    logging.add_function(::pyo3::wrap_pyfunction!(
   98    150   
        ::aws_smithy_http_server_python::py_tracing_event,
   99    151   
        m
  100    152   
    )?)?;
  101    153   
    logging.add_class::<::aws_smithy_http_server_python::PyTracingHandler>()?;
  102    154   
    ::pyo3::py_run!(
  103    155   
        py,
  104    156   
        logging,
  105    157   
        "import sys; sys.modules['json_rpc10.logging'] = logging"
  106    158   
    );
  107    159   
    m.add_submodule(logging)?;
         160  +
    /* PythonServerModuleGenerator.kt:183 */
  108    161   
    let middleware = ::pyo3::types::PyModule::new(py, "middleware")?;
  109    162   
    middleware.add_class::<::aws_smithy_http_server_python::PyRequest>()?;
  110    163   
    middleware.add_class::<::aws_smithy_http_server_python::PyResponse>()?;
  111    164   
    middleware.add_class::<::aws_smithy_http_server_python::PyMiddlewareException>()?;
  112    165   
    pyo3::py_run!(
  113    166   
        py,
  114    167   
        middleware,
  115    168   
        "import sys; sys.modules['json_rpc10.middleware'] = middleware"
  116    169   
    );
  117    170   
    m.add_submodule(middleware)?;
         171  +
    /* PythonServerModuleGenerator.kt:201 */
  118    172   
    let tls = ::pyo3::types::PyModule::new(py, "tls")?;
  119    173   
    tls.add_class::<::aws_smithy_http_server_python::tls::PyTlsConfig>()?;
  120    174   
    pyo3::py_run!(py, tls, "import sys; sys.modules['json_rpc10.tls'] = tls");
  121    175   
    m.add_submodule(tls)?;
         176  +
    /* PythonServerModuleGenerator.kt:217 */
  122    177   
    let aws_lambda = ::pyo3::types::PyModule::new(py, "aws_lambda")?;
  123    178   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyLambdaContext>()?;
  124    179   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyClientApplication>()?;
  125    180   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyClientContext>()?;
  126    181   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyCognitoIdentity>()?;
  127    182   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyConfig>()?;
  128    183   
    pyo3::py_run!(
  129    184   
        py,
  130    185   
        aws_lambda,
  131    186   
        "import sys; sys.modules['json_rpc10.aws_lambda'] = aws_lambda"
  132    187   
    );
  133    188   
    m.add_submodule(aws_lambda)?;
         189  +
    /* PythonServerModuleGenerator.kt:238 */
  134    190   
    m.add_class::<crate::python_server_application::App>()?;
         191  +
    /* PythonServerModuleGenerator.kt:243 */
  135    192   
    m.add("CODEGEN_VERSION", "ci")?;
         193  +
    /* PythonServerModuleGenerator.kt:58 */
  136    194   
    Ok(())
         195  +
    /* PythonServerModuleGenerator.kt:41 */
  137    196   
}

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

@@ -1,1 +725,739 @@
    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 `OperationWithNestedStructure`.
    3      4   
pub(crate) async fn operation_with_nested_structure(
    4      5   
    input: crate::input::OperationWithNestedStructureInput,
    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<
    8      9   
    crate::output::OperationWithNestedStructureOutput,
    9     10   
    crate::error::OperationWithNestedStructureError,
   10     11   
> {
   11     12   
    // Async block used to run the handler and catch any Python error.
   12     13   
    let result = if handler.is_coroutine {
   13     14   
        ::tracing::trace!(
   14     15   
            name = "operation_with_nested_structure",
   15     16   
            "executing python handler coroutine"
   16     17   
        );
   17     18   
        let result = ::pyo3::Python::with_gil(|py| {
   18     19   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   19     20   
            let coroutine = if handler.args == 1 {
   20     21   
                pyhandler.call1((input,))?
   21     22   
            } else {
   22     23   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   23     24   
            };
   24     25   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   25     26   
        })?;
   26     27   
        result.await.and_then(|r| {
   27     28   
            ::pyo3::Python::with_gil(|py| {
   28     29   
                r.extract::<crate::output::OperationWithNestedStructureOutput>(py)
   29     30   
            })
   30     31   
        })
   31     32   
    } else {
   32     33   
        ::tracing::trace!(
   33     34   
            name = "operation_with_nested_structure",
   34     35   
            "executing python handler function"
   35     36   
        );
   36     37   
        ::pyo3::Python::with_gil(|py| {
   37     38   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   38     39   
            let output = if handler.args == 1 {
   39     40   
                pyhandler.call1((input,))?
   40     41   
            } else {
   41     42   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   42     43   
            };
   43     44   
            output.extract::<crate::output::OperationWithNestedStructureOutput>()
   44     45   
        })
   45     46   
    };
   46     47   
    // Catch and record a Python traceback.
   47     48   
    result.map_err(|e| {
   48     49   
        let rich_py_err =
   49     50   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   50     51   
                e.clone_ref(py)
   51     52   
            }));
   52     53   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   53     54   
        e.into()
   54     55   
    })
   55     56   
}
   56     57   
          58  +
/* PythonServerOperationHandlerGenerator.kt:61 */
   57     59   
/// Python handler for operation `OperationWithRequiredMembers`.
   58     60   
pub(crate) async fn operation_with_required_members(
   59     61   
    input: crate::input::OperationWithRequiredMembersInput,
   60     62   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
   61     63   
    handler: ::aws_smithy_http_server_python::PyHandler,
   62     64   
) -> std::result::Result<
   63     65   
    crate::output::OperationWithRequiredMembersOutput,
   64     66   
    crate::error::OperationWithRequiredMembersError,
   65     67   
> {
   66     68   
    // Async block used to run the handler and catch any Python error.
   67     69   
    let result = if handler.is_coroutine {
   68     70   
        ::tracing::trace!(
   69     71   
            name = "operation_with_required_members",
   70     72   
            "executing python handler coroutine"
   71     73   
        );
   72     74   
        let result = ::pyo3::Python::with_gil(|py| {
   73     75   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   74     76   
            let coroutine = if handler.args == 1 {
   75     77   
                pyhandler.call1((input,))?
   76     78   
            } else {
   77     79   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   78     80   
            };
   79     81   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   80     82   
        })?;
   81     83   
        result.await.and_then(|r| {
   82     84   
            ::pyo3::Python::with_gil(|py| {
   83     85   
                r.extract::<crate::output::OperationWithRequiredMembersOutput>(py)
   84     86   
            })
   85     87   
        })
   86     88   
    } else {
   87     89   
        ::tracing::trace!(
   88     90   
            name = "operation_with_required_members",
   89     91   
            "executing python handler function"
   90     92   
        );
   91     93   
        ::pyo3::Python::with_gil(|py| {
   92     94   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   93     95   
            let output = if handler.args == 1 {
   94     96   
                pyhandler.call1((input,))?
   95     97   
            } else {
   96     98   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   97     99   
            };
   98    100   
            output.extract::<crate::output::OperationWithRequiredMembersOutput>()
   99    101   
        })
  100    102   
    };
  101    103   
    // Catch and record a Python traceback.
  102    104   
    result.map_err(|e| {
  103    105   
        let rich_py_err =
  104    106   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  105    107   
                e.clone_ref(py)
  106    108   
            }));
  107    109   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  108    110   
        e.into()
  109    111   
    })
  110    112   
}
  111    113   
         114  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  112    115   
/// Python handler for operation `OperationWithDefaults`.
  113    116   
pub(crate) async fn operation_with_defaults(
  114    117   
    input: crate::input::OperationWithDefaultsInput,
  115    118   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  116    119   
    handler: ::aws_smithy_http_server_python::PyHandler,
  117    120   
) -> std::result::Result<
  118    121   
    crate::output::OperationWithDefaultsOutput,
  119    122   
    crate::error::OperationWithDefaultsError,
  120    123   
> {
  121    124   
    // Async block used to run the handler and catch any Python error.
  122    125   
    let result = if handler.is_coroutine {
  123    126   
        ::tracing::trace!(
  124    127   
            name = "operation_with_defaults",
  125    128   
            "executing python handler coroutine"
  126    129   
        );
  127    130   
        let result = ::pyo3::Python::with_gil(|py| {
  128    131   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  129    132   
            let coroutine = if handler.args == 1 {
  130    133   
                pyhandler.call1((input,))?
  131    134   
            } else {
  132    135   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  133    136   
            };
  134    137   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  135    138   
        })?;
  136    139   
        result.await.and_then(|r| {
  137    140   
            ::pyo3::Python::with_gil(|py| {
  138    141   
                r.extract::<crate::output::OperationWithDefaultsOutput>(py)
  139    142   
            })
  140    143   
        })
  141    144   
    } else {
  142    145   
        ::tracing::trace!(
  143    146   
            name = "operation_with_defaults",
  144    147   
            "executing python handler function"
  145    148   
        );
  146    149   
        ::pyo3::Python::with_gil(|py| {
  147    150   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  148    151   
            let output = if handler.args == 1 {
  149    152   
                pyhandler.call1((input,))?
  150    153   
            } else {
  151    154   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  152    155   
            };
  153    156   
            output.extract::<crate::output::OperationWithDefaultsOutput>()
  154    157   
        })
  155    158   
    };
  156    159   
    // Catch and record a Python traceback.
  157    160   
    result.map_err(|e| {
  158    161   
        let rich_py_err =
  159    162   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  160    163   
                e.clone_ref(py)
  161    164   
            }));
  162    165   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  163    166   
        e.into()
  164    167   
    })
  165    168   
}
  166    169   
         170  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  167    171   
/// Python handler for operation `ContentTypeParameters`.
  168    172   
pub(crate) async fn content_type_parameters(
  169    173   
    input: crate::input::ContentTypeParametersInput,
  170    174   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  171    175   
    handler: ::aws_smithy_http_server_python::PyHandler,
  172    176   
) -> std::result::Result<
  173    177   
    crate::output::ContentTypeParametersOutput,
  174    178   
    crate::error::ContentTypeParametersError,
  175    179   
> {
  176    180   
    // Async block used to run the handler and catch any Python error.
  177    181   
    let result = if handler.is_coroutine {
  178    182   
        ::tracing::trace!(
  179    183   
            name = "content_type_parameters",
  180    184   
            "executing python handler coroutine"
  181    185   
        );
  182    186   
        let result = ::pyo3::Python::with_gil(|py| {
  183    187   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  184    188   
            let coroutine = if handler.args == 1 {
  185    189   
                pyhandler.call1((input,))?
  186    190   
            } else {
  187    191   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  188    192   
            };
  189    193   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  190    194   
        })?;
  191    195   
        result.await.and_then(|r| {
  192    196   
            ::pyo3::Python::with_gil(|py| {
  193    197   
                r.extract::<crate::output::ContentTypeParametersOutput>(py)
  194    198   
            })
  195    199   
        })
  196    200   
    } else {
  197    201   
        ::tracing::trace!(
  198    202   
            name = "content_type_parameters",
  199    203   
            "executing python handler function"
  200    204   
        );
  201    205   
        ::pyo3::Python::with_gil(|py| {
  202    206   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  203    207   
            let output = if handler.args == 1 {
  204    208   
                pyhandler.call1((input,))?
  205    209   
            } else {
  206    210   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  207    211   
            };
  208    212   
            output.extract::<crate::output::ContentTypeParametersOutput>()
  209    213   
        })
  210    214   
    };
  211    215   
    // Catch and record a Python traceback.
  212    216   
    result.map_err(|e| {
  213    217   
        let rich_py_err =
  214    218   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  215    219   
                e.clone_ref(py)
  216    220   
            }));
  217    221   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  218    222   
        e.into()
  219    223   
    })
  220    224   
}
  221    225   
         226  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  222    227   
/// Python handler for operation `PutWithContentEncoding`.
  223    228   
pub(crate) async fn put_with_content_encoding(
  224    229   
    input: crate::input::PutWithContentEncodingInput,
  225    230   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  226    231   
    handler: ::aws_smithy_http_server_python::PyHandler,
  227    232   
) -> std::result::Result<
  228    233   
    crate::output::PutWithContentEncodingOutput,
  229    234   
    crate::error::PutWithContentEncodingError,
  230    235   
> {
  231    236   
    // Async block used to run the handler and catch any Python error.
  232    237   
    let result = if handler.is_coroutine {
  233    238   
        ::tracing::trace!(
  234    239   
            name = "put_with_content_encoding",
  235    240   
            "executing python handler coroutine"
  236    241   
        );
  237    242   
        let result = ::pyo3::Python::with_gil(|py| {
  238    243   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  239    244   
            let coroutine = if handler.args == 1 {
  240    245   
                pyhandler.call1((input,))?
  241    246   
            } else {
  242    247   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  243    248   
            };
  244    249   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  245    250   
        })?;
  246    251   
        result.await.and_then(|r| {
  247    252   
            ::pyo3::Python::with_gil(|py| {
  248    253   
                r.extract::<crate::output::PutWithContentEncodingOutput>(py)
  249    254   
            })
  250    255   
        })
  251    256   
    } else {
  252    257   
        ::tracing::trace!(
  253    258   
            name = "put_with_content_encoding",
  254    259   
            "executing python handler function"
  255    260   
        );
  256    261   
        ::pyo3::Python::with_gil(|py| {
  257    262   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  258    263   
            let output = if handler.args == 1 {
  259    264   
                pyhandler.call1((input,))?
  260    265   
            } else {
  261    266   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  262    267   
            };
  263    268   
            output.extract::<crate::output::PutWithContentEncodingOutput>()
  264    269   
        })
  265    270   
    };
  266    271   
    // Catch and record a Python traceback.
  267    272   
    result.map_err(|e| {
  268    273   
        let rich_py_err =
  269    274   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  270    275   
                e.clone_ref(py)
  271    276   
            }));
  272    277   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  273    278   
        e.into()
  274    279   
    })
  275    280   
}
  276    281   
         282  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  277    283   
/// Python handler for operation `HostWithPathOperation`.
  278    284   
pub(crate) async fn host_with_path_operation(
  279    285   
    input: crate::input::HostWithPathOperationInput,
  280    286   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  281    287   
    handler: ::aws_smithy_http_server_python::PyHandler,
  282    288   
) -> std::result::Result<
  283    289   
    crate::output::HostWithPathOperationOutput,
  284    290   
    crate::error::HostWithPathOperationError,
  285    291   
> {
  286    292   
    // Async block used to run the handler and catch any Python error.
  287    293   
    let result = if handler.is_coroutine {
  288    294   
        ::tracing::trace!(
  289    295   
            name = "host_with_path_operation",
  290    296   
            "executing python handler coroutine"
  291    297   
        );
  292    298   
        let result = ::pyo3::Python::with_gil(|py| {
  293    299   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  294    300   
            let coroutine = if handler.args == 1 {
  295    301   
                pyhandler.call1((input,))?
  296    302   
            } else {
  297    303   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  298    304   
            };
  299    305   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  300    306   
        })?;
  301    307   
        result.await.and_then(|r| {
  302    308   
            ::pyo3::Python::with_gil(|py| {
  303    309   
                r.extract::<crate::output::HostWithPathOperationOutput>(py)
  304    310   
            })
  305    311   
        })
  306    312   
    } else {
  307    313   
        ::tracing::trace!(
  308    314   
            name = "host_with_path_operation",
  309    315   
            "executing python handler function"
  310    316   
        );
  311    317   
        ::pyo3::Python::with_gil(|py| {
  312    318   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  313    319   
            let output = if handler.args == 1 {
  314    320   
                pyhandler.call1((input,))?
  315    321   
            } else {
  316    322   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  317    323   
            };
  318    324   
            output.extract::<crate::output::HostWithPathOperationOutput>()
  319    325   
        })
  320    326   
    };
  321    327   
    // Catch and record a Python traceback.
  322    328   
    result.map_err(|e| {
  323    329   
        let rich_py_err =
  324    330   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  325    331   
                e.clone_ref(py)
  326    332   
            }));
  327    333   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  328    334   
        e.into()
  329    335   
    })
  330    336   
}
  331    337   
         338  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  332    339   
/// Python handler for operation `EndpointWithHostLabelOperation`.
  333    340   
pub(crate) async fn endpoint_with_host_label_operation(
  334    341   
    input: crate::input::EndpointWithHostLabelOperationInput,
  335    342   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  336    343   
    handler: ::aws_smithy_http_server_python::PyHandler,
  337    344   
) -> std::result::Result<
  338    345   
    crate::output::EndpointWithHostLabelOperationOutput,
  339    346   
    crate::error::EndpointWithHostLabelOperationError,
  340    347   
> {
  341    348   
    // Async block used to run the handler and catch any Python error.
  342    349   
    let result = if handler.is_coroutine {
  343    350   
        ::tracing::trace!(
  344    351   
            name = "endpoint_with_host_label_operation",
  345    352   
            "executing python handler coroutine"
  346    353   
        );
  347    354   
        let result = ::pyo3::Python::with_gil(|py| {
  348    355   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  349    356   
            let coroutine = if handler.args == 1 {
  350    357   
                pyhandler.call1((input,))?
  351    358   
            } else {
  352    359   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  353    360   
            };
  354    361   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  355    362   
        })?;
  356    363   
        result.await.and_then(|r| {
  357    364   
            ::pyo3::Python::with_gil(|py| {
  358    365   
                r.extract::<crate::output::EndpointWithHostLabelOperationOutput>(py)
  359    366   
            })
  360    367   
        })
  361    368   
    } else {
  362    369   
        ::tracing::trace!(
  363    370   
            name = "endpoint_with_host_label_operation",
  364    371   
            "executing python handler function"
  365    372   
        );
  366    373   
        ::pyo3::Python::with_gil(|py| {
  367    374   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  368    375   
            let output = if handler.args == 1 {
  369    376   
                pyhandler.call1((input,))?
  370    377   
            } else {
  371    378   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  372    379   
            };
  373    380   
            output.extract::<crate::output::EndpointWithHostLabelOperationOutput>()
  374    381   
        })
  375    382   
    };
  376    383   
    // Catch and record a Python traceback.
  377    384   
    result.map_err(|e| {
  378    385   
        let rich_py_err =
  379    386   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  380    387   
                e.clone_ref(py)
  381    388   
            }));
  382    389   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  383    390   
        e.into()
  384    391   
    })
  385    392   
}
  386    393   
         394  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  387    395   
/// Python handler for operation `EndpointOperation`.
  388    396   
pub(crate) async fn endpoint_operation(
  389    397   
    input: crate::input::EndpointOperationInput,
  390    398   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  391    399   
    handler: ::aws_smithy_http_server_python::PyHandler,
  392    400   
) -> std::result::Result<crate::output::EndpointOperationOutput, crate::error::EndpointOperationError>
  393    401   
{
  394    402   
    // Async block used to run the handler and catch any Python error.
  395    403   
    let result = if handler.is_coroutine {
  396    404   
        ::tracing::trace!(
  397    405   
            name = "endpoint_operation",
  398    406   
            "executing python handler coroutine"
  399    407   
        );
  400    408   
        let result = ::pyo3::Python::with_gil(|py| {
  401    409   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  402    410   
            let coroutine = if handler.args == 1 {
  403    411   
                pyhandler.call1((input,))?
  404    412   
            } else {
  405    413   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  406    414   
            };
  407    415   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  408    416   
        })?;
  409    417   
        result.await.and_then(|r| {
  410    418   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EndpointOperationOutput>(py))
  411    419   
        })
  412    420   
    } else {
  413    421   
        ::tracing::trace!(
  414    422   
            name = "endpoint_operation",
  415    423   
            "executing python handler function"
  416    424   
        );
  417    425   
        ::pyo3::Python::with_gil(|py| {
  418    426   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  419    427   
            let output = if handler.args == 1 {
  420    428   
                pyhandler.call1((input,))?
  421    429   
            } else {
  422    430   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  423    431   
            };
  424    432   
            output.extract::<crate::output::EndpointOperationOutput>()
  425    433   
        })
  426    434   
    };
  427    435   
    // Catch and record a Python traceback.
  428    436   
    result.map_err(|e| {
  429    437   
        let rich_py_err =
  430    438   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  431    439   
                e.clone_ref(py)
  432    440   
            }));
  433    441   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  434    442   
        e.into()
  435    443   
    })
  436    444   
}
  437    445   
         446  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  438    447   
/// Python handler for operation `JsonUnions`.
  439    448   
pub(crate) async fn json_unions(
  440    449   
    input: crate::input::JsonUnionsInput,
  441    450   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  442    451   
    handler: ::aws_smithy_http_server_python::PyHandler,
  443    452   
) -> std::result::Result<crate::output::JsonUnionsOutput, crate::error::JsonUnionsError> {
  444    453   
    // Async block used to run the handler and catch any Python error.
  445    454   
    let result = if handler.is_coroutine {
  446    455   
        ::tracing::trace!(name = "json_unions", "executing python handler coroutine");
  447    456   
        let result = ::pyo3::Python::with_gil(|py| {
  448    457   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  449    458   
            let coroutine = if handler.args == 1 {
  450    459   
                pyhandler.call1((input,))?
  451    460   
            } else {
  452    461   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  453    462   
            };
  454    463   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  455    464   
        })?;
  456    465   
        result.await.and_then(|r| {
  457    466   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonUnionsOutput>(py))
  458    467   
        })
  459    468   
    } else {
  460    469   
        ::tracing::trace!(name = "json_unions", "executing python handler function");
  461    470   
        ::pyo3::Python::with_gil(|py| {
  462    471   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  463    472   
            let output = if handler.args == 1 {
  464    473   
                pyhandler.call1((input,))?
  465    474   
            } else {
  466    475   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  467    476   
            };
  468    477   
            output.extract::<crate::output::JsonUnionsOutput>()
  469    478   
        })
  470    479   
    };
  471    480   
    // Catch and record a Python traceback.
  472    481   
    result.map_err(|e| {
  473    482   
        let rich_py_err =
  474    483   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  475    484   
                e.clone_ref(py)
  476    485   
            }));
  477    486   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  478    487   
        e.into()
  479    488   
    })
  480    489   
}
  481    490   
         491  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  482    492   
/// Python handler for operation `GreetingWithErrors`.
  483    493   
pub(crate) async fn greeting_with_errors(
  484    494   
    input: crate::input::GreetingWithErrorsInput,
  485    495   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  486    496   
    handler: ::aws_smithy_http_server_python::PyHandler,
  487    497   
) -> std::result::Result<
  488    498   
    crate::output::GreetingWithErrorsOutput,
  489    499   
    crate::error::GreetingWithErrorsError,
  490    500   
> {
  491    501   
    // Async block used to run the handler and catch any Python error.
  492    502   
    let result = if handler.is_coroutine {
  493    503   
        ::tracing::trace!(
  494    504   
            name = "greeting_with_errors",
  495    505   
            "executing python handler coroutine"
  496    506   
        );
  497    507   
        let result = ::pyo3::Python::with_gil(|py| {
  498    508   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  499    509   
            let coroutine = if handler.args == 1 {
  500    510   
                pyhandler.call1((input,))?
  501    511   
            } else {
  502    512   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  503    513   
            };
  504    514   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  505    515   
        })?;
  506    516   
        result.await.and_then(|r| {
  507    517   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GreetingWithErrorsOutput>(py))
  508    518   
        })
  509    519   
    } else {
  510    520   
        ::tracing::trace!(
  511    521   
            name = "greeting_with_errors",
  512    522   
            "executing python handler function"
  513    523   
        );
  514    524   
        ::pyo3::Python::with_gil(|py| {
  515    525   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  516    526   
            let output = if handler.args == 1 {
  517    527   
                pyhandler.call1((input,))?
  518    528   
            } else {
  519    529   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  520    530   
            };
  521    531   
            output.extract::<crate::output::GreetingWithErrorsOutput>()
  522    532   
        })
  523    533   
    };
  524    534   
    // Catch and record a Python traceback.
  525    535   
    result.map_err(|e| {
  526    536   
        let rich_py_err =
  527    537   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  528    538   
                e.clone_ref(py)
  529    539   
            }));
  530    540   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  531    541   
        e.into()
  532    542   
    })
  533    543   
}
  534    544   
         545  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  535    546   
/// Python handler for operation `SimpleScalarProperties`.
  536    547   
pub(crate) async fn simple_scalar_properties(
  537    548   
    input: crate::input::SimpleScalarPropertiesInput,
  538    549   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  539    550   
    handler: ::aws_smithy_http_server_python::PyHandler,
  540    551   
) -> std::result::Result<
  541    552   
    crate::output::SimpleScalarPropertiesOutput,
  542    553   
    crate::error::SimpleScalarPropertiesError,
  543    554   
> {
  544    555   
    // Async block used to run the handler and catch any Python error.
  545    556   
    let result = if handler.is_coroutine {
  546    557   
        ::tracing::trace!(
  547    558   
            name = "simple_scalar_properties",
  548    559   
            "executing python handler coroutine"
  549    560   
        );
  550    561   
        let result = ::pyo3::Python::with_gil(|py| {
  551    562   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  552    563   
            let coroutine = if handler.args == 1 {
  553    564   
                pyhandler.call1((input,))?
  554    565   
            } else {
  555    566   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  556    567   
            };
  557    568   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  558    569   
        })?;
  559    570   
        result.await.and_then(|r| {
  560    571   
            ::pyo3::Python::with_gil(|py| {
  561    572   
                r.extract::<crate::output::SimpleScalarPropertiesOutput>(py)
  562    573   
            })
  563    574   
        })
  564    575   
    } else {
  565    576   
        ::tracing::trace!(
  566    577   
            name = "simple_scalar_properties",
  567    578   
            "executing python handler function"
  568    579   
        );
  569    580   
        ::pyo3::Python::with_gil(|py| {
  570    581   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  571    582   
            let output = if handler.args == 1 {
  572    583   
                pyhandler.call1((input,))?
  573    584   
            } else {
  574    585   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  575    586   
            };
  576    587   
            output.extract::<crate::output::SimpleScalarPropertiesOutput>()
  577    588   
        })
  578    589   
    };
  579    590   
    // Catch and record a Python traceback.
  580    591   
    result.map_err(|e| {
  581    592   
        let rich_py_err =
  582    593   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  583    594   
                e.clone_ref(py)
  584    595   
            }));
  585    596   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  586    597   
        e.into()
  587    598   
    })
  588    599   
}
  589    600   
         601  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  590    602   
/// Python handler for operation `EmptyInputAndEmptyOutput`.
  591    603   
pub(crate) async fn empty_input_and_empty_output(
  592    604   
    input: crate::input::EmptyInputAndEmptyOutputInput,
  593    605   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  594    606   
    handler: ::aws_smithy_http_server_python::PyHandler,
  595    607   
) -> std::result::Result<
  596    608   
    crate::output::EmptyInputAndEmptyOutputOutput,
  597    609   
    crate::error::EmptyInputAndEmptyOutputError,
  598    610   
> {
  599    611   
    // Async block used to run the handler and catch any Python error.
  600    612   
    let result = if handler.is_coroutine {
  601    613   
        ::tracing::trace!(
  602    614   
            name = "empty_input_and_empty_output",
  603    615   
            "executing python handler coroutine"
  604    616   
        );
  605    617   
        let result = ::pyo3::Python::with_gil(|py| {
  606    618   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  607    619   
            let coroutine = if handler.args == 1 {
  608    620   
                pyhandler.call1((input,))?
  609    621   
            } else {
  610    622   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  611    623   
            };
  612    624   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  613    625   
        })?;
  614    626   
        result.await.and_then(|r| {
  615    627   
            ::pyo3::Python::with_gil(|py| {
  616    628   
                r.extract::<crate::output::EmptyInputAndEmptyOutputOutput>(py)
  617    629   
            })
  618    630   
        })
  619    631   
    } else {
  620    632   
        ::tracing::trace!(
  621    633   
            name = "empty_input_and_empty_output",
  622    634   
            "executing python handler function"
  623    635   
        );
  624    636   
        ::pyo3::Python::with_gil(|py| {
  625    637   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  626    638   
            let output = if handler.args == 1 {
  627    639   
                pyhandler.call1((input,))?
  628    640   
            } else {
  629    641   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  630    642   
            };
  631    643   
            output.extract::<crate::output::EmptyInputAndEmptyOutputOutput>()
  632    644   
        })
  633    645   
    };
  634    646   
    // Catch and record a Python traceback.
  635    647   
    result.map_err(|e| {
  636    648   
        let rich_py_err =
  637    649   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  638    650   
                e.clone_ref(py)
  639    651   
            }));
  640    652   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  641    653   
        e.into()
  642    654   
    })
  643    655   
}
  644    656   
         657  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  645    658   
/// Python handler for operation `NoInputAndOutput`.
  646    659   
pub(crate) async fn no_input_and_output(
  647    660   
    input: crate::input::NoInputAndOutputInput,
  648    661   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  649    662   
    handler: ::aws_smithy_http_server_python::PyHandler,
  650    663   
) -> std::result::Result<crate::output::NoInputAndOutputOutput, crate::error::NoInputAndOutputError>
  651    664   
{
  652    665   
    // Async block used to run the handler and catch any Python error.
  653    666   
    let result = if handler.is_coroutine {
  654    667   
        ::tracing::trace!(
  655    668   
            name = "no_input_and_output",
  656    669   
            "executing python handler coroutine"
  657    670   
        );
  658    671   
        let result = ::pyo3::Python::with_gil(|py| {
  659    672   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  660    673   
            let coroutine = if handler.args == 1 {
  661    674   
                pyhandler.call1((input,))?
  662    675   
            } else {
  663    676   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  664    677   
            };
  665    678   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  666    679   
        })?;
  667    680   
        result.await.and_then(|r| {
  668    681   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NoInputAndOutputOutput>(py))
  669    682   
        })
  670    683   
    } else {
  671    684   
        ::tracing::trace!(
  672    685   
            name = "no_input_and_output",
  673    686   
            "executing python handler function"
  674    687   
        );
  675    688   
        ::pyo3::Python::with_gil(|py| {
  676    689   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  677    690   
            let output = if handler.args == 1 {
  678    691   
                pyhandler.call1((input,))?
  679    692   
            } else {
  680    693   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  681    694   
            };
  682    695   
            output.extract::<crate::output::NoInputAndOutputOutput>()
  683    696   
        })
  684    697   
    };
  685    698   
    // Catch and record a Python traceback.
  686    699   
    result.map_err(|e| {
  687    700   
        let rich_py_err =
  688    701   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  689    702   
                e.clone_ref(py)
  690    703   
            }));
  691    704   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  692    705   
        e.into()
  693    706   
    })
  694    707   
}
  695    708   
         709  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  696    710   
/// Python handler for operation `NoInputAndNoOutput`.
  697    711   
pub(crate) async fn no_input_and_no_output(
  698    712   
    input: crate::input::NoInputAndNoOutputInput,
  699    713   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  700    714   
    handler: ::aws_smithy_http_server_python::PyHandler,
  701    715   
) -> std::result::Result<
  702    716   
    crate::output::NoInputAndNoOutputOutput,
  703    717   
    crate::error::NoInputAndNoOutputError,
  704    718   
> {
  705    719   
    // Async block used to run the handler and catch any Python error.