Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_sparse_length_map.rs

@@ -1,1 +53,80 @@
    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_sparse_length_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained>,
    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:478 */
   30     46   
                        map.insert(key, value);
          47  +
                        /* JsonParserGenerator.kt:686 */
   31     48   
                    }
          49  +
                    /* JsonParserGenerator.kt:695 */
   32     50   
                    other => {
   33     51   
                        return Err(
   34     52   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35     53   
                                format!("expected object key or end object, found: {:?}", other),
   36     54   
                            ),
   37     55   
                        )
   38         -
                    }
          56  +
                    } /* JsonParserGenerator.kt:685 */
   39     57   
                }
          58  +
                /* JsonParserGenerator.kt:684 */
   40     59   
            }
          60  +
            /* JsonParserGenerator.kt:502 */
   41     61   
            Ok(Some(
   42     62   
                crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained(
   43     63   
                    map,
   44     64   
                ),
   45     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   46     67   
        }
   47         -
        _ => Err(
   48         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   49         -
                "expected start object or null",
   50         -
            ),
   51         -
        ),
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
          72  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                    "expected start object or null",
          74  +
                ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   52     78   
    }
          79  +
    /* JsonParserGenerator.kt:460 */
   53     80   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_sparse_list.rs

@@ -1,1 +47,72 @@
    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_sparse_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::sparse_list_unconstrained::SparseListUnconstrained>,
    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   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:415 */
   27     38   
                        items.push(
          39  +
                            /* JsonParserGenerator.kt:354 */
   28     40   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29     41   
                                tokens.next(),
   30     42   
                            )?
   31         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                            .transpose()?,
          43  +
                            .map(|s|
          44  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          45  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          46  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          47  +
                            .transpose()?, /* JsonParserGenerator.kt:415 */
   33     48   
                        );
   34         -
                    }
          49  +
                        /* JsonParserGenerator.kt:413 */
          50  +
                    } /* JsonParserGenerator.kt:409 */
   35     51   
                }
          52  +
                /* JsonParserGenerator.kt:408 */
   36     53   
            }
          54  +
            /* JsonParserGenerator.kt:444 */
   37     55   
            Ok(Some(
   38     56   
                crate::unconstrained::sparse_list_unconstrained::SparseListUnconstrained(items),
   39     57   
            ))
          58  +
            /* JsonParserGenerator.kt:713 */
   40     59   
        }
   41         -
        _ => Err(
   42         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
                "expected start array or null",
   44         -
            ),
   45         -
        ),
          60  +
        /* JsonParserGenerator.kt:722 */
          61  +
        _ => {
          62  +
            /* JsonParserGenerator.kt:723 */
          63  +
            Err(
          64  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          65  +
                    "expected start array or null",
          66  +
                ),
          67  +
            )
          68  +
            /* JsonParserGenerator.kt:722 */
          69  +
        } /* JsonParserGenerator.kt:712 */
   46     70   
    }
          71  +
    /* JsonParserGenerator.kt:398 */
   47     72   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_sparse_map.rs

@@ -1,1 +50,74 @@
    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_sparse_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::sparse_map_unconstrained::SparseMapUnconstrained>,
    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())?;
          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 */
   25     38   
                        let value =
   26         -
                            crate::protocol_serde::shape_unique_items_list::de_unique_items_list(
   27         -
                                tokens,
   28         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_unique_items_list::de_unique_items_list(tokens)?
          40  +
                        /* JsonParserGenerator.kt:474 */;
          41  +
                        /* JsonParserGenerator.kt:478 */
   29     42   
                        map.insert(key, value);
          43  +
                        /* JsonParserGenerator.kt:686 */
   30     44   
                    }
          45  +
                    /* JsonParserGenerator.kt:695 */
   31     46   
                    other => {
   32     47   
                        return Err(
   33     48   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34     49   
                                format!("expected object key or end object, found: {:?}", other),
   35     50   
                            ),
   36     51   
                        )
   37         -
                    }
          52  +
                    } /* JsonParserGenerator.kt:685 */
   38     53   
                }
          54  +
                /* JsonParserGenerator.kt:684 */
   39     55   
            }
          56  +
            /* JsonParserGenerator.kt:502 */
   40     57   
            Ok(Some(
   41     58   
                crate::unconstrained::sparse_map_unconstrained::SparseMapUnconstrained(map),
   42     59   
            ))
          60  +
            /* JsonParserGenerator.kt:713 */
   43     61   
        }
   44         -
        _ => Err(
   45         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
                "expected start object or null",
   47         -
            ),
   48         -
        ),
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
          66  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          67  +
                    "expected start object or null",
          68  +
                ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   49     72   
    }
          73  +
    /* JsonParserGenerator.kt:460 */
   50     74   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_streaming_blob_operation.rs

@@ -1,1 +91,128 @@
    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_streaming_blob_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::StreamingBlobOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     14   
    B::Data: Send,
   13     15   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14     16   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   15     17   
{
          18  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   16     19   
    Ok({
          20  +
        /* RustType.kt:516 */
   17     21   
        #[allow(unused_mut)]
          22  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   18     23   
        let mut input = crate::input::streaming_blob_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   23     31   
        if let Some(value) = {
   24     32   
            Some(crate::protocol_serde::shape_streaming_blob_operation_input::de_streaming_blob_payload(&mut body.into().into_inner())?)
   25     33   
        } {
   26     34   
            input = input.set_streaming_blob(value)
   27     35   
        }
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   28     37   
        input.build()
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   29     39   
    })
          40  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   30     41   
}
   31     42   
          43  +
/* RustType.kt:516 */
   32     44   
#[allow(clippy::unnecessary_wraps)]
          45  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   33     46   
pub fn ser_streaming_blob_operation_http_response(
   34     47   
    #[allow(unused_variables)] output: crate::output::StreamingBlobOperationOutput,
   35     48   
) -> std::result::Result<
   36     49   
    ::aws_smithy_http_server::response::Response,
   37     50   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   38     51   
> {
          52  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   39     53   
    Ok({
          54  +
        /* RustType.kt:516 */
   40     55   
        #[allow(unused_mut)]
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   41     57   
        let mut builder = ::http::Response::builder();
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   42     59   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   43     60   
            builder,
   44     61   
            ::http::header::CONTENT_TYPE,
   45     62   
            "application/octet-stream",
   46     63   
        );
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   47     65   
        let http_status: u16 = 200;
   48     66   
        builder = builder.status(http_status);
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */
   49     68   
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::Body::wrap_stream(
   50         -
            crate::protocol_serde::shape_streaming_blob_operation_output::ser_streaming_blob_http_payload( output.streaming_blob)?
   51         -
        ));
          69  +
            /* HttpBoundProtocolPayloadGenerator.kt:350 */crate::protocol_serde::shape_streaming_blob_operation_output::ser_streaming_blob_http_payload( output.streaming_blob)?
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:543 */));
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   52     72   
        builder.body(body)?
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     74   
    })
          75  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   54     76   
}
   55     77   
          78  +
/* RustType.kt:516 */
   56     79   
#[allow(clippy::unnecessary_wraps)]
          80  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   57     81   
pub fn ser_streaming_blob_operation_http_error(
   58     82   
    error: &crate::error::StreamingBlobOperationError,
   59     83   
) -> std::result::Result<
   60     84   
    ::aws_smithy_http_server::response::Response,
   61     85   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   62     86   
> {
          87  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   63     88   
    Ok({
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   64     90   
        match error {
          91  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   65     92   
            crate::error::StreamingBlobOperationError::InternalServerError(output) => {
          93  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   66     94   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          95  +
                /* RustType.kt:516 */
   67     96   
                #[allow(unused_mut)]
          97  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   68     98   
                let mut builder = ::http::Response::builder();
          99  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   69    100   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   70    101   
                    builder,
   71    102   
                    ::http::header::CONTENT_TYPE,
   72    103   
                    "application/octet-stream",
   73    104   
                );
         105  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   74    106   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   75    107   
                    builder,
   76    108   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   77    109   
                    "InternalServerError",
   78    110   
                );
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   79    112   
                let content_length = payload.len();
   80    113   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81    114   
                    builder,
   82    115   
                    ::http::header::CONTENT_LENGTH,
   83    116   
                    content_length,
   84    117   
                );
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   85    119   
                builder
   86    120   
                    .status(500)
   87    121   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   88         -
            }
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         123  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   89    124   
        }
         125  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   90    126   
    })
         127  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   91    128   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_streaming_blob_operation_input.rs

@@ -1,1 +13,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_streaming_blob_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<
    5      6   
    ::aws_smithy_http_server_python::types::ByteStream,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
    8         -
    // replace the body with an empty body
           9  +
    /* HttpBindingGenerator.kt:299 */// replace the body with an empty body
    9     10   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     11   
    Ok(::aws_smithy_http_server_python::types::ByteStream::new(
   11     12   
        body,
   12     13   
    ))
          14  +
    /* HttpBindingGenerator.kt:230 */
   13     15   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_streaming_blob_operation_output.rs

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

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_transitively_constrained_structure_in_output.rs

@@ -1,1 +10,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_transitively_constrained_structure_in_output(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::TransitivelyConstrainedStructureInOutput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.length_string {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("lengthString").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_unique_items_list.rs

@@ -1,1 +56,82 @@
    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_unique_items_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained>,
    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:444 */
   44     63   
            Ok(Some(
   45     64   
                crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained(
   46     65   
                    items,
   47     66   
                ),
   48     67   
            ))
          68  +
            /* JsonParserGenerator.kt:713 */
   49     69   
        }
   50         -
        _ => Err(
   51         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   52         -
                "expected start array or null",
   53         -
            ),
   54         -
        ),
          70  +
        /* JsonParserGenerator.kt:722 */
          71  +
        _ => {
          72  +
            /* JsonParserGenerator.kt:723 */
          73  +
            Err(
          74  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          75  +
                    "expected start array or null",
          76  +
                ),
          77  +
            )
          78  +
            /* JsonParserGenerator.kt:722 */
          79  +
        } /* JsonParserGenerator.kt:712 */
   55     80   
    }
          81  +
    /* JsonParserGenerator.kt:398 */
   56     82   
}

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

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

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

@@ -1,1 +141,159 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
    3         -
pub struct EventStreamsOperationOutputEventsEventStreamSender {
           4  +
pub /* PythonServerEventStreamWrapperGenerator.kt:104 */ struct EventStreamsOperationOutputEventsEventStreamSender
           5  +
{
           6  +
    /* PythonServerEventStreamWrapperGenerator.kt:105 */
    4      7   
    inner: ::std::sync::Arc<
    5      8   
        ::parking_lot::Mutex<
    6      9   
            ::std::option::Option<
    7     10   
                ::aws_smithy_http::event_stream::EventStreamSender<
    8     11   
                    crate::model::Event,
    9     12   
                    crate::error::EventError,
   10     13   
                >,
   11     14   
            >,
   12     15   
        >,
   13         -
    >,
          16  +
    >, /* PythonServerEventStreamWrapperGenerator.kt:104 */
   14     17   
}
          18  +
/* PythonServerEventStreamWrapperGenerator.kt:112 */
   15     19   
impl EventStreamsOperationOutputEventsEventStreamSender {
          20  +
    /* PythonServerEventStreamWrapperGenerator.kt:113 */
   16     21   
    pub fn into_body_stream(
   17     22   
        self,
   18     23   
        marshaller: impl ::aws_smithy_eventstream::frame::MarshallMessage<Input = crate::model::Event>
   19     24   
            + ::std::marker::Send
   20     25   
            + ::std::marker::Sync
   21     26   
            + 'static,
   22     27   
        error_marshaller: impl ::aws_smithy_eventstream::frame::MarshallMessage<Input = crate::error::EventError>
   23     28   
            + ::std::marker::Send
   24     29   
            + ::std::marker::Sync
   25     30   
            + 'static,
   26     31   
        signer: impl ::aws_smithy_eventstream::frame::SignMessage
   27     32   
            + ::std::marker::Send
   28     33   
            + ::std::marker::Sync
   29     34   
            + 'static,
   30     35   
    ) -> ::aws_smithy_http::event_stream::MessageStreamAdapter<
   31     36   
        crate::model::Event,
   32     37   
        crate::error::EventError,
   33     38   
    > {
   34     39   
        let mut inner = self.inner.lock();
   35     40   
        let inner = inner.take().expect(
   36     41   
                            "attempted to reuse an event stream. \
   37     42   
                             that means you kept a reference to an event stream and tried to reuse it in another request, \
   38     43   
                             event streams are request scoped and shouldn't be used outside of their bounded request scope"
   39     44   
                        );
   40     45   
        inner.into_body_stream(marshaller, error_marshaller, signer)
   41     46   
    }
          47  +
    /* PythonServerEventStreamWrapperGenerator.kt:112 */
   42     48   
}
          49  +
/* PythonServerEventStreamWrapperGenerator.kt:135 */
   43     50   
impl<'source> ::pyo3::FromPyObject<'source> for EventStreamsOperationOutputEventsEventStreamSender {
   44     51   
    fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   45     52   
        use ::tokio_stream::StreamExt;
   46     53   
        let stream = ::pyo3_asyncio::tokio::into_stream_v1(obj)?;
   47     54   
        let stream = stream.filter_map(|res| {
   48     55   
                        ::pyo3::Python::with_gil(|py| {
   49     56   
                            // TODO(EventStreamImprovements): Add `InternalServerError` variant to all event streaming
   50     57   
                            //                                errors and return that variant in case of errors here?
   51     58   
                            match res {
   52     59   
                                Ok(obj) => {
   53     60   
                                    match obj.extract::<crate::model::Event>(py) {
   54     61   
                                        Ok(it) => Some(Ok(it)),
   55     62   
                                        Err(err) => {
   56     63   
                                            let rich_py_err = ::aws_smithy_http_server_python::rich_py_err(err);
   57     64   
                                            ::tracing::error!(error = ?rich_py_err, "could not extract the output type 'crate::model::Event' from streamed value");
   58     65   
                                            None
   59     66   
                                        },
   60     67   
                                    }
   61     68   
                                },
   62     69   
                                Err(err) => {
   63     70   
                                    match ::pyo3::IntoPy::into_py(err, py).extract::<crate::error::EventError>(py) {
   64     71   
                                        Ok(modelled_error) => Some(Err(modelled_error)),
   65     72   
                                        Err(err) => {
   66     73   
                                            let rich_py_err = ::aws_smithy_http_server_python::rich_py_err(err);
   67     74   
                                            ::tracing::error!(error = ?rich_py_err, "could not extract the error type 'crate::error::EventError' from raised exception");
   68     75   
                                            None
   69     76   
                                        }
   70     77   
                                    }
   71     78   
                                }
   72     79   
                            }
   73     80   
                        })
   74     81   
                    });
   75     82   
   76     83   
        Ok(EventStreamsOperationOutputEventsEventStreamSender {
   77     84   
            inner: ::std::sync::Arc::new(::parking_lot::Mutex::new(Some(stream.into()))),
   78     85   
        })
   79     86   
    }
   80     87   
}
   81     88   
   82     89   
impl ::pyo3::IntoPy<::pyo3::PyObject> for EventStreamsOperationOutputEventsEventStreamSender {
   83     90   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   84     91   
        ::pyo3::exceptions::PyAttributeError::new_err("this is a write-only object").into_py(py)
   85     92   
    }
   86     93   
}
   87     94   
          95  +
/* RustType.kt:516 */
   88     96   
#[::pyo3::pyclass]
          97  +
/* RustType.kt:516 */
   89     98   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   90         -
pub struct EventStreamsOperationInputEventsReceiver {
          99  +
pub /* PythonServerEventStreamWrapperGenerator.kt:190 */ struct EventStreamsOperationInputEventsReceiver
         100  +
{
         101  +
    /* PythonServerEventStreamWrapperGenerator.kt:191 */
   91    102   
    inner: ::std::sync::Arc<
   92    103   
        ::tokio::sync::Mutex<
   93    104   
            ::aws_smithy_http::event_stream::Receiver<
   94    105   
                crate::model::Event,
   95    106   
                crate::error::EventError,
   96    107   
            >,
   97    108   
        >,
   98         -
    >,
         109  +
    >, /* PythonServerEventStreamWrapperGenerator.kt:190 */
   99    110   
}
         111  +
/* PythonServerEventStreamWrapperGenerator.kt:198 */
  100    112   
impl EventStreamsOperationInputEventsReceiver {
         113  +
    /* PythonServerEventStreamWrapperGenerator.kt:199 */
  101    114   
    pub fn new(
  102    115   
        unmarshaller: impl ::aws_smithy_eventstream::frame::UnmarshallMessage<
  103    116   
                Output = crate::model::Event,
  104    117   
                Error = crate::error::EventError,
  105    118   
            > + ::std::marker::Send
  106    119   
            + ::std::marker::Sync
  107    120   
            + 'static,
  108    121   
        body: ::aws_smithy_types::body::SdkBody,
  109    122   
    ) -> EventStreamsOperationInputEventsReceiver {
  110    123   
        let inner = ::aws_smithy_http::event_stream::Receiver::new(unmarshaller, body);
  111    124   
        let inner = ::std::sync::Arc::new(::tokio::sync::Mutex::new(inner));
  112    125   
        EventStreamsOperationInputEventsReceiver { inner }
  113    126   
    }
         127  +
    /* PythonServerEventStreamWrapperGenerator.kt:198 */
  114    128   
}
         129  +
/* RustType.kt:516 */
  115    130   
#[::pyo3::pymethods]
         131  +
/* PythonServerEventStreamWrapperGenerator.kt:216 */
  116    132   
impl EventStreamsOperationInputEventsReceiver {
         133  +
    /* PythonServerEventStreamWrapperGenerator.kt:217 */
  117    134   
    pub fn __aiter__(slf: ::pyo3::PyRef<Self>) -> ::pyo3::PyRef<Self> {
  118    135   
        slf
  119    136   
    }
  120    137   
  121    138   
    pub fn __anext__(slf: ::pyo3::PyRefMut<Self>) -> ::pyo3::PyResult<Option<::pyo3::PyObject>> {
  122    139   
        let body = slf.inner.clone();
  123    140   
        let fut = ::pyo3_asyncio::tokio::future_into_py(slf.py(), async move {
  124    141   
            let mut inner = body.lock().await;
  125    142   
            let next = inner.recv().await;
  126    143   
            match next {
  127    144   
                Ok(Some(data)) => Ok(::pyo3::Python::with_gil(|py| {
  128    145   
                    ::pyo3::IntoPy::into_py(data, py)
  129    146   
                })),
  130    147   
                Ok(None) => Err(::pyo3::exceptions::PyStopAsyncIteration::new_err(
  131    148   
                    "stream exhausted",
  132    149   
                )),
  133    150   
                Err(::aws_smithy_runtime_api::client::result::SdkError::ServiceError(
  134    151   
                    service_err,
  135    152   
                )) => Err(service_err.into_err().into()),
  136    153   
                Err(err) => Err(::pyo3::exceptions::PyRuntimeError::new_err(err.to_string())),
  137    154   
            }
  138    155   
        })?;
  139    156   
        Ok(Some(fut.into()))
  140    157   
    }
         158  +
    /* PythonServerEventStreamWrapperGenerator.kt:216 */
  141    159   
}

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

@@ -1,1 +157,227 @@
    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 = "constraints")]
           4  +
#[pyo3(name = "constraints")]
    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::EventStreamErrorMessage>()?;
          14  +
    /* PythonServerModuleGenerator.kt:96 */
   10     15   
    error.add_class::<crate::error::ValidationException>()?;
          16  +
    /* PythonServerModuleGenerator.kt:79 */
   11     17   
    let model = ::pyo3::types::PyModule::new(py, "model")?;
          18  +
    /* PythonServerModuleGenerator.kt:96 */
   12     19   
    model.add_class::<crate::model::ValidationExceptionField>()?;
          20  +
    /* PythonServerModuleGenerator.kt:96 */
   13     21   
    output.add_class::<crate::output::EventStreamsOperationOutput>()?;
          22  +
    /* PythonServerModuleGenerator.kt:89 */
   14     23   
    model.add_class::<crate::model::PyUnionMarkerEvent>()?;
          24  +
    /* PythonServerModuleGenerator.kt:96 */
   15     25   
    model.add_class::<crate::model::EventStreamRegularMessage>()?;
          26  +
    /* PythonServerModuleGenerator.kt:96 */
   16     27   
    input.add_class::<crate::input::EventStreamsOperationInput>()?;
          28  +
    /* PythonServerModuleGenerator.kt:96 */
   17     29   
    output.add_class::<crate::output::StreamingBlobOperationOutput>()?;
          30  +
    /* PythonServerModuleGenerator.kt:96 */
   18     31   
    input.add_class::<crate::input::StreamingBlobOperationInput>()?;
          32  +
    /* PythonServerModuleGenerator.kt:96 */
   19     33   
    output.add_class::<crate::output::NonStreamingBlobOperationOutput>()?;
          34  +
    /* PythonServerModuleGenerator.kt:96 */
   20     35   
    input.add_class::<crate::input::NonStreamingBlobOperationInput>()?;
          36  +
    /* PythonServerModuleGenerator.kt:96 */
   21     37   
    output.add_class::<crate::output::QueryParamsTargetingMapOfEnumStringOperationOutput>()?;
          38  +
    /* PythonServerModuleGenerator.kt:96 */
   22     39   
    model.add_class::<crate::model::EnumString>()?;
          40  +
    /* PythonServerModuleGenerator.kt:96 */
   23     41   
    input.add_class::<crate::input::QueryParamsTargetingMapOfEnumStringOperationInput>()?;
          42  +
    /* PythonServerModuleGenerator.kt:96 */
   24     43   
    output.add_class::<crate::output::HttpPrefixHeadersTargetingLengthMapOperationOutput>()?;
          44  +
    /* PythonServerModuleGenerator.kt:96 */
   25     45   
    input.add_class::<crate::input::HttpPrefixHeadersTargetingLengthMapOperationInput>()?;
          46  +
    /* PythonServerModuleGenerator.kt:96 */
   26     47   
    output.add_class::<crate::output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput>()?;
          48  +
    /* PythonServerModuleGenerator.kt:96 */
   27     49   
    input.add_class::<crate::input::QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput>()?;
          50  +
    /* PythonServerModuleGenerator.kt:96 */
   28     51   
    output
   29     52   
        .add_class::<crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput>(
   30     53   
        )?;
          54  +
    /* PythonServerModuleGenerator.kt:96 */
   31     55   
    input
   32     56   
        .add_class::<crate::input::QueryParamsTargetingMapOfLengthPatternStringOperationInput>()?;
          57  +
    /* PythonServerModuleGenerator.kt:96 */
   33     58   
    output
   34     59   
        .add_class::<crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput>(
   35     60   
        )?;
          61  +
    /* PythonServerModuleGenerator.kt:96 */
   36     62   
    input
   37     63   
        .add_class::<crate::input::QueryParamsTargetingMapOfListOfPatternStringOperationInput>()?;
          64  +
    /* PythonServerModuleGenerator.kt:96 */
   38     65   
    output.add_class::<crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput>()?;
          66  +
    /* PythonServerModuleGenerator.kt:96 */
   39     67   
    input.add_class::<crate::input::QueryParamsTargetingMapOfPatternStringOperationInput>()?;
          68  +
    /* PythonServerModuleGenerator.kt:96 */
   40     69   
    output
   41     70   
        .add_class::<crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput>()?;
          71  +
    /* PythonServerModuleGenerator.kt:96 */
   42     72   
    input.add_class::<crate::input::QueryParamsTargetingMapOfListOfEnumStringOperationInput>()?;
          73  +
    /* PythonServerModuleGenerator.kt:96 */
   43     74   
    output.add_class::<crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput>()?;
          75  +
    /* PythonServerModuleGenerator.kt:96 */
   44     76   
    input.add_class::<crate::input::QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput>()?;
          77  +
    /* PythonServerModuleGenerator.kt:96 */
   45     78   
    output
   46     79   
        .add_class::<crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput>()?;
          80  +
    /* PythonServerModuleGenerator.kt:96 */
   47     81   
    input.add_class::<crate::input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput>()?;
          82  +
    /* PythonServerModuleGenerator.kt:96 */
   48     83   
    output
   49     84   
        .add_class::<crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput>()?;
          85  +
    /* PythonServerModuleGenerator.kt:96 */
   50     86   
    input.add_class::<crate::input::QueryParamsTargetingMapOfListOfLengthStringOperationInput>()?;
          87  +
    /* PythonServerModuleGenerator.kt:96 */
   51     88   
    output.add_class::<crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput>()?;
          89  +
    /* PythonServerModuleGenerator.kt:96 */
   52     90   
    input.add_class::<crate::input::QueryParamsTargetingMapOfLengthStringOperationInput>()?;
          91  +
    /* PythonServerModuleGenerator.kt:96 */
   53     92   
    output.add_class::<crate::output::QueryParamsTargetingLengthMapOperationOutput>()?;
          93  +
    /* PythonServerModuleGenerator.kt:96 */
   54     94   
    input.add_class::<crate::input::QueryParamsTargetingLengthMapOperationInput>()?;
          95  +
    /* PythonServerModuleGenerator.kt:96 */
   55     96   
    output.add_class::<crate::output::ConstrainedRecursiveShapesOperationOutput>()?;
          97  +
    /* PythonServerModuleGenerator.kt:96 */
   56     98   
    model.add_class::<crate::model::RecursiveShapesInputOutputNested1>()?;
          99  +
    /* PythonServerModuleGenerator.kt:96 */
   57    100   
    model.add_class::<crate::model::RecursiveShapesInputOutputNested2>()?;
         101  +
    /* PythonServerModuleGenerator.kt:96 */
   58    102   
    input.add_class::<crate::input::ConstrainedRecursiveShapesOperationInput>()?;
         103  +
    /* PythonServerModuleGenerator.kt:96 */
   59    104   
    output.add_class::<crate::output::ConstrainedHttpPayloadBoundShapeOperationOutput>()?;
         105  +
    /* PythonServerModuleGenerator.kt:96 */
   60    106   
    model.add_class::<crate::model::ConA>()?;
         107  +
    /* PythonServerModuleGenerator.kt:89 */
   61    108   
    model.add_class::<crate::model::PyUnionMarkerConstrainedUnion>()?;
         109  +
    /* PythonServerModuleGenerator.kt:96 */
   62    110   
    model.add_class::<crate::model::ConB>()?;
         111  +
    /* PythonServerModuleGenerator.kt:96 */
   63    112   
    model.add_class::<crate::model::SensitiveStructure>()?;
         113  +
    /* PythonServerModuleGenerator.kt:96 */
   64    114   
    input.add_class::<crate::input::ConstrainedHttpPayloadBoundShapeOperationInput>()?;
         115  +
    /* PythonServerModuleGenerator.kt:96 */
   65    116   
    output.add_class::<crate::output::ConstrainedHttpBoundShapesOperationOutput>()?;
         117  +
    /* PythonServerModuleGenerator.kt:96 */
   66    118   
    input.add_class::<crate::input::ConstrainedHttpBoundShapesOperationInput>()?;
         119  +
    /* PythonServerModuleGenerator.kt:96 */
   67    120   
    output.add_class::<crate::output::ConstrainedShapesOnlyInOutputOperationOutput>()?;
         121  +
    /* PythonServerModuleGenerator.kt:89 */
   68    122   
    model.add_class::<crate::model::PyUnionMarkerConstrainedUnionInOutput>()?;
         123  +
    /* PythonServerModuleGenerator.kt:96 */
   69    124   
    model.add_class::<crate::model::TransitivelyConstrainedStructureInOutput>()?;
         125  +
    /* PythonServerModuleGenerator.kt:96 */
   70    126   
    input.add_class::<crate::input::ConstrainedShapesOnlyInOutputOperationInput>()?;
         127  +
    /* PythonServerModuleGenerator.kt:96 */
   71    128   
    output.add_class::<crate::output::ConstrainedShapesOperationOutput>()?;
         129  +
    /* PythonServerModuleGenerator.kt:96 */
   72    130   
    input.add_class::<crate::input::ConstrainedShapesOperationInput>()?;
         131  +
    /* PythonServerModuleGenerator.kt:105 */
   73    132   
    ::pyo3::py_run!(
   74    133   
        py,
   75    134   
        input,
   76    135   
        "import sys; sys.modules['constraints.input'] = input"
   77    136   
    );
   78    137   
    m.add_submodule(input)?;
   79    138   
    ::pyo3::py_run!(
   80    139   
        py,
   81    140   
        output,
   82    141   
        "import sys; sys.modules['constraints.output'] = output"
   83    142   
    );
   84    143   
    m.add_submodule(output)?;
   85    144   
    ::pyo3::py_run!(
   86    145   
        py,
   87    146   
        error,
   88    147   
        "import sys; sys.modules['constraints.error'] = error"
   89    148   
    );
   90    149   
    m.add_submodule(error)?;
         150  +
    /* PythonServerModuleGenerator.kt:117 */
   91    151   
    ::pyo3::py_run!(
   92    152   
        py,
   93    153   
        model,
   94    154   
        "import sys; sys.modules['constraints.model'] = model"
   95    155   
    );
   96    156   
    m.add_submodule(model)?;
         157  +
    /* PythonServerModuleGenerator.kt:129 */
   97    158   
    let types = ::pyo3::types::PyModule::new(py, "types")?;
   98    159   
    types.add_class::<::aws_smithy_http_server_python::types::Blob>()?;
   99    160   
    types.add_class::<::aws_smithy_http_server_python::types::DateTime>()?;
  100    161   
    types.add_class::<::aws_smithy_http_server_python::types::Format>()?;
  101    162   
    types.add_class::<::aws_smithy_http_server_python::types::ByteStream>()?;
  102    163   
    ::pyo3::py_run!(
  103    164   
        py,
  104    165   
        types,
  105    166   
        "import sys; sys.modules['constraints.types'] = types"
  106    167   
    );
  107    168   
    m.add_submodule(types)?;
         169  +
    /* PythonServerModuleGenerator.kt:149 */
  108    170   
    let socket = ::pyo3::types::PyModule::new(py, "socket")?;
  109    171   
    socket.add_class::<::aws_smithy_http_server_python::PySocket>()?;
  110    172   
    ::pyo3::py_run!(
  111    173   
        py,
  112    174   
        socket,
  113    175   
        "import sys; sys.modules['constraints.socket'] = socket"
  114    176   
    );
  115    177   
    m.add_submodule(socket)?;
         178  +
    /* PythonServerModuleGenerator.kt:166 */
  116    179   
    let logging = ::pyo3::types::PyModule::new(py, "logging")?;
  117    180   
    logging.add_function(::pyo3::wrap_pyfunction!(
  118    181   
        ::aws_smithy_http_server_python::py_tracing_event,
  119    182   
        m
  120    183   
    )?)?;
  121    184   
    logging.add_class::<::aws_smithy_http_server_python::PyTracingHandler>()?;
  122    185   
    ::pyo3::py_run!(
  123    186   
        py,
  124    187   
        logging,
  125    188   
        "import sys; sys.modules['constraints.logging'] = logging"
  126    189   
    );
  127    190   
    m.add_submodule(logging)?;
         191  +
    /* PythonServerModuleGenerator.kt:183 */
  128    192   
    let middleware = ::pyo3::types::PyModule::new(py, "middleware")?;
  129    193   
    middleware.add_class::<::aws_smithy_http_server_python::PyRequest>()?;
  130    194   
    middleware.add_class::<::aws_smithy_http_server_python::PyResponse>()?;
  131    195   
    middleware.add_class::<::aws_smithy_http_server_python::PyMiddlewareException>()?;
  132    196   
    pyo3::py_run!(
  133    197   
        py,
  134    198   
        middleware,
  135    199   
        "import sys; sys.modules['constraints.middleware'] = middleware"
  136    200   
    );
  137    201   
    m.add_submodule(middleware)?;
         202  +
    /* PythonServerModuleGenerator.kt:201 */
  138    203   
    let tls = ::pyo3::types::PyModule::new(py, "tls")?;
  139    204   
    tls.add_class::<::aws_smithy_http_server_python::tls::PyTlsConfig>()?;
  140    205   
    pyo3::py_run!(py, tls, "import sys; sys.modules['constraints.tls'] = tls");
  141    206   
    m.add_submodule(tls)?;
         207  +
    /* PythonServerModuleGenerator.kt:217 */
  142    208   
    let aws_lambda = ::pyo3::types::PyModule::new(py, "aws_lambda")?;
  143    209   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyLambdaContext>()?;
  144    210   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyClientApplication>()?;
  145    211   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyClientContext>()?;
  146    212   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyCognitoIdentity>()?;
  147    213   
    aws_lambda.add_class::<::aws_smithy_http_server_python::lambda::PyConfig>()?;
  148    214   
    pyo3::py_run!(
  149    215   
        py,
  150    216   
        aws_lambda,
  151    217   
        "import sys; sys.modules['constraints.aws_lambda'] = aws_lambda"
  152    218   
    );
  153    219   
    m.add_submodule(aws_lambda)?;
         220  +
    /* PythonServerModuleGenerator.kt:238 */
  154    221   
    m.add_class::<crate::python_server_application::App>()?;
         222  +
    /* PythonServerModuleGenerator.kt:243 */
  155    223   
    m.add("CODEGEN_VERSION", "ci")?;
         224  +
    /* PythonServerModuleGenerator.kt:58 */
  156    225   
    Ok(())
         226  +
    /* PythonServerModuleGenerator.kt:41 */
  157    227   
}

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

@@ -1,1 +1052,1072 @@
    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 `EventStreamsOperation`.
    3      4   
pub(crate) async fn event_streams_operation(
    4      5   
    input: crate::input::EventStreamsOperationInput,
    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::EventStreamsOperationOutput,
    9     10   
    crate::error::EventStreamsOperationError,
   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 = "event_streams_operation",
   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::EventStreamsOperationOutput>(py)
   29     30   
            })
   30     31   
        })
   31     32   
    } else {
   32     33   
        ::tracing::trace!(
   33     34   
            name = "event_streams_operation",
   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::EventStreamsOperationOutput>()
   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 `StreamingBlobOperation`.
   58     60   
pub(crate) async fn streaming_blob_operation(
   59     61   
    input: crate::input::StreamingBlobOperationInput,
   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::StreamingBlobOperationOutput,
   64     66   
    crate::error::StreamingBlobOperationError,
   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 = "streaming_blob_operation",
   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::StreamingBlobOperationOutput>(py)
   84     86   
            })
   85     87   
        })
   86     88   
    } else {
   87     89   
        ::tracing::trace!(
   88     90   
            name = "streaming_blob_operation",
   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::StreamingBlobOperationOutput>()
   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 `NonStreamingBlobOperation`.
  113    116   
pub(crate) async fn non_streaming_blob_operation(
  114    117   
    input: crate::input::NonStreamingBlobOperationInput,
  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::NonStreamingBlobOperationOutput,
  119    122   
    crate::error::NonStreamingBlobOperationError,
  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 = "non_streaming_blob_operation",
  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::NonStreamingBlobOperationOutput>(py)
  139    142   
            })
  140    143   
        })
  141    144   
    } else {
  142    145   
        ::tracing::trace!(
  143    146   
            name = "non_streaming_blob_operation",
  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::NonStreamingBlobOperationOutput>()
  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 `QueryParamsTargetingMapOfEnumStringOperation`.
  168    172   
pub(crate) async fn query_params_targeting_map_of_enum_string_operation(
  169    173   
    input: crate::input::QueryParamsTargetingMapOfEnumStringOperationInput,
  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::QueryParamsTargetingMapOfEnumStringOperationOutput,
  174    178   
    crate::error::QueryParamsTargetingMapOfEnumStringOperationError,
  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 = "query_params_targeting_map_of_enum_string_operation",
  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::QueryParamsTargetingMapOfEnumStringOperationOutput>(py)
  194    198   
            })
  195    199   
        })
  196    200   
    } else {
  197    201   
        ::tracing::trace!(
  198    202   
            name = "query_params_targeting_map_of_enum_string_operation",
  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::QueryParamsTargetingMapOfEnumStringOperationOutput>()
  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 `HttpPrefixHeadersTargetingLengthMapOperation`.
  223    228   
pub(crate) async fn http_prefix_headers_targeting_length_map_operation(
  224    229   
    input: crate::input::HttpPrefixHeadersTargetingLengthMapOperationInput,
  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::HttpPrefixHeadersTargetingLengthMapOperationOutput,
  229    234   
    crate::error::HttpPrefixHeadersTargetingLengthMapOperationError,
  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 = "http_prefix_headers_targeting_length_map_operation",
  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::HttpPrefixHeadersTargetingLengthMapOperationOutput>(py)
  249    254   
            })
  250    255   
        })
  251    256   
    } else {
  252    257   
        ::tracing::trace!(
  253    258   
            name = "http_prefix_headers_targeting_length_map_operation",
  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::HttpPrefixHeadersTargetingLengthMapOperationOutput>()
  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 `QueryParamsTargetingMapOfListOfLengthPatternStringOperation`.
  278    284   
pub(crate) async fn query_params_targeting_map_of_list_of_length_pattern_string_operation(
  279    285   
    input: crate::input::QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput,
  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::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput,
  284    290   
    crate::error::QueryParamsTargetingMapOfListOfLengthPatternStringOperationError,
  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 = "query_params_targeting_map_of_list_of_length_pattern_string_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| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput>(py)))
  302    308   
    } else {
  303    309   
        ::tracing::trace!(
  304    310   
            name = "query_params_targeting_map_of_list_of_length_pattern_string_operation",
  305    311   
            "executing python handler function"
  306    312   
        );
  307    313   
        ::pyo3::Python::with_gil(|py| {
  308    314   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  309    315   
            let output = if handler.args == 1 {
  310    316   
                pyhandler.call1((input,))?
  311    317   
            } else {
  312    318   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  313    319   
            };
  314    320   
            output.extract::<crate::output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput>()
  315    321   
        })
  316    322   
    };
  317    323   
    // Catch and record a Python traceback.
  318    324   
    result.map_err(|e| {
  319    325   
        let rich_py_err =
  320    326   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  321    327   
                e.clone_ref(py)
  322    328   
            }));
  323    329   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  324    330   
        e.into()
  325    331   
    })
  326    332   
}
  327    333   
         334  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  328    335   
/// Python handler for operation `QueryParamsTargetingMapOfLengthPatternStringOperation`.
  329    336   
pub(crate) async fn query_params_targeting_map_of_length_pattern_string_operation(
  330    337   
    input: crate::input::QueryParamsTargetingMapOfLengthPatternStringOperationInput,
  331    338   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  332    339   
    handler: ::aws_smithy_http_server_python::PyHandler,
  333    340   
) -> std::result::Result<
  334    341   
    crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput,
  335    342   
    crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError,
  336    343   
> {
  337    344   
    // Async block used to run the handler and catch any Python error.
  338    345   
    let result = if handler.is_coroutine {
  339    346   
        ::tracing::trace!(
  340    347   
            name = "query_params_targeting_map_of_length_pattern_string_operation",
  341    348   
            "executing python handler coroutine"
  342    349   
        );
  343    350   
        let result = ::pyo3::Python::with_gil(|py| {
  344    351   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  345    352   
            let coroutine = if handler.args == 1 {
  346    353   
                pyhandler.call1((input,))?
  347    354   
            } else {
  348    355   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  349    356   
            };
  350    357   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  351    358   
        })?;
  352    359   
        result.await.and_then(|r| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput>(py)))
  353    360   
    } else {
  354    361   
        ::tracing::trace!(
  355    362   
            name = "query_params_targeting_map_of_length_pattern_string_operation",
  356    363   
            "executing python handler function"
  357    364   
        );
  358    365   
        ::pyo3::Python::with_gil(|py| {
  359    366   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  360    367   
            let output = if handler.args == 1 {
  361    368   
                pyhandler.call1((input,))?
  362    369   
            } else {
  363    370   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  364    371   
            };
  365    372   
            output.extract::<crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput>()
  366    373   
        })
  367    374   
    };
  368    375   
    // Catch and record a Python traceback.
  369    376   
    result.map_err(|e| {
  370    377   
        let rich_py_err =
  371    378   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  372    379   
                e.clone_ref(py)
  373    380   
            }));
  374    381   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  375    382   
        e.into()
  376    383   
    })
  377    384   
}
  378    385   
         386  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  379    387   
/// Python handler for operation `QueryParamsTargetingMapOfListOfPatternStringOperation`.
  380    388   
pub(crate) async fn query_params_targeting_map_of_list_of_pattern_string_operation(
  381    389   
    input: crate::input::QueryParamsTargetingMapOfListOfPatternStringOperationInput,
  382    390   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  383    391   
    handler: ::aws_smithy_http_server_python::PyHandler,
  384    392   
) -> std::result::Result<
  385    393   
    crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput,
  386    394   
    crate::error::QueryParamsTargetingMapOfListOfPatternStringOperationError,
  387    395   
> {
  388    396   
    // Async block used to run the handler and catch any Python error.
  389    397   
    let result = if handler.is_coroutine {
  390    398   
        ::tracing::trace!(
  391    399   
            name = "query_params_targeting_map_of_list_of_pattern_string_operation",
  392    400   
            "executing python handler coroutine"
  393    401   
        );
  394    402   
        let result = ::pyo3::Python::with_gil(|py| {
  395    403   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  396    404   
            let coroutine = if handler.args == 1 {
  397    405   
                pyhandler.call1((input,))?
  398    406   
            } else {
  399    407   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  400    408   
            };
  401    409   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  402    410   
        })?;
  403    411   
        result.await.and_then(|r| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput>(py)))
  404    412   
    } else {
  405    413   
        ::tracing::trace!(
  406    414   
            name = "query_params_targeting_map_of_list_of_pattern_string_operation",
  407    415   
            "executing python handler function"
  408    416   
        );
  409    417   
        ::pyo3::Python::with_gil(|py| {
  410    418   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  411    419   
            let output = if handler.args == 1 {
  412    420   
                pyhandler.call1((input,))?
  413    421   
            } else {
  414    422   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  415    423   
            };
  416    424   
            output.extract::<crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput>()
  417    425   
        })
  418    426   
    };
  419    427   
    // Catch and record a Python traceback.
  420    428   
    result.map_err(|e| {
  421    429   
        let rich_py_err =
  422    430   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  423    431   
                e.clone_ref(py)
  424    432   
            }));
  425    433   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  426    434   
        e.into()
  427    435   
    })
  428    436   
}
  429    437   
         438  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  430    439   
/// Python handler for operation `QueryParamsTargetingMapOfPatternStringOperation`.
  431    440   
pub(crate) async fn query_params_targeting_map_of_pattern_string_operation(
  432    441   
    input: crate::input::QueryParamsTargetingMapOfPatternStringOperationInput,
  433    442   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  434    443   
    handler: ::aws_smithy_http_server_python::PyHandler,
  435    444   
) -> std::result::Result<
  436    445   
    crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput,
  437    446   
    crate::error::QueryParamsTargetingMapOfPatternStringOperationError,
  438    447   
> {
  439    448   
    // Async block used to run the handler and catch any Python error.
  440    449   
    let result = if handler.is_coroutine {
  441    450   
        ::tracing::trace!(
  442    451   
            name = "query_params_targeting_map_of_pattern_string_operation",
  443    452   
            "executing python handler coroutine"
  444    453   
        );
  445    454   
        let result = ::pyo3::Python::with_gil(|py| {
  446    455   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  447    456   
            let coroutine = if handler.args == 1 {
  448    457   
                pyhandler.call1((input,))?
  449    458   
            } else {
  450    459   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  451    460   
            };
  452    461   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  453    462   
        })?;
  454    463   
        result.await.and_then(|r| {
  455    464   
            ::pyo3::Python::with_gil(|py| {
  456    465   
                r.extract::<crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput>(
  457    466   
                    py,
  458    467   
                )
  459    468   
            })
  460    469   
        })
  461    470   
    } else {
  462    471   
        ::tracing::trace!(
  463    472   
            name = "query_params_targeting_map_of_pattern_string_operation",
  464    473   
            "executing python handler function"
  465    474   
        );
  466    475   
        ::pyo3::Python::with_gil(|py| {
  467    476   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  468    477   
            let output = if handler.args == 1 {
  469    478   
                pyhandler.call1((input,))?
  470    479   
            } else {
  471    480   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  472    481   
            };
  473    482   
            output.extract::<crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput>()
  474    483   
        })
  475    484   
    };
  476    485   
    // Catch and record a Python traceback.
  477    486   
    result.map_err(|e| {
  478    487   
        let rich_py_err =
  479    488   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  480    489   
                e.clone_ref(py)
  481    490   
            }));
  482    491   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  483    492   
        e.into()
  484    493   
    })
  485    494   
}
  486    495   
         496  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  487    497   
/// Python handler for operation `QueryParamsTargetingMapOfListOfEnumStringOperation`.
  488    498   
pub(crate) async fn query_params_targeting_map_of_list_of_enum_string_operation(
  489    499   
    input: crate::input::QueryParamsTargetingMapOfListOfEnumStringOperationInput,
  490    500   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  491    501   
    handler: ::aws_smithy_http_server_python::PyHandler,
  492    502   
) -> std::result::Result<
  493    503   
    crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput,
  494    504   
    crate::error::QueryParamsTargetingMapOfListOfEnumStringOperationError,
  495    505   
> {
  496    506   
    // Async block used to run the handler and catch any Python error.
  497    507   
    let result = if handler.is_coroutine {
  498    508   
        ::tracing::trace!(
  499    509   
            name = "query_params_targeting_map_of_list_of_enum_string_operation",
  500    510   
            "executing python handler coroutine"
  501    511   
        );
  502    512   
        let result = ::pyo3::Python::with_gil(|py| {
  503    513   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  504    514   
            let coroutine = if handler.args == 1 {
  505    515   
                pyhandler.call1((input,))?
  506    516   
            } else {
  507    517   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  508    518   
            };
  509    519   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  510    520   
        })?;
  511    521   
        result.await.and_then(|r| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput>(py)))
  512    522   
    } else {
  513    523   
        ::tracing::trace!(
  514    524   
            name = "query_params_targeting_map_of_list_of_enum_string_operation",
  515    525   
            "executing python handler function"
  516    526   
        );
  517    527   
        ::pyo3::Python::with_gil(|py| {
  518    528   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  519    529   
            let output = if handler.args == 1 {
  520    530   
                pyhandler.call1((input,))?
  521    531   
            } else {
  522    532   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  523    533   
            };
  524    534   
            output
  525    535   
                .extract::<crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput>(
  526    536   
                )
  527    537   
        })
  528    538   
    };
  529    539   
    // Catch and record a Python traceback.
  530    540   
    result.map_err(|e| {
  531    541   
        let rich_py_err =
  532    542   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  533    543   
                e.clone_ref(py)
  534    544   
            }));
  535    545   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  536    546   
        e.into()
  537    547   
    })
  538    548   
}
  539    549   
         550  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  540    551   
/// Python handler for operation `QueryParamsTargetingMapOfLengthListOfPatternStringOperation`.
  541    552   
pub(crate) async fn query_params_targeting_map_of_length_list_of_pattern_string_operation(
  542    553   
    input: crate::input::QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput,
  543    554   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  544    555   
    handler: ::aws_smithy_http_server_python::PyHandler,
  545    556   
) -> std::result::Result<
  546    557   
    crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput,
  547    558   
    crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError,
  548    559   
> {
  549    560   
    // Async block used to run the handler and catch any Python error.
  550    561   
    let result = if handler.is_coroutine {
  551    562   
        ::tracing::trace!(
  552    563   
            name = "query_params_targeting_map_of_length_list_of_pattern_string_operation",
  553    564   
            "executing python handler coroutine"
  554    565   
        );
  555    566   
        let result = ::pyo3::Python::with_gil(|py| {
  556    567   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  557    568   
            let coroutine = if handler.args == 1 {
  558    569   
                pyhandler.call1((input,))?
  559    570   
            } else {
  560    571   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  561    572   
            };
  562    573   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  563    574   
        })?;
  564    575   
        result.await.and_then(|r| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput>(py)))
  565    576   
    } else {
  566    577   
        ::tracing::trace!(
  567    578   
            name = "query_params_targeting_map_of_length_list_of_pattern_string_operation",
  568    579   
            "executing python handler function"
  569    580   
        );
  570    581   
        ::pyo3::Python::with_gil(|py| {
  571    582   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  572    583   
            let output = if handler.args == 1 {
  573    584   
                pyhandler.call1((input,))?
  574    585   
            } else {
  575    586   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  576    587   
            };
  577    588   
            output.extract::<crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput>()
  578    589   
        })
  579    590   
    };
  580    591   
    // Catch and record a Python traceback.
  581    592   
    result.map_err(|e| {
  582    593   
        let rich_py_err =
  583    594   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  584    595   
                e.clone_ref(py)
  585    596   
            }));
  586    597   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  587    598   
        e.into()
  588    599   
    })
  589    600   
}
  590    601   
         602  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  591    603   
/// Python handler for operation `QueryParamsTargetingMapOfSetOfLengthStringOperation`.
  592    604   
pub(crate) async fn query_params_targeting_map_of_set_of_length_string_operation(
  593    605   
    input: crate::input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput,
  594    606   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  595    607   
    handler: ::aws_smithy_http_server_python::PyHandler,
  596    608   
) -> std::result::Result<
  597    609   
    crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput,
  598    610   
    crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError,
  599    611   
> {
  600    612   
    // Async block used to run the handler and catch any Python error.
  601    613   
    let result = if handler.is_coroutine {
  602    614   
        ::tracing::trace!(
  603    615   
            name = "query_params_targeting_map_of_set_of_length_string_operation",
  604    616   
            "executing python handler coroutine"
  605    617   
        );
  606    618   
        let result = ::pyo3::Python::with_gil(|py| {
  607    619   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  608    620   
            let coroutine = if handler.args == 1 {
  609    621   
                pyhandler.call1((input,))?
  610    622   
            } else {
  611    623   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  612    624   
            };
  613    625   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  614    626   
        })?;
  615    627   
        result.await.and_then(|r| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput>(py)))
  616    628   
    } else {
  617    629   
        ::tracing::trace!(
  618    630   
            name = "query_params_targeting_map_of_set_of_length_string_operation",
  619    631   
            "executing python handler function"
  620    632   
        );
  621    633   
        ::pyo3::Python::with_gil(|py| {
  622    634   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  623    635   
            let output = if handler.args == 1 {
  624    636   
                pyhandler.call1((input,))?
  625    637   
            } else {
  626    638   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  627    639   
            };
  628    640   
            output.extract::<crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput>()
  629    641   
        })
  630    642   
    };
  631    643   
    // Catch and record a Python traceback.
  632    644   
    result.map_err(|e| {
  633    645   
        let rich_py_err =
  634    646   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  635    647   
                e.clone_ref(py)
  636    648   
            }));
  637    649   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  638    650   
        e.into()
  639    651   
    })
  640    652   
}
  641    653   
         654  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  642    655   
/// Python handler for operation `QueryParamsTargetingMapOfListOfLengthStringOperation`.
  643    656   
pub(crate) async fn query_params_targeting_map_of_list_of_length_string_operation(
  644    657   
    input: crate::input::QueryParamsTargetingMapOfListOfLengthStringOperationInput,
  645    658   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  646    659   
    handler: ::aws_smithy_http_server_python::PyHandler,
  647    660   
) -> std::result::Result<
  648    661   
    crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput,
  649    662   
    crate::error::QueryParamsTargetingMapOfListOfLengthStringOperationError,
  650    663   
> {
  651    664   
    // Async block used to run the handler and catch any Python error.
  652    665   
    let result = if handler.is_coroutine {
  653    666   
        ::tracing::trace!(
  654    667   
            name = "query_params_targeting_map_of_list_of_length_string_operation",
  655    668   
            "executing python handler coroutine"
  656    669   
        );
  657    670   
        let result = ::pyo3::Python::with_gil(|py| {
  658    671   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  659    672   
            let coroutine = if handler.args == 1 {
  660    673   
                pyhandler.call1((input,))?
  661    674   
            } else {
  662    675   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  663    676   
            };
  664    677   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  665    678   
        })?;
  666    679   
        result.await.and_then(|r| ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput>(py)))
  667    680   
    } else {
  668    681   
        ::tracing::trace!(
  669    682   
            name = "query_params_targeting_map_of_list_of_length_string_operation",
  670    683   
            "executing python handler function"
  671    684   
        );
  672    685   
        ::pyo3::Python::with_gil(|py| {
  673    686   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  674    687   
            let output = if handler.args == 1 {
  675    688   
                pyhandler.call1((input,))?
  676    689   
            } else {
  677    690   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  678    691   
            };
  679    692   
            output.extract::<crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput>()
  680    693   
        })
  681    694   
    };
  682    695   
    // Catch and record a Python traceback.
  683    696   
    result.map_err(|e| {
  684    697   
        let rich_py_err =
  685    698   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  686    699   
                e.clone_ref(py)
  687    700   
            }));
  688    701   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  689    702   
        e.into()
  690    703   
    })
  691    704   
}
  692    705   
         706  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  693    707   
/// Python handler for operation `QueryParamsTargetingMapOfLengthStringOperation`.
  694    708   
pub(crate) async fn query_params_targeting_map_of_length_string_operation(
  695    709   
    input: crate::input::QueryParamsTargetingMapOfLengthStringOperationInput,
  696    710   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  697    711   
    handler: ::aws_smithy_http_server_python::PyHandler,
  698    712   
) -> std::result::Result<
  699    713   
    crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput,
  700    714   
    crate::error::QueryParamsTargetingMapOfLengthStringOperationError,
  701    715   
> {
  702    716   
    // Async block used to run the handler and catch any Python error.
  703    717   
    let result = if handler.is_coroutine {
  704    718   
        ::tracing::trace!(
  705    719   
            name = "query_params_targeting_map_of_length_string_operation",
  706    720   
            "executing python handler coroutine"
  707    721   
        );
  708    722   
        let result = ::pyo3::Python::with_gil(|py| {
  709    723   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  710    724   
            let coroutine = if handler.args == 1 {
  711    725   
                pyhandler.call1((input,))?
  712    726   
            } else {
  713    727   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  714    728   
            };
  715    729   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  716    730   
        })?;
  717    731   
        result.await.and_then(|r| {
  718    732   
            ::pyo3::Python::with_gil(|py| {
  719    733   
                r.extract::<crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput>(py)
  720    734   
            })
  721    735   
        })
  722    736   
    } else {
  723    737   
        ::tracing::trace!(
  724    738   
            name = "query_params_targeting_map_of_length_string_operation",
  725    739   
            "executing python handler function"
  726    740   
        );
  727    741   
        ::pyo3::Python::with_gil(|py| {
  728    742   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  729    743   
            let output = if handler.args == 1 {
  730    744   
                pyhandler.call1((input,))?
  731    745   
            } else {
  732    746   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  733    747   
            };
  734    748   
            output.extract::<crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput>()
  735    749   
        })
  736    750   
    };
  737    751   
    // Catch and record a Python traceback.
  738    752   
    result.map_err(|e| {
  739    753   
        let rich_py_err =
  740    754   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  741    755   
                e.clone_ref(py)
  742    756   
            }));
  743    757   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  744    758   
        e.into()
  745    759   
    })
  746    760   
}
  747    761   
         762  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  748    763   
/// Python handler for operation `QueryParamsTargetingLengthMapOperation`.
  749    764   
pub(crate) async fn query_params_targeting_length_map_operation(
  750    765   
    input: crate::input::QueryParamsTargetingLengthMapOperationInput,
  751    766   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  752    767   
    handler: ::aws_smithy_http_server_python::PyHandler,
  753    768   
) -> std::result::Result<
  754    769   
    crate::output::QueryParamsTargetingLengthMapOperationOutput,
  755    770   
    crate::error::QueryParamsTargetingLengthMapOperationError,
  756    771   
> {
  757    772   
    // Async block used to run the handler and catch any Python error.
  758    773   
    let result = if handler.is_coroutine {
  759    774   
        ::tracing::trace!(
  760    775   
            name = "query_params_targeting_length_map_operation",
  761    776   
            "executing python handler coroutine"
  762    777   
        );
  763    778   
        let result = ::pyo3::Python::with_gil(|py| {
  764    779   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  765    780   
            let coroutine = if handler.args == 1 {
  766    781   
                pyhandler.call1((input,))?
  767    782   
            } else {
  768    783   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  769    784   
            };
  770    785   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  771    786   
        })?;
  772    787   
        result.await.and_then(|r| {
  773    788   
            ::pyo3::Python::with_gil(|py| {
  774    789   
                r.extract::<crate::output::QueryParamsTargetingLengthMapOperationOutput>(py)
  775    790   
            })
  776    791   
        })
  777    792   
    } else {
  778    793   
        ::tracing::trace!(
  779    794   
            name = "query_params_targeting_length_map_operation",
  780    795   
            "executing python handler function"
  781    796   
        );
  782    797   
        ::pyo3::Python::with_gil(|py| {
  783    798   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  784    799   
            let output = if handler.args == 1 {
  785    800   
                pyhandler.call1((input,))?
  786    801   
            } else {
  787    802   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  788    803   
            };
  789    804   
            output.extract::<crate::output::QueryParamsTargetingLengthMapOperationOutput>()
  790    805   
        })
  791    806   
    };
  792    807   
    // Catch and record a Python traceback.
  793    808   
    result.map_err(|e| {
  794    809   
        let rich_py_err =
  795    810   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  796    811   
                e.clone_ref(py)
  797    812   
            }));
  798    813   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  799    814   
        e.into()
  800    815   
    })
  801    816   
}
  802    817   
         818  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  803    819   
/// Python handler for operation `ConstrainedRecursiveShapesOperation`.
  804    820   
pub(crate) async fn constrained_recursive_shapes_operation(
  805    821   
    input: crate::input::ConstrainedRecursiveShapesOperationInput,
  806    822   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  807    823   
    handler: ::aws_smithy_http_server_python::PyHandler,
  808    824   
) -> std::result::Result<
  809    825   
    crate::output::ConstrainedRecursiveShapesOperationOutput,
  810    826   
    crate::error::ConstrainedRecursiveShapesOperationError,
  811    827   
> {
  812    828   
    // Async block used to run the handler and catch any Python error.
  813    829   
    let result = if handler.is_coroutine {
  814    830   
        ::tracing::trace!(
  815    831   
            name = "constrained_recursive_shapes_operation",
  816    832   
            "executing python handler coroutine"
  817    833   
        );
  818    834   
        let result = ::pyo3::Python::with_gil(|py| {
  819    835   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  820    836   
            let coroutine = if handler.args == 1 {
  821    837   
                pyhandler.call1((input,))?
  822    838   
            } else {
  823    839   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  824    840   
            };
  825    841   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  826    842   
        })?;
  827    843   
        result.await.and_then(|r| {
  828    844   
            ::pyo3::Python::with_gil(|py| {
  829    845   
                r.extract::<crate::output::ConstrainedRecursiveShapesOperationOutput>(py)
  830    846   
            })
  831    847   
        })
  832    848   
    } else {
  833    849   
        ::tracing::trace!(
  834    850   
            name = "constrained_recursive_shapes_operation",
  835    851   
            "executing python handler function"
  836    852   
        );
  837    853   
        ::pyo3::Python::with_gil(|py| {
  838    854   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  839    855   
            let output = if handler.args == 1 {
  840    856   
                pyhandler.call1((input,))?
  841    857   
            } else {
  842    858   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  843    859   
            };
  844    860   
            output.extract::<crate::output::ConstrainedRecursiveShapesOperationOutput>()
  845    861   
        })
  846    862   
    };
  847    863   
    // Catch and record a Python traceback.
  848    864   
    result.map_err(|e| {
  849    865   
        let rich_py_err =
  850    866   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  851    867   
                e.clone_ref(py)
  852    868   
            }));
  853    869   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  854    870   
        e.into()
  855    871   
    })
  856    872   
}
  857    873   
         874  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  858    875   
/// Python handler for operation `ConstrainedHttpPayloadBoundShapeOperation`.
  859    876   
pub(crate) async fn constrained_http_payload_bound_shape_operation(
  860    877   
    input: crate::input::ConstrainedHttpPayloadBoundShapeOperationInput,
  861    878   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  862    879   
    handler: ::aws_smithy_http_server_python::PyHandler,
  863    880   
) -> std::result::Result<
  864    881   
    crate::output::ConstrainedHttpPayloadBoundShapeOperationOutput,
  865    882   
    crate::error::ConstrainedHttpPayloadBoundShapeOperationError,
  866    883   
> {
  867    884   
    // Async block used to run the handler and catch any Python error.
  868    885   
    let result = if handler.is_coroutine {
  869    886   
        ::tracing::trace!(
  870    887   
            name = "constrained_http_payload_bound_shape_operation",
  871    888   
            "executing python handler coroutine"
  872    889   
        );
  873    890   
        let result = ::pyo3::Python::with_gil(|py| {
  874    891   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  875    892   
            let coroutine = if handler.args == 1 {
  876    893   
                pyhandler.call1((input,))?
  877    894   
            } else {
  878    895   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  879    896   
            };
  880    897   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  881    898   
        })?;
  882    899   
        result.await.and_then(|r| {
  883    900   
            ::pyo3::Python::with_gil(|py| {
  884    901   
                r.extract::<crate::output::ConstrainedHttpPayloadBoundShapeOperationOutput>(py)
  885    902   
            })
  886    903   
        })
  887    904   
    } else {
  888    905   
        ::tracing::trace!(
  889    906   
            name = "constrained_http_payload_bound_shape_operation",
  890    907   
            "executing python handler function"
  891    908   
        );
  892    909   
        ::pyo3::Python::with_gil(|py| {
  893    910   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  894    911   
            let output = if handler.args == 1 {
  895    912   
                pyhandler.call1((input,))?
  896    913   
            } else {
  897    914   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  898    915   
            };
  899    916   
            output.extract::<crate::output::ConstrainedHttpPayloadBoundShapeOperationOutput>()
  900    917   
        })
  901    918   
    };
  902    919   
    // Catch and record a Python traceback.
  903    920   
    result.map_err(|e| {
  904    921   
        let rich_py_err =
  905    922   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  906    923   
                e.clone_ref(py)
  907    924   
            }));
  908    925   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  909    926   
        e.into()
  910    927   
    })
  911    928   
}
  912    929   
         930  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  913    931   
/// Python handler for operation `ConstrainedHttpBoundShapesOperation`.
  914    932   
pub(crate) async fn constrained_http_bound_shapes_operation(
  915    933   
    input: crate::input::ConstrainedHttpBoundShapesOperationInput,
  916    934   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  917    935   
    handler: ::aws_smithy_http_server_python::PyHandler,
  918    936   
) -> std::result::Result<
  919    937   
    crate::output::ConstrainedHttpBoundShapesOperationOutput,
  920    938   
    crate::error::ConstrainedHttpBoundShapesOperationError,
  921    939   
> {
  922    940   
    // Async block used to run the handler and catch any Python error.
  923    941   
    let result = if handler.is_coroutine {
  924    942   
        ::tracing::trace!(
  925    943   
            name = "constrained_http_bound_shapes_operation",
  926    944   
            "executing python handler coroutine"
  927    945   
        );
  928    946   
        let result = ::pyo3::Python::with_gil(|py| {
  929    947   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  930    948   
            let coroutine = if handler.args == 1 {
  931    949   
                pyhandler.call1((input,))?
  932    950   
            } else {
  933    951   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  934    952   
            };
  935    953   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  936    954   
        })?;
  937    955   
        result.await.and_then(|r| {
  938    956   
            ::pyo3::Python::with_gil(|py| {
  939    957   
                r.extract::<crate::output::ConstrainedHttpBoundShapesOperationOutput>(py)
  940    958   
            })
  941    959   
        })
  942    960   
    } else {
  943    961   
        ::tracing::trace!(
  944    962   
            name = "constrained_http_bound_shapes_operation",
  945    963   
            "executing python handler function"
  946    964   
        );
  947    965   
        ::pyo3::Python::with_gil(|py| {
  948    966   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  949    967   
            let output = if handler.args == 1 {
  950    968   
                pyhandler.call1((input,))?
  951    969   
            } else {
  952    970   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  953    971   
            };
  954    972   
            output.extract::<crate::output::ConstrainedHttpBoundShapesOperationOutput>()
  955    973   
        })
  956    974   
    };
  957    975   
    // Catch and record a Python traceback.
  958    976   
    result.map_err(|e| {
  959    977   
        let rich_py_err =
  960    978   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  961    979   
                e.clone_ref(py)
  962    980   
            }));
  963    981   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  964    982   
        e.into()
  965    983   
    })
  966    984   
}
  967    985   
         986  +
/* PythonServerOperationHandlerGenerator.kt:61 */
  968    987   
/// Python handler for operation `ConstrainedShapesOnlyInOutputOperation`.
  969    988   
pub(crate) async fn constrained_shapes_only_in_output_operation(
  970    989   
    input: crate::input::ConstrainedShapesOnlyInOutputOperationInput,
  971    990   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
  972    991   
    handler: ::aws_smithy_http_server_python::PyHandler,
  973    992   
) -> std::result::Result<
  974    993   
    crate::output::ConstrainedShapesOnlyInOutputOperationOutput,
  975    994   
    crate::error::ConstrainedShapesOnlyInOutputOperationError,
  976    995   
> {
  977    996   
    // Async block used to run the handler and catch any Python error.
  978    997   
    let result = if handler.is_coroutine {
  979    998   
        ::tracing::trace!(
  980    999   
            name = "constrained_shapes_only_in_output_operation",
  981   1000   
            "executing python handler coroutine"
  982   1001   
        );
  983   1002   
        let result = ::pyo3::Python::with_gil(|py| {
  984   1003   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  985   1004   
            let coroutine = if handler.args == 1 {
  986   1005   
                pyhandler.call1((input,))?
  987   1006   
            } else {
  988   1007   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  989   1008   
            };
  990   1009   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  991   1010   
        })?;
  992   1011   
        result.await.and_then(|r| {
  993   1012   
            ::pyo3::Python::with_gil(|py| {
  994   1013   
                r.extract::<crate::output::ConstrainedShapesOnlyInOutputOperationOutput>(py)
  995   1014   
            })
  996   1015   
        })
  997   1016   
    } else {
  998   1017   
        ::tracing::trace!(
  999   1018   
            name = "constrained_shapes_only_in_output_operation",
 1000   1019   
            "executing python handler function"
 1001   1020   
        );
 1002   1021   
        ::pyo3::Python::with_gil(|py| {
 1003   1022   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
 1004   1023   
            let output = if handler.args == 1 {
 1005   1024   
                pyhandler.call1((input,))?
 1006   1025   
            } else {
 1007   1026   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
 1008   1027   
            };
 1009   1028   
            output.extract::<crate::output::ConstrainedShapesOnlyInOutputOperationOutput>()
 1010   1029   
        })
 1011   1030   
    };
 1012   1031   
    // Catch and record a Python traceback.
 1013   1032   
    result.map_err(|e| {
 1014   1033   
        let rich_py_err =
 1015   1034   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
 1016   1035   
                e.clone_ref(py)
 1017   1036   
            }));
 1018   1037   
        ::tracing::error!(error = ?rich_py_err, "handler error");
 1019   1038   
        e.into()
 1020   1039   
    })
 1021   1040   
}
 1022   1041   
        1042  +
/* PythonServerOperationHandlerGenerator.kt:61 */
 1023   1043   
/// Python handler for operation `ConstrainedShapesOperation`.
 1024   1044   
pub(crate) async fn constrained_shapes_operation(
 1025   1045   
    input: crate::input::ConstrainedShapesOperationInput,
 1026   1046   
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
 1027   1047   
    handler: ::aws_smithy_http_server_python::PyHandler,
 1028   1048   
) -> std::result::Result<
 1029   1049   
    crate::output::ConstrainedShapesOperationOutput,
 1030   1050   
    crate::error::ConstrainedShapesOperationError,
 1031   1051   
> {
 1032   1052   
    // Async block used to run the handler and catch any Python error.

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

@@ -1,1 +58,63 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* PythonApplicationGenerator.kt:386 */
    2      3   
#[allow(clippy::tabs_in_doc_comments)]
    3      4   
/// Main Python application, used to register operations and context and start multiple
    4      5   
/// workers on the same shared socket.
    5      6   
///
    6      7   
/// Operations can be registered using the application object as a decorator (`@app.operation_name`).
    7      8   
///
    8      9   
/// Here's a full example to get you started:
    9     10   
///
   10     11   
/// ```python
          12  +
/* PythonApplicationGenerator.kt:399 */
   11     13   
/// from constraints import input
   12     14   
/// from constraints import output
          15  +
/* PythonApplicationGenerator.kt:406 */
   13     16   
/// from constraints import error
          17  +
/* PythonApplicationGenerator.kt:408 */
   14     18   
/// from constraints import middleware
   15     19   
/// from constraints import App
   16     20   
///
   17     21   
/// @dataclass
   18     22   
/// class Context:
   19     23   
///     counter: int = 0
   20     24   
///
   21     25   
/// app = App()
   22     26   
/// app.context(Context())
   23     27   
///
   24     28   
/// @app.request_middleware
   25     29   
/// def request_middleware(request: middleware::Request):
   26     30   
///     if request.get_header("x-amzn-id") != "secret":
   27     31   
///         raise middleware.MiddlewareException("Unsupported `x-amz-id` header", 401)
   28     32   
///
          33  +
/* PythonApplicationGenerator.kt:441 */
   29     34   
/// @app.constrained_http_bound_shapes_operation
   30     35   
/// def constrained_http_bound_shapes_operation(input: input::ConstrainedHttpBoundShapesOperationInput, ctx: Context) -> output::ConstrainedHttpBoundShapesOperationOutput:
   31     36   
///     raise NotImplementedError
   32     37   
///
   33     38   
/// @app.constrained_http_payload_bound_shape_operation
   34     39   
/// def constrained_http_payload_bound_shape_operation(input: input::ConstrainedHttpPayloadBoundShapeOperationInput, ctx: Context) -> output::ConstrainedHttpPayloadBoundShapeOperationOutput:
   35     40   
///     raise NotImplementedError
   36     41   
///
   37     42   
/// @app.constrained_recursive_shapes_operation
   38     43   
/// def constrained_recursive_shapes_operation(input: input::ConstrainedRecursiveShapesOperationInput, ctx: Context) -> output::ConstrainedRecursiveShapesOperationOutput:
@@ -78,83 +427,465 @@
   98    103   
/// def query_params_targeting_map_of_pattern_string_operation(input: input::QueryParamsTargetingMapOfPatternStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfPatternStringOperationOutput:
   99    104   
///     raise NotImplementedError
  100    105   
///
  101    106   
/// @app.query_params_targeting_map_of_set_of_length_string_operation
  102    107   
/// def query_params_targeting_map_of_set_of_length_string_operation(input: input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput:
  103    108   
///     raise NotImplementedError
  104    109   
///
  105    110   
/// @app.streaming_blob_operation
  106    111   
/// def streaming_blob_operation(input: input::StreamingBlobOperationInput, ctx: Context) -> output::StreamingBlobOperationOutput:
  107    112   
///     raise NotImplementedError
         113  +
/* PythonApplicationGenerator.kt:428 */
  108    114   
///
  109    115   
/// app.run()
  110    116   
/// ```
  111    117   
///
  112    118   
/// Any of operations above can be written as well prepending the `async` keyword and
  113    119   
/// the Python application will automatically handle it and schedule it on the event loop for you.
         120  +
/* PythonApplicationGenerator.kt:112 */
  114    121   
#[::pyo3::pyclass]
  115    122   
#[derive(Debug)]
  116    123   
/// :generic Ctx:
  117    124   
/// :extends typing.Generic\[Ctx\]:
  118    125   
/// :rtype None:
  119    126   
pub struct App {
  120    127   
    handlers: ::std::collections::HashMap<String, ::aws_smithy_http_server_python::PyHandler>,
  121    128   
    middlewares: Vec<::aws_smithy_http_server_python::PyMiddlewareHandler>,
  122    129   
    context: Option<::pyo3::PyObject>,
  123    130   
    workers: ::parking_lot::Mutex<Vec<::pyo3::PyObject>>,
  124    131   
}
         132  +
/* PythonApplicationGenerator.kt:149 */
  125    133   
impl Default for App {
  126    134   
    fn default() -> Self {
  127    135   
        Self {
  128    136   
            handlers: Default::default(),
  129    137   
            middlewares: vec![],
  130    138   
            context: None,
  131    139   
            workers: ::parking_lot::Mutex::new(vec![]),
  132    140   
        }
  133    141   
    }
  134    142   
}
         143  +
/* PythonApplicationGenerator.kt:131 */
  135    144   
impl Clone for App {
  136    145   
    fn clone(&self) -> Self {
  137    146   
        Self {
  138    147   
            handlers: self.handlers.clone(),
  139    148   
            middlewares: self.middlewares.clone(),
  140    149   
            context: self.context.clone(),
  141    150   
            workers: ::parking_lot::Mutex::new(vec![]),
  142    151   
        }
  143    152   
    }
  144    153   
}
         154  +
/* PythonApplicationGenerator.kt:168 */
  145    155   
impl ::aws_smithy_http_server_python::PyApp for App {
         156  +
    /* PythonApplicationGenerator.kt:174 */
  146    157   
    fn workers(&self) -> &::parking_lot::Mutex<Vec<::pyo3::PyObject>> {
  147    158   
        &self.workers
  148    159   
    }
  149    160   
    fn context(&self) -> &Option<::pyo3::PyObject> {
  150    161   
        &self.context
  151    162   
    }
  152    163   
    fn handlers(
  153    164   
        &mut self,
  154    165   
    ) -> &mut ::std::collections::HashMap<String, ::aws_smithy_http_server_python::PyHandler> {
  155    166   
        &mut self.handlers
  156    167   
    }
         168  +
    /* PythonApplicationGenerator.kt:189 */
  157    169   
    fn build_service(
  158    170   
        &mut self,
  159    171   
        event_loop: &::pyo3::PyAny,
  160    172   
    ) -> ::pyo3::PyResult<
  161    173   
        ::tower::util::BoxCloneService<
  162    174   
            ::http::Request<::aws_smithy_http_server::body::Body>,
  163    175   
            ::http::Response<::aws_smithy_http_server::body::BoxBody>,
  164    176   
            std::convert::Infallible,
  165    177   
        >,
  166    178   
    > {
         179  +
        /* PythonApplicationGenerator.kt:201 */
  167    180   
        let builder = crate::service::ConstraintsService::builder_without_plugins();
         181  +
        /* PythonApplicationGenerator.kt:209 */
  168    182   
        let constrained_http_bound_shapes_operation_locals =
  169    183   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  170    184   
        let handler = self
  171    185   
            .handlers
  172    186   
            .get("constrained_http_bound_shapes_operation")
  173    187   
            .expect(
  174    188   
                "Python handler for operation `constrained_http_bound_shapes_operation` not found",
  175    189   
            )
  176    190   
            .clone();
  177    191   
        let builder = builder.constrained_http_bound_shapes_operation(move |input, state| {
  178    192   
            ::pyo3_asyncio::tokio::scope(
  179    193   
                constrained_http_bound_shapes_operation_locals.clone(),
  180    194   
                crate::python_operation_adaptor::constrained_http_bound_shapes_operation(
  181    195   
                    input,
  182    196   
                    state,
  183    197   
                    handler.clone(),
  184    198   
                ),
  185    199   
            )
  186    200   
        });
         201  +
        /* PythonApplicationGenerator.kt:209 */
  187    202   
        let constrained_http_payload_bound_shape_operation_locals =
  188    203   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  189    204   
        let handler = self.handlers.get("constrained_http_payload_bound_shape_operation").expect("Python handler for operation `constrained_http_payload_bound_shape_operation` not found").clone();
  190    205   
        let builder =
  191    206   
            builder.constrained_http_payload_bound_shape_operation(move |input, state| {
  192    207   
                ::pyo3_asyncio::tokio::scope(
  193    208   
                    constrained_http_payload_bound_shape_operation_locals.clone(),
  194    209   
                    crate::python_operation_adaptor::constrained_http_payload_bound_shape_operation(
  195    210   
                        input,
  196    211   
                        state,
  197    212   
                        handler.clone(),
  198    213   
                    ),
  199    214   
                )
  200    215   
            });
         216  +
        /* PythonApplicationGenerator.kt:209 */
  201    217   
        let constrained_recursive_shapes_operation_locals =
  202    218   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  203    219   
        let handler = self
  204    220   
            .handlers
  205    221   
            .get("constrained_recursive_shapes_operation")
  206    222   
            .expect(
  207    223   
                "Python handler for operation `constrained_recursive_shapes_operation` not found",
  208    224   
            )
  209    225   
            .clone();
  210    226   
        let builder = builder.constrained_recursive_shapes_operation(move |input, state| {
  211    227   
            ::pyo3_asyncio::tokio::scope(
  212    228   
                constrained_recursive_shapes_operation_locals.clone(),
  213    229   
                crate::python_operation_adaptor::constrained_recursive_shapes_operation(
  214    230   
                    input,
  215    231   
                    state,
  216    232   
                    handler.clone(),
  217    233   
                ),
  218    234   
            )
  219    235   
        });
         236  +
        /* PythonApplicationGenerator.kt:209 */
  220    237   
        let constrained_shapes_only_in_output_operation_locals =
  221    238   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  222    239   
        let handler = self.handlers.get("constrained_shapes_only_in_output_operation").expect("Python handler for operation `constrained_shapes_only_in_output_operation` not found").clone();
  223    240   
        let builder = builder.constrained_shapes_only_in_output_operation(move |input, state| {
  224    241   
            ::pyo3_asyncio::tokio::scope(
  225    242   
                constrained_shapes_only_in_output_operation_locals.clone(),
  226    243   
                crate::python_operation_adaptor::constrained_shapes_only_in_output_operation(
  227    244   
                    input,
  228    245   
                    state,
  229    246   
                    handler.clone(),
  230    247   
                ),
  231    248   
            )
  232    249   
        });
         250  +
        /* PythonApplicationGenerator.kt:209 */
  233    251   
        let constrained_shapes_operation_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  234    252   
        let handler = self
  235    253   
            .handlers
  236    254   
            .get("constrained_shapes_operation")
  237    255   
            .expect("Python handler for operation `constrained_shapes_operation` not found")
  238    256   
            .clone();
  239    257   
        let builder = builder.constrained_shapes_operation(move |input, state| {
  240    258   
            ::pyo3_asyncio::tokio::scope(
  241    259   
                constrained_shapes_operation_locals.clone(),
  242    260   
                crate::python_operation_adaptor::constrained_shapes_operation(
  243    261   
                    input,
  244    262   
                    state,
  245    263   
                    handler.clone(),
  246    264   
                ),
  247    265   
            )
  248    266   
        });
         267  +
        /* PythonApplicationGenerator.kt:209 */
  249    268   
        let event_streams_operation_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  250    269   
        let handler = self
  251    270   
            .handlers
  252    271   
            .get("event_streams_operation")
  253    272   
            .expect("Python handler for operation `event_streams_operation` not found")
  254    273   
            .clone();
  255    274   
        let builder = builder.event_streams_operation(move |input, state| {
  256    275   
            ::pyo3_asyncio::tokio::scope(
  257    276   
                event_streams_operation_locals.clone(),
  258    277   
                crate::python_operation_adaptor::event_streams_operation(
  259    278   
                    input,
  260    279   
                    state,
  261    280   
                    handler.clone(),
  262    281   
                ),
  263    282   
            )
  264    283   
        });
         284  +
        /* PythonApplicationGenerator.kt:209 */
  265    285   
        let http_prefix_headers_targeting_length_map_operation_locals =
  266    286   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  267    287   
        let handler = self.handlers.get("http_prefix_headers_targeting_length_map_operation").expect("Python handler for operation `http_prefix_headers_targeting_length_map_operation` not found").clone();
  268    288   
        let builder = builder.http_prefix_headers_targeting_length_map_operation(move |input, state| {
  269    289   
                                    ::pyo3_asyncio::tokio::scope(http_prefix_headers_targeting_length_map_operation_locals.clone(), crate::python_operation_adaptor::http_prefix_headers_targeting_length_map_operation(input, state, handler.clone()))
  270    290   
                                });
         291  +
        /* PythonApplicationGenerator.kt:209 */
  271    292   
        let non_streaming_blob_operation_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  272    293   
        let handler = self
  273    294   
            .handlers
  274    295   
            .get("non_streaming_blob_operation")
  275    296   
            .expect("Python handler for operation `non_streaming_blob_operation` not found")
  276    297   
            .clone();
  277    298   
        let builder = builder.non_streaming_blob_operation(move |input, state| {
  278    299   
            ::pyo3_asyncio::tokio::scope(
  279    300   
                non_streaming_blob_operation_locals.clone(),
  280    301   
                crate::python_operation_adaptor::non_streaming_blob_operation(
  281    302   
                    input,
  282    303   
                    state,
  283    304   
                    handler.clone(),
  284    305   
                ),
  285    306   
            )
  286    307   
        });
         308  +
        /* PythonApplicationGenerator.kt:209 */
  287    309   
        let query_params_targeting_length_map_operation_locals =
  288    310   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  289    311   
        let handler = self.handlers.get("query_params_targeting_length_map_operation").expect("Python handler for operation `query_params_targeting_length_map_operation` not found").clone();
  290    312   
        let builder = builder.query_params_targeting_length_map_operation(move |input, state| {
  291    313   
            ::pyo3_asyncio::tokio::scope(
  292    314   
                query_params_targeting_length_map_operation_locals.clone(),
  293    315   
                crate::python_operation_adaptor::query_params_targeting_length_map_operation(
  294    316   
                    input,
  295    317   
                    state,
  296    318   
                    handler.clone(),
  297    319   
                ),
  298    320   
            )
  299    321   
        });
         322  +
        /* PythonApplicationGenerator.kt:209 */
  300    323   
        let query_params_targeting_map_of_enum_string_operation_locals =
  301    324   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  302    325   
        let handler = self.handlers.get("query_params_targeting_map_of_enum_string_operation").expect("Python handler for operation `query_params_targeting_map_of_enum_string_operation` not found").clone();
  303    326   
        let builder = builder.query_params_targeting_map_of_enum_string_operation(move |input, state| {
  304    327   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_enum_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_enum_string_operation(input, state, handler.clone()))
  305    328   
                                });
         329  +
        /* PythonApplicationGenerator.kt:209 */
  306    330   
        let query_params_targeting_map_of_length_list_of_pattern_string_operation_locals =
  307    331   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  308    332   
        let handler = self.handlers.get("query_params_targeting_map_of_length_list_of_pattern_string_operation").expect("Python handler for operation `query_params_targeting_map_of_length_list_of_pattern_string_operation` not found").clone();
  309    333   
        let builder = builder.query_params_targeting_map_of_length_list_of_pattern_string_operation(move |input, state| {
  310    334   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_length_list_of_pattern_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_length_list_of_pattern_string_operation(input, state, handler.clone()))
  311    335   
                                });
         336  +
        /* PythonApplicationGenerator.kt:209 */
  312    337   
        let query_params_targeting_map_of_length_pattern_string_operation_locals =
  313    338   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  314    339   
        let handler = self.handlers.get("query_params_targeting_map_of_length_pattern_string_operation").expect("Python handler for operation `query_params_targeting_map_of_length_pattern_string_operation` not found").clone();
  315    340   
        let builder = builder.query_params_targeting_map_of_length_pattern_string_operation(move |input, state| {
  316    341   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_length_pattern_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_length_pattern_string_operation(input, state, handler.clone()))
  317    342   
                                });
         343  +
        /* PythonApplicationGenerator.kt:209 */
  318    344   
        let query_params_targeting_map_of_length_string_operation_locals =
  319    345   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  320    346   
        let handler = self.handlers.get("query_params_targeting_map_of_length_string_operation").expect("Python handler for operation `query_params_targeting_map_of_length_string_operation` not found").clone();
  321    347   
        let builder = builder.query_params_targeting_map_of_length_string_operation(move |input, state| {
  322    348   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_length_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_length_string_operation(input, state, handler.clone()))
  323    349   
                                });
         350  +
        /* PythonApplicationGenerator.kt:209 */
  324    351   
        let query_params_targeting_map_of_list_of_enum_string_operation_locals =
  325    352   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  326    353   
        let handler = self.handlers.get("query_params_targeting_map_of_list_of_enum_string_operation").expect("Python handler for operation `query_params_targeting_map_of_list_of_enum_string_operation` not found").clone();
  327    354   
        let builder = builder.query_params_targeting_map_of_list_of_enum_string_operation(move |input, state| {
  328    355   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_list_of_enum_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_list_of_enum_string_operation(input, state, handler.clone()))
  329    356   
                                });
         357  +
        /* PythonApplicationGenerator.kt:209 */
  330    358   
        let query_params_targeting_map_of_list_of_length_pattern_string_operation_locals =
  331    359   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  332    360   
        let handler = self.handlers.get("query_params_targeting_map_of_list_of_length_pattern_string_operation").expect("Python handler for operation `query_params_targeting_map_of_list_of_length_pattern_string_operation` not found").clone();
  333    361   
        let builder = builder.query_params_targeting_map_of_list_of_length_pattern_string_operation(move |input, state| {
  334    362   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_list_of_length_pattern_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_list_of_length_pattern_string_operation(input, state, handler.clone()))
  335    363   
                                });
         364  +
        /* PythonApplicationGenerator.kt:209 */
  336    365   
        let query_params_targeting_map_of_list_of_length_string_operation_locals =
  337    366   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  338    367   
        let handler = self.handlers.get("query_params_targeting_map_of_list_of_length_string_operation").expect("Python handler for operation `query_params_targeting_map_of_list_of_length_string_operation` not found").clone();
  339    368   
        let builder = builder.query_params_targeting_map_of_list_of_length_string_operation(move |input, state| {
  340    369   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_list_of_length_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_list_of_length_string_operation(input, state, handler.clone()))
  341    370   
                                });
         371  +
        /* PythonApplicationGenerator.kt:209 */
  342    372   
        let query_params_targeting_map_of_list_of_pattern_string_operation_locals =
  343    373   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  344    374   
        let handler = self.handlers.get("query_params_targeting_map_of_list_of_pattern_string_operation").expect("Python handler for operation `query_params_targeting_map_of_list_of_pattern_string_operation` not found").clone();
  345    375   
        let builder = builder.query_params_targeting_map_of_list_of_pattern_string_operation(move |input, state| {
  346    376   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_list_of_pattern_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_list_of_pattern_string_operation(input, state, handler.clone()))
  347    377   
                                });
         378  +
        /* PythonApplicationGenerator.kt:209 */
  348    379   
        let query_params_targeting_map_of_pattern_string_operation_locals =
  349    380   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  350    381   
        let handler = self.handlers.get("query_params_targeting_map_of_pattern_string_operation").expect("Python handler for operation `query_params_targeting_map_of_pattern_string_operation` not found").clone();
  351    382   
        let builder = builder.query_params_targeting_map_of_pattern_string_operation(move |input, state| {
  352    383   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_pattern_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_pattern_string_operation(input, state, handler.clone()))
  353    384   
                                });
         385  +
        /* PythonApplicationGenerator.kt:209 */
  354    386   
        let query_params_targeting_map_of_set_of_length_string_operation_locals =
  355    387   
            ::pyo3_asyncio::TaskLocals::new(event_loop);
  356    388   
        let handler = self.handlers.get("query_params_targeting_map_of_set_of_length_string_operation").expect("Python handler for operation `query_params_targeting_map_of_set_of_length_string_operation` not found").clone();
  357    389   
        let builder = builder.query_params_targeting_map_of_set_of_length_string_operation(move |input, state| {
  358    390   
                                    ::pyo3_asyncio::tokio::scope(query_params_targeting_map_of_set_of_length_string_operation_locals.clone(), crate::python_operation_adaptor::query_params_targeting_map_of_set_of_length_string_operation(input, state, handler.clone()))
  359    391   
                                });
         392  +
        /* PythonApplicationGenerator.kt:209 */
  360    393   
        let streaming_blob_operation_locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  361    394   
        let handler = self
  362    395   
            .handlers
  363    396   
            .get("streaming_blob_operation")
  364    397   
            .expect("Python handler for operation `streaming_blob_operation` not found")
  365    398   
            .clone();
  366    399   
        let builder = builder.streaming_blob_operation(move |input, state| {
  367    400   
            ::pyo3_asyncio::tokio::scope(
  368    401   
                streaming_blob_operation_locals.clone(),
  369    402   
                crate::python_operation_adaptor::streaming_blob_operation(
  370    403   
                    input,
  371    404   
                    state,
  372    405   
                    handler.clone(),
  373    406   
                ),
  374    407   
            )
  375    408   
        });
         409  +
        /* PythonApplicationGenerator.kt:220 */
  376    410   
        let mut service = ::tower::util::BoxCloneService::new(builder.build().expect("one or more operations do not have a registered handler; this is a bug in the Python code generator, please file a bug report under https://github.com/smithy-lang/smithy-rs/issues"));
  377    411   
  378    412   
        {
  379    413   
            use ::tower::Layer;
  380    414   
            ::tracing::trace!("adding middlewares to rust python router");
  381    415   
            let mut middlewares = self.middlewares.clone();
  382    416   
            // Reverse the middlewares, so they run with same order as they defined
  383    417   
            middlewares.reverse();
  384    418   
            for handler in middlewares {
  385    419   
                ::tracing::trace!(name = &handler.name, "adding python middleware");
  386    420   
                let locals = ::pyo3_asyncio::TaskLocals::new(event_loop);
  387    421   
                let layer = ::aws_smithy_http_server_python::PyMiddlewareLayer::<
  388    422   
                    ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  389    423   
                >::new(handler, locals);
  390    424   
                service = ::tower::util::BoxCloneService::new(layer.layer(service));
  391    425   
            }
  392    426   
        }
  393    427   
        Ok(service)
         428  +
        /* PythonApplicationGenerator.kt:189 */
  394    429   
    }
         430  +
    /* PythonApplicationGenerator.kt:168 */
  395    431   
}
         432  +
/* PythonApplicationGenerator.kt:247 */
  396    433   
#[::pyo3::pymethods]
  397    434   
impl App {
         435  +
    /* PythonApplicationGenerator.kt:260 */
  398    436   
    /// Create a new [App].
  399    437   
    #[new]
  400    438   
    pub fn new() -> Self {
  401    439   
        Self::default()
  402    440   
    }
  403    441   
  404    442   
    /// Register a context object that will be shared between handlers.
  405    443   
    ///
  406    444   
    /// :param context Ctx:
  407    445   
    /// :rtype None:
@@ -450,488 +804,863 @@
  470    508   
        py: pyo3::Python,
  471    509   
        socket: &pyo3::PyCell<::aws_smithy_http_server_python::PySocket>,
  472    510   
        worker_number: isize,
  473    511   
        tls: Option<::aws_smithy_http_server_python::tls::PyTlsConfig>,
  474    512   
    ) -> pyo3::PyResult<()> {
  475    513   
        use ::aws_smithy_http_server_python::PyApp;
  476    514   
        let event_loop = self.configure_python_event_loop(py)?;
  477    515   
        let service = self.build_and_configure_service(py, event_loop)?;
  478    516   
        self.start_hyper_worker(py, socket, event_loop, service, worker_number, tls)
  479    517   
    }
         518  +
    /* PythonApplicationGenerator.kt:366 */
  480    519   
    /// Method to register `constrained_http_bound_shapes_operation` Python implementation inside the handlers map.
  481    520   
    /// It can be used as a function decorator in Python.
  482    521   
    ///
  483    522   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.ConstrainedHttpBoundShapesOperationInput, Ctx\], typing.Union\[constraints.output.ConstrainedHttpBoundShapesOperationOutput, typing.Awaitable\[constraints.output.ConstrainedHttpBoundShapesOperationOutput\]\]\], typing.Callable\[\[constraints.input.ConstrainedHttpBoundShapesOperationInput\], typing.Union\[constraints.output.ConstrainedHttpBoundShapesOperationOutput, typing.Awaitable\[constraints.output.ConstrainedHttpBoundShapesOperationOutput\]\]\]\]:
  484    523   
    /// :rtype None:
  485    524   
    #[pyo3(text_signature = "($self, func)")]
  486    525   
    pub fn constrained_http_bound_shapes_operation(
  487    526   
        &mut self,
  488    527   
        py: ::pyo3::Python,
  489    528   
        func: ::pyo3::PyObject,
  490    529   
    ) -> ::pyo3::PyResult<()> {
  491    530   
        use ::aws_smithy_http_server_python::PyApp;
  492    531   
        self.register_operation(py, "constrained_http_bound_shapes_operation", func)
  493    532   
    }
         533  +
    /* PythonApplicationGenerator.kt:366 */
  494    534   
    /// Method to register `constrained_http_payload_bound_shape_operation` Python implementation inside the handlers map.
  495    535   
    /// It can be used as a function decorator in Python.
  496    536   
    ///
  497    537   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.ConstrainedHttpPayloadBoundShapeOperationInput, Ctx\], typing.Union\[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput, typing.Awaitable\[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput\]\]\], typing.Callable\[\[constraints.input.ConstrainedHttpPayloadBoundShapeOperationInput\], typing.Union\[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput, typing.Awaitable\[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput\]\]\]\]:
  498    538   
    /// :rtype None:
  499    539   
    #[pyo3(text_signature = "($self, func)")]
  500    540   
    pub fn constrained_http_payload_bound_shape_operation(
  501    541   
        &mut self,
  502    542   
        py: ::pyo3::Python,
  503    543   
        func: ::pyo3::PyObject,
  504    544   
    ) -> ::pyo3::PyResult<()> {
  505    545   
        use ::aws_smithy_http_server_python::PyApp;
  506    546   
        self.register_operation(py, "constrained_http_payload_bound_shape_operation", func)
  507    547   
    }
         548  +
    /* PythonApplicationGenerator.kt:366 */
  508    549   
    /// Method to register `constrained_recursive_shapes_operation` Python implementation inside the handlers map.
  509    550   
    /// It can be used as a function decorator in Python.
  510    551   
    ///
  511    552   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.ConstrainedRecursiveShapesOperationInput, Ctx\], typing.Union\[constraints.output.ConstrainedRecursiveShapesOperationOutput, typing.Awaitable\[constraints.output.ConstrainedRecursiveShapesOperationOutput\]\]\], typing.Callable\[\[constraints.input.ConstrainedRecursiveShapesOperationInput\], typing.Union\[constraints.output.ConstrainedRecursiveShapesOperationOutput, typing.Awaitable\[constraints.output.ConstrainedRecursiveShapesOperationOutput\]\]\]\]:
  512    553   
    /// :rtype None:
  513    554   
    #[pyo3(text_signature = "($self, func)")]
  514    555   
    pub fn constrained_recursive_shapes_operation(
  515    556   
        &mut self,
  516    557   
        py: ::pyo3::Python,
  517    558   
        func: ::pyo3::PyObject,
  518    559   
    ) -> ::pyo3::PyResult<()> {
  519    560   
        use ::aws_smithy_http_server_python::PyApp;
  520    561   
        self.register_operation(py, "constrained_recursive_shapes_operation", func)
  521    562   
    }
         563  +
    /* PythonApplicationGenerator.kt:366 */
  522    564   
    /// Method to register `constrained_shapes_only_in_output_operation` Python implementation inside the handlers map.
  523    565   
    /// It can be used as a function decorator in Python.
  524    566   
    ///
  525    567   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.ConstrainedShapesOnlyInOutputOperationInput, Ctx\], typing.Union\[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput, typing.Awaitable\[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput\]\]\], typing.Callable\[\[constraints.input.ConstrainedShapesOnlyInOutputOperationInput\], typing.Union\[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput, typing.Awaitable\[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput\]\]\]\]:
  526    568   
    /// :rtype None:
  527    569   
    #[pyo3(text_signature = "($self, func)")]
  528    570   
    pub fn constrained_shapes_only_in_output_operation(
  529    571   
        &mut self,
  530    572   
        py: ::pyo3::Python,
  531    573   
        func: ::pyo3::PyObject,
  532    574   
    ) -> ::pyo3::PyResult<()> {
  533    575   
        use ::aws_smithy_http_server_python::PyApp;
  534    576   
        self.register_operation(py, "constrained_shapes_only_in_output_operation", func)
  535    577   
    }
         578  +
    /* PythonApplicationGenerator.kt:366 */
  536    579   
    /// Method to register `constrained_shapes_operation` Python implementation inside the handlers map.
  537    580   
    /// It can be used as a function decorator in Python.
  538    581   
    ///
  539    582   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.ConstrainedShapesOperationInput, Ctx\], typing.Union\[constraints.output.ConstrainedShapesOperationOutput, typing.Awaitable\[constraints.output.ConstrainedShapesOperationOutput\]\]\], typing.Callable\[\[constraints.input.ConstrainedShapesOperationInput\], typing.Union\[constraints.output.ConstrainedShapesOperationOutput, typing.Awaitable\[constraints.output.ConstrainedShapesOperationOutput\]\]\]\]:
  540    583   
    /// :rtype None:
  541    584   
    #[pyo3(text_signature = "($self, func)")]
  542    585   
    pub fn constrained_shapes_operation(
  543    586   
        &mut self,
  544    587   
        py: ::pyo3::Python,
  545    588   
        func: ::pyo3::PyObject,
  546    589   
    ) -> ::pyo3::PyResult<()> {
  547    590   
        use ::aws_smithy_http_server_python::PyApp;
  548    591   
        self.register_operation(py, "constrained_shapes_operation", func)
  549    592   
    }
         593  +
    /* PythonApplicationGenerator.kt:366 */
  550    594   
    /// Method to register `event_streams_operation` Python implementation inside the handlers map.
  551    595   
    /// It can be used as a function decorator in Python.
  552    596   
    ///
  553    597   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.EventStreamsOperationInput, Ctx\], typing.Union\[constraints.output.EventStreamsOperationOutput, typing.Awaitable\[constraints.output.EventStreamsOperationOutput\]\]\], typing.Callable\[\[constraints.input.EventStreamsOperationInput\], typing.Union\[constraints.output.EventStreamsOperationOutput, typing.Awaitable\[constraints.output.EventStreamsOperationOutput\]\]\]\]:
  554    598   
    /// :rtype None:
  555    599   
    #[pyo3(text_signature = "($self, func)")]
  556    600   
    pub fn event_streams_operation(
  557    601   
        &mut self,
  558    602   
        py: ::pyo3::Python,
  559    603   
        func: ::pyo3::PyObject,
  560    604   
    ) -> ::pyo3::PyResult<()> {
  561    605   
        use ::aws_smithy_http_server_python::PyApp;
  562    606   
        self.register_operation(py, "event_streams_operation", func)
  563    607   
    }
         608  +
    /* PythonApplicationGenerator.kt:366 */
  564    609   
    /// Method to register `http_prefix_headers_targeting_length_map_operation` Python implementation inside the handlers map.
  565    610   
    /// It can be used as a function decorator in Python.
  566    611   
    ///
  567    612   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.HttpPrefixHeadersTargetingLengthMapOperationInput, Ctx\], typing.Union\[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput, typing.Awaitable\[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput\]\]\], typing.Callable\[\[constraints.input.HttpPrefixHeadersTargetingLengthMapOperationInput\], typing.Union\[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput, typing.Awaitable\[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput\]\]\]\]:
  568    613   
    /// :rtype None:
  569    614   
    #[pyo3(text_signature = "($self, func)")]
  570    615   
    pub fn http_prefix_headers_targeting_length_map_operation(
  571    616   
        &mut self,
  572    617   
        py: ::pyo3::Python,
  573    618   
        func: ::pyo3::PyObject,
  574    619   
    ) -> ::pyo3::PyResult<()> {
  575    620   
        use ::aws_smithy_http_server_python::PyApp;
  576    621   
        self.register_operation(
  577    622   
            py,
  578    623   
            "http_prefix_headers_targeting_length_map_operation",
  579    624   
            func,
  580    625   
        )
  581    626   
    }
         627  +
    /* PythonApplicationGenerator.kt:366 */
  582    628   
    /// Method to register `non_streaming_blob_operation` Python implementation inside the handlers map.
  583    629   
    /// It can be used as a function decorator in Python.
  584    630   
    ///
  585    631   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.NonStreamingBlobOperationInput, Ctx\], typing.Union\[constraints.output.NonStreamingBlobOperationOutput, typing.Awaitable\[constraints.output.NonStreamingBlobOperationOutput\]\]\], typing.Callable\[\[constraints.input.NonStreamingBlobOperationInput\], typing.Union\[constraints.output.NonStreamingBlobOperationOutput, typing.Awaitable\[constraints.output.NonStreamingBlobOperationOutput\]\]\]\]:
  586    632   
    /// :rtype None:
  587    633   
    #[pyo3(text_signature = "($self, func)")]
  588    634   
    pub fn non_streaming_blob_operation(
  589    635   
        &mut self,
  590    636   
        py: ::pyo3::Python,
  591    637   
        func: ::pyo3::PyObject,
  592    638   
    ) -> ::pyo3::PyResult<()> {
  593    639   
        use ::aws_smithy_http_server_python::PyApp;
  594    640   
        self.register_operation(py, "non_streaming_blob_operation", func)
  595    641   
    }
         642  +
    /* PythonApplicationGenerator.kt:366 */
  596    643   
    /// Method to register `query_params_targeting_length_map_operation` Python implementation inside the handlers map.
  597    644   
    /// It can be used as a function decorator in Python.
  598    645   
    ///
  599    646   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingLengthMapOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingLengthMapOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingLengthMapOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingLengthMapOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingLengthMapOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingLengthMapOperationOutput\]\]\]\]:
  600    647   
    /// :rtype None:
  601    648   
    #[pyo3(text_signature = "($self, func)")]
  602    649   
    pub fn query_params_targeting_length_map_operation(
  603    650   
        &mut self,
  604    651   
        py: ::pyo3::Python,
  605    652   
        func: ::pyo3::PyObject,
  606    653   
    ) -> ::pyo3::PyResult<()> {
  607    654   
        use ::aws_smithy_http_server_python::PyApp;
  608    655   
        self.register_operation(py, "query_params_targeting_length_map_operation", func)
  609    656   
    }
         657  +
    /* PythonApplicationGenerator.kt:366 */
  610    658   
    /// Method to register `query_params_targeting_map_of_enum_string_operation` Python implementation inside the handlers map.
  611    659   
    /// It can be used as a function decorator in Python.
  612    660   
    ///
  613    661   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfEnumStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfEnumStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput\]\]\]\]:
  614    662   
    /// :rtype None:
  615    663   
    #[pyo3(text_signature = "($self, func)")]
  616    664   
    pub fn query_params_targeting_map_of_enum_string_operation(
  617    665   
        &mut self,
  618    666   
        py: ::pyo3::Python,
  619    667   
        func: ::pyo3::PyObject,
  620    668   
    ) -> ::pyo3::PyResult<()> {
  621    669   
        use ::aws_smithy_http_server_python::PyApp;
  622    670   
        self.register_operation(
  623    671   
            py,
  624    672   
            "query_params_targeting_map_of_enum_string_operation",
  625    673   
            func,
  626    674   
        )
  627    675   
    }
         676  +
    /* PythonApplicationGenerator.kt:366 */
  628    677   
    /// Method to register `query_params_targeting_map_of_length_list_of_pattern_string_operation` Python implementation inside the handlers map.
  629    678   
    /// It can be used as a function decorator in Python.
  630    679   
    ///
  631    680   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput\]\]\]\]:
  632    681   
    /// :rtype None:
  633    682   
    #[pyo3(text_signature = "($self, func)")]
  634    683   
    pub fn query_params_targeting_map_of_length_list_of_pattern_string_operation(
  635    684   
        &mut self,
  636    685   
        py: ::pyo3::Python,
  637    686   
        func: ::pyo3::PyObject,
  638    687   
    ) -> ::pyo3::PyResult<()> {
  639    688   
        use ::aws_smithy_http_server_python::PyApp;
  640    689   
        self.register_operation(
  641    690   
            py,
  642    691   
            "query_params_targeting_map_of_length_list_of_pattern_string_operation",
  643    692   
            func,
  644    693   
        )
  645    694   
    }
         695  +
    /* PythonApplicationGenerator.kt:366 */
  646    696   
    /// Method to register `query_params_targeting_map_of_length_pattern_string_operation` Python implementation inside the handlers map.
  647    697   
    /// It can be used as a function decorator in Python.
  648    698   
    ///
  649    699   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfLengthPatternStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfLengthPatternStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput\]\]\]\]:
  650    700   
    /// :rtype None:
  651    701   
    #[pyo3(text_signature = "($self, func)")]
  652    702   
    pub fn query_params_targeting_map_of_length_pattern_string_operation(
  653    703   
        &mut self,
  654    704   
        py: ::pyo3::Python,
  655    705   
        func: ::pyo3::PyObject,
  656    706   
    ) -> ::pyo3::PyResult<()> {
  657    707   
        use ::aws_smithy_http_server_python::PyApp;
  658    708   
        self.register_operation(
  659    709   
            py,
  660    710   
            "query_params_targeting_map_of_length_pattern_string_operation",
  661    711   
            func,
  662    712   
        )
  663    713   
    }
         714  +
    /* PythonApplicationGenerator.kt:366 */
  664    715   
    /// Method to register `query_params_targeting_map_of_length_string_operation` Python implementation inside the handlers map.
  665    716   
    /// It can be used as a function decorator in Python.
  666    717   
    ///
  667    718   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfLengthStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfLengthStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput\]\]\]\]:
  668    719   
    /// :rtype None:
  669    720   
    #[pyo3(text_signature = "($self, func)")]
  670    721   
    pub fn query_params_targeting_map_of_length_string_operation(
  671    722   
        &mut self,
  672    723   
        py: ::pyo3::Python,
  673    724   
        func: ::pyo3::PyObject,
  674    725   
    ) -> ::pyo3::PyResult<()> {
  675    726   
        use ::aws_smithy_http_server_python::PyApp;
  676    727   
        self.register_operation(
  677    728   
            py,
  678    729   
            "query_params_targeting_map_of_length_string_operation",
  679    730   
            func,
  680    731   
        )
  681    732   
    }
         733  +
    /* PythonApplicationGenerator.kt:366 */
  682    734   
    /// Method to register `query_params_targeting_map_of_list_of_enum_string_operation` Python implementation inside the handlers map.
  683    735   
    /// It can be used as a function decorator in Python.
  684    736   
    ///
  685    737   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfEnumStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfEnumStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput\]\]\]\]:
  686    738   
    /// :rtype None:
  687    739   
    #[pyo3(text_signature = "($self, func)")]
  688    740   
    pub fn query_params_targeting_map_of_list_of_enum_string_operation(
  689    741   
        &mut self,
  690    742   
        py: ::pyo3::Python,
  691    743   
        func: ::pyo3::PyObject,
  692    744   
    ) -> ::pyo3::PyResult<()> {
  693    745   
        use ::aws_smithy_http_server_python::PyApp;
  694    746   
        self.register_operation(
  695    747   
            py,
  696    748   
            "query_params_targeting_map_of_list_of_enum_string_operation",
  697    749   
            func,
  698    750   
        )
  699    751   
    }
         752  +
    /* PythonApplicationGenerator.kt:366 */
  700    753   
    /// Method to register `query_params_targeting_map_of_list_of_length_pattern_string_operation` Python implementation inside the handlers map.
  701    754   
    /// It can be used as a function decorator in Python.
  702    755   
    ///
  703    756   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput\]\]\]\]:
  704    757   
    /// :rtype None:
  705    758   
    #[pyo3(text_signature = "($self, func)")]
  706    759   
    pub fn query_params_targeting_map_of_list_of_length_pattern_string_operation(
  707    760   
        &mut self,
  708    761   
        py: ::pyo3::Python,
  709    762   
        func: ::pyo3::PyObject,
  710    763   
    ) -> ::pyo3::PyResult<()> {
  711    764   
        use ::aws_smithy_http_server_python::PyApp;
  712    765   
        self.register_operation(
  713    766   
            py,
  714    767   
            "query_params_targeting_map_of_list_of_length_pattern_string_operation",
  715    768   
            func,
  716    769   
        )
  717    770   
    }
         771  +
    /* PythonApplicationGenerator.kt:366 */
  718    772   
    /// Method to register `query_params_targeting_map_of_list_of_length_string_operation` Python implementation inside the handlers map.
  719    773   
    /// It can be used as a function decorator in Python.
  720    774   
    ///
  721    775   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfLengthStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfLengthStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput\]\]\]\]:
  722    776   
    /// :rtype None:
  723    777   
    #[pyo3(text_signature = "($self, func)")]
  724    778   
    pub fn query_params_targeting_map_of_list_of_length_string_operation(
  725    779   
        &mut self,
  726    780   
        py: ::pyo3::Python,
  727    781   
        func: ::pyo3::PyObject,
  728    782   
    ) -> ::pyo3::PyResult<()> {
  729    783   
        use ::aws_smithy_http_server_python::PyApp;
  730    784   
        self.register_operation(
  731    785   
            py,
  732    786   
            "query_params_targeting_map_of_list_of_length_string_operation",
  733    787   
            func,
  734    788   
        )
  735    789   
    }
         790  +
    /* PythonApplicationGenerator.kt:366 */
  736    791   
    /// Method to register `query_params_targeting_map_of_list_of_pattern_string_operation` Python implementation inside the handlers map.
  737    792   
    /// It can be used as a function decorator in Python.
  738    793   
    ///
  739    794   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfPatternStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfListOfPatternStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput\]\]\]\]:
  740    795   
    /// :rtype None:
  741    796   
    #[pyo3(text_signature = "($self, func)")]
  742    797   
    pub fn query_params_targeting_map_of_list_of_pattern_string_operation(
  743    798   
        &mut self,
  744    799   
        py: ::pyo3::Python,
  745    800   
        func: ::pyo3::PyObject,
  746    801   
    ) -> ::pyo3::PyResult<()> {
  747    802   
        use ::aws_smithy_http_server_python::PyApp;
  748    803   
        self.register_operation(
  749    804   
            py,
  750    805   
            "query_params_targeting_map_of_list_of_pattern_string_operation",
  751    806   
            func,
  752    807   
        )
  753    808   
    }
         809  +
    /* PythonApplicationGenerator.kt:366 */
  754    810   
    /// Method to register `query_params_targeting_map_of_pattern_string_operation` Python implementation inside the handlers map.
  755    811   
    /// It can be used as a function decorator in Python.
  756    812   
    ///
  757    813   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfPatternStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfPatternStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput\]\]\]\]:
  758    814   
    /// :rtype None:
  759    815   
    #[pyo3(text_signature = "($self, func)")]
  760    816   
    pub fn query_params_targeting_map_of_pattern_string_operation(
  761    817   
        &mut self,
  762    818   
        py: ::pyo3::Python,
  763    819   
        func: ::pyo3::PyObject,
  764    820   
    ) -> ::pyo3::PyResult<()> {
  765    821   
        use ::aws_smithy_http_server_python::PyApp;
  766    822   
        self.register_operation(
  767    823   
            py,
  768    824   
            "query_params_targeting_map_of_pattern_string_operation",
  769    825   
            func,
  770    826   
        )
  771    827   
    }
         828  +
    /* PythonApplicationGenerator.kt:366 */
  772    829   
    /// Method to register `query_params_targeting_map_of_set_of_length_string_operation` Python implementation inside the handlers map.
  773    830   
    /// It can be used as a function decorator in Python.
  774    831   
    ///
  775    832   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfSetOfLengthStringOperationInput, Ctx\], typing.Union\[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput\]\]\], typing.Callable\[\[constraints.input.QueryParamsTargetingMapOfSetOfLengthStringOperationInput\], typing.Union\[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput, typing.Awaitable\[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput\]\]\]\]:
  776    833   
    /// :rtype None:
  777    834   
    #[pyo3(text_signature = "($self, func)")]
  778    835   
    pub fn query_params_targeting_map_of_set_of_length_string_operation(
  779    836   
        &mut self,
  780    837   
        py: ::pyo3::Python,
  781    838   
        func: ::pyo3::PyObject,
  782    839   
    ) -> ::pyo3::PyResult<()> {
  783    840   
        use ::aws_smithy_http_server_python::PyApp;
  784    841   
        self.register_operation(
  785    842   
            py,
  786    843   
            "query_params_targeting_map_of_set_of_length_string_operation",
  787    844   
            func,
  788    845   
        )
  789    846   
    }
         847  +
    /* PythonApplicationGenerator.kt:366 */
  790    848   
    /// Method to register `streaming_blob_operation` Python implementation inside the handlers map.
  791    849   
    /// It can be used as a function decorator in Python.
  792    850   
    ///
  793    851   
    /// :param func typing.Union\[typing.Callable\[\[constraints.input.StreamingBlobOperationInput, Ctx\], typing.Union\[constraints.output.StreamingBlobOperationOutput, typing.Awaitable\[constraints.output.StreamingBlobOperationOutput\]\]\], typing.Callable\[\[constraints.input.StreamingBlobOperationInput\], typing.Union\[constraints.output.StreamingBlobOperationOutput, typing.Awaitable\[constraints.output.StreamingBlobOperationOutput\]\]\]\]:
  794    852   
    /// :rtype None:
  795    853   
    #[pyo3(text_signature = "($self, func)")]
  796    854   
    pub fn streaming_blob_operation(
  797    855   
        &mut self,
  798    856   
        py: ::pyo3::Python,
  799    857   
        func: ::pyo3::PyObject,
  800    858   
    ) -> ::pyo3::PyResult<()> {
  801    859   
        use ::aws_smithy_http_server_python::PyApp;
  802    860   
        self.register_operation(py, "streaming_blob_operation", func)
  803    861   
    }
         862  +
    /* PythonApplicationGenerator.kt:247 */
  804    863   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`ConstraintsService`].
    3      4   
///
    4      5   
/// Constructed via [`ConstraintsService::builder`].
    5      6   
pub struct ConstraintsServiceBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    constrained_http_bound_shapes_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    constrained_http_payload_bound_shape_operation:
    8      9   
        Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    constrained_recursive_shapes_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    constrained_shapes_only_in_output_operation:
   11     12   
        Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -4219,4220 +4278,4280 @@
 4239   4240   
            "com.amazonaws.constraints",
 4240   4241   
            "ConstraintsService",
 4241   4242   
        );
 4242   4243   
 4243   4244   
    const VERSION: Option<&'static str> = Some("");
 4244   4245   
 4245   4246   
    type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
 4246   4247   
 4247   4248   
    type Operations = Operation;
 4248   4249   
}
        4250  +
/* ServiceConfigGenerator.kt:178 */
 4249   4251   
/// Configuration for the [`ConstraintsService`]. This is the central place where to register and
 4250   4252   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 4251   4253   
///
 4252   4254   
/// ```rust,no_run
 4253   4255   
/// # use constraints::ConstraintsServiceConfig;
 4254   4256   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 4255   4257   
/// # use ::tower::layer::util::Identity;
 4256   4258   
/// # let authentication_plugin = IdentityPlugin;
 4257   4259   
/// # let authorization_plugin = IdentityPlugin;
 4258   4260   
/// # let server_request_id_provider_layer = Identity::new();
@@ -4340,4342 +4399,4402 @@
 4360   4362   
 4361   4363   
    /// Build the configuration.
 4362   4364   
    pub fn build(self) -> super::ConstraintsServiceConfig<L, H, M> {
 4363   4365   
        super::ConstraintsServiceConfig {
 4364   4366   
            layers: self.layers,
 4365   4367   
            http_plugins: self.http_plugins,
 4366   4368   
            model_plugins: self.model_plugins,
 4367   4369   
        }
 4368   4370   
    }
 4369   4371   
}
        4372  +
/* ScopeMacroGenerator.kt:81 */
 4370   4373   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 4371   4374   
///
 4372   4375   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 4373   4376   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 4374   4377   
///
 4375   4378   
/// # Example
 4376   4379   
///
 4377   4380   
/// ```rust
 4378   4381   
/// scope! {
 4379   4382   
///     /// Includes [`ConstrainedHttpBoundShapesOperation`], excluding all other operations.

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

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