Server Test Python

Server Test Python

rev. 7254d43655ed63111c94f599437f2b0d3f55446e

Files changed:

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

@@ -1,1 +90,90 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[::pyo3::pymodule]
    3      3   
#[pyo3(name = "json_rpc11")]
    4      4   
pub fn python_library(py: ::pyo3::Python<'_>, m: &::pyo3::types::PyModule) -> ::pyo3::PyResult<()> {
    5      5   
    let input = ::pyo3::types::PyModule::new(py, "input")?;
    6      6   
    let output = ::pyo3::types::PyModule::new(py, "output")?;
    7      7   
    let error = ::pyo3::types::PyModule::new(py, "error")?;
           8  +
    input.add_class::<crate::input::EmptyOperationInput>()?;
           9  +
    output.add_class::<crate::output::EmptyOperationOutput>()?;
    8     10   
    error.add_class::<crate::error::InternalServerError>()?;
    9         -
    output.add_class::<crate::output::ContentTypeParametersOutput>()?;
   10         -
    input.add_class::<crate::input::ContentTypeParametersInput>()?;
   11         -
    output.add_class::<crate::output::PutWithContentEncodingOutput>()?;
   12         -
    input.add_class::<crate::input::PutWithContentEncodingInput>()?;
   13         -
    output.add_class::<crate::output::FractionalSecondsOutput>()?;
   14         -
    input.add_class::<crate::input::FractionalSecondsInput>()?;
   15         -
    output.add_class::<crate::output::DatetimeOffsetsOutput>()?;
   16         -
    input.add_class::<crate::input::DatetimeOffsetsInput>()?;
   17         -
    output.add_class::<crate::output::HostWithPathOperationOutput>()?;
   18         -
    input.add_class::<crate::input::HostWithPathOperationInput>()?;
          11  +
    input.add_class::<crate::input::KitchenSinkOperationInput>()?;
          12  +
    output.add_class::<crate::output::KitchenSinkOperationOutput>()?;
          13  +
    error.add_class::<crate::error::ErrorWithMembers>()?;
          14  +
    error.add_class::<crate::error::ErrorWithoutMembers>()?;
          15  +
    input.add_class::<crate::input::SimpleScalarPropertiesInput>()?;
          16  +
    output.add_class::<crate::output::SimpleScalarPropertiesOutput>()?;
          17  +
    input.add_class::<crate::input::OperationWithOptionalInputOutputInput>()?;
          18  +
    output.add_class::<crate::output::OperationWithOptionalInputOutputOutput>()?;
          19  +
    input.add_class::<crate::input::PutAndGetInlineDocumentsInput>()?;
          20  +
    output.add_class::<crate::output::PutAndGetInlineDocumentsOutput>()?;
          21  +
    input.add_class::<crate::input::JsonEnumsInput>()?;
          22  +
    output.add_class::<crate::output::JsonEnumsOutput>()?;
   19     23   
    error.add_class::<crate::error::ValidationException>()?;
   20         -
    let model = ::pyo3::types::PyModule::new(py, "model")?;
   21         -
    model.add_class::<crate::model::ValidationExceptionField>()?;
   22         -
    output.add_class::<crate::output::EndpointWithHostLabelOperationOutput>()?;
   23         -
    input.add_class::<crate::input::EndpointWithHostLabelOperationInput>()?;
   24         -
    output.add_class::<crate::output::EndpointOperationOutput>()?;
   25         -
    input.add_class::<crate::input::EndpointOperationInput>()?;
   26         -
    output.add_class::<crate::output::JsonUnionsOutput>()?;
   27         -
    model.add_class::<crate::model::PyUnionMarkerMyUnion>()?;
   28         -
    model.add_class::<crate::model::GreetingStruct>()?;
   29         -
    model.add_class::<crate::model::FooEnum>()?;
   30         -
    input.add_class::<crate::input::JsonUnionsInput>()?;
   31         -
    error.add_class::<crate::error::FooError>()?;
   32         -
    error.add_class::<crate::error::ComplexError>()?;
   33         -
    model.add_class::<crate::model::ComplexNestedErrorData>()?;
   34         -
    error.add_class::<crate::error::InvalidGreeting>()?;
   35         -
    output.add_class::<crate::output::GreetingWithErrorsOutput>()?;
   36         -
    input.add_class::<crate::input::GreetingWithErrorsInput>()?;
   37         -
    output.add_class::<crate::output::SparseNullsOperationOutput>()?;
   38         -
    input.add_class::<crate::input::SparseNullsOperationInput>()?;
   39         -
    output.add_class::<crate::output::NullOperationOutput>()?;
   40         -
    input.add_class::<crate::input::NullOperationInput>()?;
   41         -
    output.add_class::<crate::output::JsonIntEnumsOutput>()?;
   42     24   
    input.add_class::<crate::input::JsonIntEnumsInput>()?;
   43         -
    output.add_class::<crate::output::JsonEnumsOutput>()?;
   44         -
    input.add_class::<crate::input::JsonEnumsInput>()?;
   45         -
    output.add_class::<crate::output::PutAndGetInlineDocumentsOutput>()?;
   46         -
    input.add_class::<crate::input::PutAndGetInlineDocumentsInput>()?;
   47         -
    output.add_class::<crate::output::OperationWithOptionalInputOutputOutput>()?;
   48         -
    input.add_class::<crate::input::OperationWithOptionalInputOutputInput>()?;
   49         -
    output.add_class::<crate::output::SimpleScalarPropertiesOutput>()?;
   50         -
    input.add_class::<crate::input::SimpleScalarPropertiesInput>()?;
   51         -
    error.add_class::<crate::error::ErrorWithoutMembers>()?;
   52         -
    error.add_class::<crate::error::ErrorWithMembers>()?;
          25  +
    output.add_class::<crate::output::JsonIntEnumsOutput>()?;
          26  +
    input.add_class::<crate::input::NullOperationInput>()?;
          27  +
    output.add_class::<crate::output::NullOperationOutput>()?;
          28  +
    input.add_class::<crate::input::SparseNullsOperationInput>()?;
          29  +
    output.add_class::<crate::output::SparseNullsOperationOutput>()?;
          30  +
    input.add_class::<crate::input::GreetingWithErrorsInput>()?;
          31  +
    output.add_class::<crate::output::GreetingWithErrorsOutput>()?;
          32  +
    error.add_class::<crate::error::InvalidGreeting>()?;
          33  +
    error.add_class::<crate::error::ComplexError>()?;
          34  +
    error.add_class::<crate::error::FooError>()?;
          35  +
    input.add_class::<crate::input::JsonUnionsInput>()?;
          36  +
    output.add_class::<crate::output::JsonUnionsOutput>()?;
          37  +
    input.add_class::<crate::input::EndpointOperationInput>()?;
          38  +
    output.add_class::<crate::output::EndpointOperationOutput>()?;
          39  +
    input.add_class::<crate::input::EndpointWithHostLabelOperationInput>()?;
          40  +
    output.add_class::<crate::output::EndpointWithHostLabelOperationOutput>()?;
          41  +
    input.add_class::<crate::input::HostWithPathOperationInput>()?;
          42  +
    output.add_class::<crate::output::HostWithPathOperationOutput>()?;
          43  +
    input.add_class::<crate::input::DatetimeOffsetsInput>()?;
          44  +
    output.add_class::<crate::output::DatetimeOffsetsOutput>()?;
          45  +
    input.add_class::<crate::input::FractionalSecondsInput>()?;
          46  +
    output.add_class::<crate::output::FractionalSecondsOutput>()?;
          47  +
    input.add_class::<crate::input::PutWithContentEncodingInput>()?;
          48  +
    output.add_class::<crate::output::PutWithContentEncodingOutput>()?;
          49  +
    input.add_class::<crate::input::ContentTypeParametersInput>()?;
          50  +
    output.add_class::<crate::output::ContentTypeParametersOutput>()?;
          51  +
    let model = ::pyo3::types::PyModule::new(py, "model")?;
          52  +
    model.add_class::<crate::model::EmptyStruct>()?;
   53     53   
    model.add_class::<crate::model::KitchenSink>()?;
   54         -
    model.add_class::<crate::model::StructWithJsonName>()?;
   55     54   
    model.add_class::<crate::model::SimpleStruct>()?;
   56         -
    model.add_class::<crate::model::EmptyStruct>()?;
   57         -
    output.add_class::<crate::output::KitchenSinkOperationOutput>()?;
   58         -
    input.add_class::<crate::input::KitchenSinkOperationInput>()?;
   59         -
    output.add_class::<crate::output::EmptyOperationOutput>()?;
   60         -
    input.add_class::<crate::input::EmptyOperationInput>()?;
          55  +
    model.add_class::<crate::model::StructWithJsonName>()?;
          56  +
    model.add_class::<crate::model::FooEnum>()?;
          57  +
    model.add_class::<crate::model::ComplexNestedErrorData>()?;
          58  +
    model.add_class::<crate::model::PyUnionMarkerMyUnion>()?;
          59  +
    model.add_class::<crate::model::ValidationExceptionField>()?;
          60  +
    model.add_class::<crate::model::GreetingStruct>()?;
   61     61   
    ::pyo3::py_run!(
   62     62   
        py,
   63     63   
        input,
   64     64   
        "import sys; sys.modules['json_rpc11.input'] = input"
   65     65   
    );
   66     66   
    m.add_submodule(input)?;
   67     67   
    ::pyo3::py_run!(
   68     68   
        py,
   69     69   
        output,
   70     70   
        "import sys; sys.modules['json_rpc11.output'] = output"

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

@@ -1,1 +968,968 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Python handler for operation `ContentTypeParameters`.
    3         -
pub(crate) async fn content_type_parameters(
    4         -
    input: crate::input::ContentTypeParametersInput,
           2  +
/// Python handler for operation `EmptyOperation`.
           3  +
pub(crate) async fn empty_operation(
           4  +
    input: crate::input::EmptyOperationInput,
    5      5   
    state: ::aws_smithy_legacy_http_server::Extension<
    6      6   
        ::aws_smithy_http_server_python::context::PyContext,
    7      7   
    >,
    8      8   
    handler: ::aws_smithy_http_server_python::PyHandler,
    9         -
) -> std::result::Result<
   10         -
    crate::output::ContentTypeParametersOutput,
   11         -
    crate::error::ContentTypeParametersError,
   12         -
> {
           9  +
) -> std::result::Result<crate::output::EmptyOperationOutput, crate::error::EmptyOperationError> {
   13     10   
    // Async block used to run the handler and catch any Python error.
   14     11   
    let result = if handler.is_coroutine {
   15     12   
        ::tracing::trace!(
   16         -
            name = "content_type_parameters",
          13  +
            name = "empty_operation",
   17     14   
            "executing python handler coroutine"
   18     15   
        );
   19     16   
        let result = ::pyo3::Python::with_gil(|py| {
   20     17   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   21     18   
            let coroutine = if handler.args == 1 {
   22     19   
                pyhandler.call1((input,))?
   23     20   
            } else {
   24     21   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   25     22   
            };
   26     23   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   27     24   
        })?;
   28     25   
        result.await.and_then(|r| {
   29         -
            ::pyo3::Python::with_gil(|py| {
   30         -
                r.extract::<crate::output::ContentTypeParametersOutput>(py)
   31         -
            })
          26  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EmptyOperationOutput>(py))
   32     27   
        })
   33     28   
    } else {
   34     29   
        ::tracing::trace!(
   35         -
            name = "content_type_parameters",
          30  +
            name = "empty_operation",
   36     31   
            "executing python handler function"
   37     32   
        );
   38     33   
        ::pyo3::Python::with_gil(|py| {
   39     34   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   40     35   
            let output = if handler.args == 1 {
   41     36   
                pyhandler.call1((input,))?
   42     37   
            } else {
   43     38   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   44     39   
            };
   45         -
            output.extract::<crate::output::ContentTypeParametersOutput>()
          40  +
            output.extract::<crate::output::EmptyOperationOutput>()
   46     41   
        })
   47     42   
    };
   48     43   
    // Catch and record a Python traceback.
   49     44   
    result.map_err(|e| {
   50     45   
        let rich_py_err =
   51     46   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   52     47   
                e.clone_ref(py)
   53     48   
            }));
   54     49   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   55     50   
        e.into()
   56     51   
    })
   57     52   
}
   58     53   
   59         -
/// Python handler for operation `PutWithContentEncoding`.
   60         -
pub(crate) async fn put_with_content_encoding(
   61         -
    input: crate::input::PutWithContentEncodingInput,
          54  +
/// Python handler for operation `KitchenSinkOperation`.
          55  +
pub(crate) async fn kitchen_sink_operation(
          56  +
    input: crate::input::KitchenSinkOperationInput,
   62     57   
    state: ::aws_smithy_legacy_http_server::Extension<
   63     58   
        ::aws_smithy_http_server_python::context::PyContext,
   64     59   
    >,
   65     60   
    handler: ::aws_smithy_http_server_python::PyHandler,
   66     61   
) -> std::result::Result<
   67         -
    crate::output::PutWithContentEncodingOutput,
   68         -
    crate::error::PutWithContentEncodingError,
          62  +
    crate::output::KitchenSinkOperationOutput,
          63  +
    crate::error::KitchenSinkOperationError,
   69     64   
> {
   70     65   
    // Async block used to run the handler and catch any Python error.
   71     66   
    let result = if handler.is_coroutine {
   72     67   
        ::tracing::trace!(
   73         -
            name = "put_with_content_encoding",
          68  +
            name = "kitchen_sink_operation",
   74     69   
            "executing python handler coroutine"
   75     70   
        );
   76     71   
        let result = ::pyo3::Python::with_gil(|py| {
   77     72   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   78     73   
            let coroutine = if handler.args == 1 {
   79     74   
                pyhandler.call1((input,))?
   80     75   
            } else {
   81     76   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   82     77   
            };
   83     78   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   84     79   
        })?;
   85     80   
        result.await.and_then(|r| {
   86     81   
            ::pyo3::Python::with_gil(|py| {
   87         -
                r.extract::<crate::output::PutWithContentEncodingOutput>(py)
          82  +
                r.extract::<crate::output::KitchenSinkOperationOutput>(py)
   88     83   
            })
   89     84   
        })
   90     85   
    } else {
   91     86   
        ::tracing::trace!(
   92         -
            name = "put_with_content_encoding",
          87  +
            name = "kitchen_sink_operation",
   93     88   
            "executing python handler function"
   94     89   
        );
   95     90   
        ::pyo3::Python::with_gil(|py| {
   96     91   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   97     92   
            let output = if handler.args == 1 {
   98     93   
                pyhandler.call1((input,))?
   99     94   
            } else {
  100     95   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  101     96   
            };
  102         -
            output.extract::<crate::output::PutWithContentEncodingOutput>()
          97  +
            output.extract::<crate::output::KitchenSinkOperationOutput>()
  103     98   
        })
  104     99   
    };
  105    100   
    // Catch and record a Python traceback.
  106    101   
    result.map_err(|e| {
  107    102   
        let rich_py_err =
  108    103   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  109    104   
                e.clone_ref(py)
  110    105   
            }));
  111    106   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  112    107   
        e.into()
  113    108   
    })
  114    109   
}
  115    110   
  116         -
/// Python handler for operation `FractionalSeconds`.
  117         -
pub(crate) async fn fractional_seconds(
  118         -
    input: crate::input::FractionalSecondsInput,
         111  +
/// Python handler for operation `SimpleScalarProperties`.
         112  +
pub(crate) async fn simple_scalar_properties(
         113  +
    input: crate::input::SimpleScalarPropertiesInput,
  119    114   
    state: ::aws_smithy_legacy_http_server::Extension<
  120    115   
        ::aws_smithy_http_server_python::context::PyContext,
  121    116   
    >,
  122    117   
    handler: ::aws_smithy_http_server_python::PyHandler,
  123         -
) -> std::result::Result<crate::output::FractionalSecondsOutput, crate::error::FractionalSecondsError>
  124         -
{
         118  +
) -> std::result::Result<
         119  +
    crate::output::SimpleScalarPropertiesOutput,
         120  +
    crate::error::SimpleScalarPropertiesError,
         121  +
> {
  125    122   
    // Async block used to run the handler and catch any Python error.
  126    123   
    let result = if handler.is_coroutine {
  127    124   
        ::tracing::trace!(
  128         -
            name = "fractional_seconds",
         125  +
            name = "simple_scalar_properties",
  129    126   
            "executing python handler coroutine"
  130    127   
        );
  131    128   
        let result = ::pyo3::Python::with_gil(|py| {
  132    129   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  133    130   
            let coroutine = if handler.args == 1 {
  134    131   
                pyhandler.call1((input,))?
  135    132   
            } else {
  136    133   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  137    134   
            };
  138    135   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  139    136   
        })?;
  140    137   
        result.await.and_then(|r| {
  141         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::FractionalSecondsOutput>(py))
         138  +
            ::pyo3::Python::with_gil(|py| {
         139  +
                r.extract::<crate::output::SimpleScalarPropertiesOutput>(py)
         140  +
            })
  142    141   
        })
  143    142   
    } else {
  144    143   
        ::tracing::trace!(
  145         -
            name = "fractional_seconds",
         144  +
            name = "simple_scalar_properties",
  146    145   
            "executing python handler function"
  147    146   
        );
  148    147   
        ::pyo3::Python::with_gil(|py| {
  149    148   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  150    149   
            let output = if handler.args == 1 {
  151    150   
                pyhandler.call1((input,))?
  152    151   
            } else {
  153    152   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  154    153   
            };
  155         -
            output.extract::<crate::output::FractionalSecondsOutput>()
         154  +
            output.extract::<crate::output::SimpleScalarPropertiesOutput>()
  156    155   
        })
  157    156   
    };
  158    157   
    // Catch and record a Python traceback.
  159    158   
    result.map_err(|e| {
  160    159   
        let rich_py_err =
  161    160   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  162    161   
                e.clone_ref(py)
  163    162   
            }));
  164    163   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  165    164   
        e.into()
  166    165   
    })
  167    166   
}
  168    167   
  169         -
/// Python handler for operation `DatetimeOffsets`.
  170         -
pub(crate) async fn datetime_offsets(
  171         -
    input: crate::input::DatetimeOffsetsInput,
         168  +
/// Python handler for operation `OperationWithOptionalInputOutput`.
         169  +
pub(crate) async fn operation_with_optional_input_output(
         170  +
    input: crate::input::OperationWithOptionalInputOutputInput,
  172    171   
    state: ::aws_smithy_legacy_http_server::Extension<
  173    172   
        ::aws_smithy_http_server_python::context::PyContext,
  174    173   
    >,
  175    174   
    handler: ::aws_smithy_http_server_python::PyHandler,
  176         -
) -> std::result::Result<crate::output::DatetimeOffsetsOutput, crate::error::DatetimeOffsetsError> {
         175  +
) -> std::result::Result<
         176  +
    crate::output::OperationWithOptionalInputOutputOutput,
         177  +
    crate::error::OperationWithOptionalInputOutputError,
         178  +
> {
  177    179   
    // Async block used to run the handler and catch any Python error.
  178    180   
    let result = if handler.is_coroutine {
  179    181   
        ::tracing::trace!(
  180         -
            name = "datetime_offsets",
         182  +
            name = "operation_with_optional_input_output",
  181    183   
            "executing python handler coroutine"
  182    184   
        );
  183    185   
        let result = ::pyo3::Python::with_gil(|py| {
  184    186   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  185    187   
            let coroutine = if handler.args == 1 {
  186    188   
                pyhandler.call1((input,))?
  187    189   
            } else {
  188    190   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  189    191   
            };
  190    192   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  191    193   
        })?;
  192    194   
        result.await.and_then(|r| {
  193         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::DatetimeOffsetsOutput>(py))
         195  +
            ::pyo3::Python::with_gil(|py| {
         196  +
                r.extract::<crate::output::OperationWithOptionalInputOutputOutput>(py)
         197  +
            })
  194    198   
        })
  195    199   
    } else {
  196    200   
        ::tracing::trace!(
  197         -
            name = "datetime_offsets",
         201  +
            name = "operation_with_optional_input_output",
  198    202   
            "executing python handler function"
  199    203   
        );
  200    204   
        ::pyo3::Python::with_gil(|py| {
  201    205   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  202    206   
            let output = if handler.args == 1 {
  203    207   
                pyhandler.call1((input,))?
  204    208   
            } else {
  205    209   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  206    210   
            };
  207         -
            output.extract::<crate::output::DatetimeOffsetsOutput>()
         211  +
            output.extract::<crate::output::OperationWithOptionalInputOutputOutput>()
  208    212   
        })
  209    213   
    };
  210    214   
    // Catch and record a Python traceback.
  211    215   
    result.map_err(|e| {
  212    216   
        let rich_py_err =
  213    217   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  214    218   
                e.clone_ref(py)
  215    219   
            }));
  216    220   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  217    221   
        e.into()
  218    222   
    })
  219    223   
}
  220    224   
  221         -
/// Python handler for operation `HostWithPathOperation`.
  222         -
pub(crate) async fn host_with_path_operation(
  223         -
    input: crate::input::HostWithPathOperationInput,
         225  +
/// Python handler for operation `PutAndGetInlineDocuments`.
         226  +
pub(crate) async fn put_and_get_inline_documents(
         227  +
    input: crate::input::PutAndGetInlineDocumentsInput,
  224    228   
    state: ::aws_smithy_legacy_http_server::Extension<
  225    229   
        ::aws_smithy_http_server_python::context::PyContext,
  226    230   
    >,
  227    231   
    handler: ::aws_smithy_http_server_python::PyHandler,
  228    232   
) -> std::result::Result<
  229         -
    crate::output::HostWithPathOperationOutput,
  230         -
    crate::error::HostWithPathOperationError,
         233  +
    crate::output::PutAndGetInlineDocumentsOutput,
         234  +
    crate::error::PutAndGetInlineDocumentsError,
  231    235   
> {
  232    236   
    // Async block used to run the handler and catch any Python error.
  233    237   
    let result = if handler.is_coroutine {
  234    238   
        ::tracing::trace!(
  235         -
            name = "host_with_path_operation",
         239  +
            name = "put_and_get_inline_documents",
  236    240   
            "executing python handler coroutine"
  237    241   
        );
  238    242   
        let result = ::pyo3::Python::with_gil(|py| {
  239    243   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  240    244   
            let coroutine = if handler.args == 1 {
  241    245   
                pyhandler.call1((input,))?
  242    246   
            } else {
  243    247   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  244    248   
            };
  245    249   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  246    250   
        })?;
  247    251   
        result.await.and_then(|r| {
  248    252   
            ::pyo3::Python::with_gil(|py| {
  249         -
                r.extract::<crate::output::HostWithPathOperationOutput>(py)
         253  +
                r.extract::<crate::output::PutAndGetInlineDocumentsOutput>(py)
  250    254   
            })
  251    255   
        })
  252    256   
    } else {
  253    257   
        ::tracing::trace!(
  254         -
            name = "host_with_path_operation",
         258  +
            name = "put_and_get_inline_documents",
  255    259   
            "executing python handler function"
  256    260   
        );
  257    261   
        ::pyo3::Python::with_gil(|py| {
  258    262   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  259    263   
            let output = if handler.args == 1 {
  260    264   
                pyhandler.call1((input,))?
  261    265   
            } else {
  262    266   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  263    267   
            };
  264         -
            output.extract::<crate::output::HostWithPathOperationOutput>()
         268  +
            output.extract::<crate::output::PutAndGetInlineDocumentsOutput>()
  265    269   
        })
  266    270   
    };
  267    271   
    // Catch and record a Python traceback.
  268    272   
    result.map_err(|e| {
  269    273   
        let rich_py_err =
  270    274   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  271    275   
                e.clone_ref(py)
  272    276   
            }));
  273    277   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  274    278   
        e.into()
  275    279   
    })
  276    280   
}
  277    281   
  278         -
/// Python handler for operation `EndpointWithHostLabelOperation`.
  279         -
pub(crate) async fn endpoint_with_host_label_operation(
  280         -
    input: crate::input::EndpointWithHostLabelOperationInput,
         282  +
/// Python handler for operation `JsonEnums`.
         283  +
pub(crate) async fn json_enums(
         284  +
    input: crate::input::JsonEnumsInput,
  281    285   
    state: ::aws_smithy_legacy_http_server::Extension<
  282    286   
        ::aws_smithy_http_server_python::context::PyContext,
  283    287   
    >,
  284    288   
    handler: ::aws_smithy_http_server_python::PyHandler,
  285         -
) -> std::result::Result<
  286         -
    crate::output::EndpointWithHostLabelOperationOutput,
  287         -
    crate::error::EndpointWithHostLabelOperationError,
  288         -
> {
         289  +
) -> std::result::Result<crate::output::JsonEnumsOutput, crate::error::JsonEnumsError> {
  289    290   
    // Async block used to run the handler and catch any Python error.
  290    291   
    let result = if handler.is_coroutine {
  291         -
        ::tracing::trace!(
  292         -
            name = "endpoint_with_host_label_operation",
  293         -
            "executing python handler coroutine"
  294         -
        );
         292  +
        ::tracing::trace!(name = "json_enums", "executing python handler coroutine");
  295    293   
        let result = ::pyo3::Python::with_gil(|py| {
  296    294   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  297    295   
            let coroutine = if handler.args == 1 {
  298    296   
                pyhandler.call1((input,))?
  299    297   
            } else {
  300    298   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  301    299   
            };
  302    300   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  303    301   
        })?;
  304    302   
        result.await.and_then(|r| {
  305         -
            ::pyo3::Python::with_gil(|py| {
  306         -
                r.extract::<crate::output::EndpointWithHostLabelOperationOutput>(py)
  307         -
            })
         303  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonEnumsOutput>(py))
  308    304   
        })
  309    305   
    } else {
  310         -
        ::tracing::trace!(
  311         -
            name = "endpoint_with_host_label_operation",
  312         -
            "executing python handler function"
  313         -
        );
         306  +
        ::tracing::trace!(name = "json_enums", "executing python handler function");
  314    307   
        ::pyo3::Python::with_gil(|py| {
  315    308   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  316    309   
            let output = if handler.args == 1 {
  317    310   
                pyhandler.call1((input,))?
  318    311   
            } else {
  319    312   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  320    313   
            };
  321         -
            output.extract::<crate::output::EndpointWithHostLabelOperationOutput>()
         314  +
            output.extract::<crate::output::JsonEnumsOutput>()
  322    315   
        })
  323    316   
    };
  324    317   
    // Catch and record a Python traceback.
  325    318   
    result.map_err(|e| {
  326    319   
        let rich_py_err =
  327    320   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  328    321   
                e.clone_ref(py)
  329    322   
            }));
  330    323   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  331    324   
        e.into()
  332    325   
    })
  333    326   
}
  334    327   
  335         -
/// Python handler for operation `EndpointOperation`.
  336         -
pub(crate) async fn endpoint_operation(
  337         -
    input: crate::input::EndpointOperationInput,
         328  +
/// Python handler for operation `JsonIntEnums`.
         329  +
pub(crate) async fn json_int_enums(
         330  +
    input: crate::input::JsonIntEnumsInput,
  338    331   
    state: ::aws_smithy_legacy_http_server::Extension<
  339    332   
        ::aws_smithy_http_server_python::context::PyContext,
  340    333   
    >,
  341    334   
    handler: ::aws_smithy_http_server_python::PyHandler,
  342         -
) -> std::result::Result<crate::output::EndpointOperationOutput, crate::error::EndpointOperationError>
  343         -
{
         335  +
) -> std::result::Result<crate::output::JsonIntEnumsOutput, crate::error::JsonIntEnumsError> {
  344    336   
    // Async block used to run the handler and catch any Python error.
  345    337   
    let result = if handler.is_coroutine {
  346    338   
        ::tracing::trace!(
  347         -
            name = "endpoint_operation",
         339  +
            name = "json_int_enums",
  348    340   
            "executing python handler coroutine"
  349    341   
        );
  350    342   
        let result = ::pyo3::Python::with_gil(|py| {
  351    343   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  352    344   
            let coroutine = if handler.args == 1 {
  353    345   
                pyhandler.call1((input,))?
  354    346   
            } else {
  355    347   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  356    348   
            };
  357    349   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  358    350   
        })?;
  359    351   
        result.await.and_then(|r| {
  360         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EndpointOperationOutput>(py))
         352  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonIntEnumsOutput>(py))
  361    353   
        })
  362    354   
    } else {
  363         -
        ::tracing::trace!(
  364         -
            name = "endpoint_operation",
  365         -
            "executing python handler function"
  366         -
        );
         355  +
        ::tracing::trace!(name = "json_int_enums", "executing python handler function");
  367    356   
        ::pyo3::Python::with_gil(|py| {
  368    357   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  369    358   
            let output = if handler.args == 1 {
  370    359   
                pyhandler.call1((input,))?
  371    360   
            } else {
  372    361   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  373    362   
            };
  374         -
            output.extract::<crate::output::EndpointOperationOutput>()
         363  +
            output.extract::<crate::output::JsonIntEnumsOutput>()
  375    364   
        })
  376    365   
    };
  377    366   
    // Catch and record a Python traceback.
  378    367   
    result.map_err(|e| {
  379    368   
        let rich_py_err =
  380    369   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  381    370   
                e.clone_ref(py)
  382    371   
            }));
  383    372   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  384    373   
        e.into()
  385    374   
    })
  386    375   
}
  387    376   
  388         -
/// Python handler for operation `JsonUnions`.
  389         -
pub(crate) async fn json_unions(
  390         -
    input: crate::input::JsonUnionsInput,
         377  +
/// Python handler for operation `NullOperation`.
         378  +
pub(crate) async fn null_operation(
         379  +
    input: crate::input::NullOperationInput,
  391    380   
    state: ::aws_smithy_legacy_http_server::Extension<
  392    381   
        ::aws_smithy_http_server_python::context::PyContext,
  393    382   
    >,
  394    383   
    handler: ::aws_smithy_http_server_python::PyHandler,
  395         -
) -> std::result::Result<crate::output::JsonUnionsOutput, crate::error::JsonUnionsError> {
         384  +
) -> std::result::Result<crate::output::NullOperationOutput, crate::error::NullOperationError> {
  396    385   
    // Async block used to run the handler and catch any Python error.
  397    386   
    let result = if handler.is_coroutine {
  398         -
        ::tracing::trace!(name = "json_unions", "executing python handler coroutine");
         387  +
        ::tracing::trace!(
         388  +
            name = "null_operation",
         389  +
            "executing python handler coroutine"
         390  +
        );
  399    391   
        let result = ::pyo3::Python::with_gil(|py| {
  400    392   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  401    393   
            let coroutine = if handler.args == 1 {
  402    394   
                pyhandler.call1((input,))?
  403    395   
            } else {
  404    396   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  405    397   
            };
  406    398   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  407    399   
        })?;
  408    400   
        result.await.and_then(|r| {
  409         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonUnionsOutput>(py))
         401  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NullOperationOutput>(py))
  410    402   
        })
  411    403   
    } else {
  412         -
        ::tracing::trace!(name = "json_unions", "executing python handler function");
         404  +
        ::tracing::trace!(name = "null_operation", "executing python handler function");
  413    405   
        ::pyo3::Python::with_gil(|py| {
  414    406   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  415    407   
            let output = if handler.args == 1 {
  416    408   
                pyhandler.call1((input,))?
  417    409   
            } else {
  418    410   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  419    411   
            };
  420         -
            output.extract::<crate::output::JsonUnionsOutput>()
         412  +
            output.extract::<crate::output::NullOperationOutput>()
  421    413   
        })
  422    414   
    };
  423    415   
    // Catch and record a Python traceback.
  424    416   
    result.map_err(|e| {
  425    417   
        let rich_py_err =
  426    418   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  427    419   
                e.clone_ref(py)
  428    420   
            }));
  429    421   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  430    422   
        e.into()
  431    423   
    })
  432    424   
}
  433    425   
  434         -
/// Python handler for operation `GreetingWithErrors`.
  435         -
pub(crate) async fn greeting_with_errors(
  436         -
    input: crate::input::GreetingWithErrorsInput,
         426  +
/// Python handler for operation `SparseNullsOperation`.
         427  +
pub(crate) async fn sparse_nulls_operation(
         428  +
    input: crate::input::SparseNullsOperationInput,
  437    429   
    state: ::aws_smithy_legacy_http_server::Extension<
  438    430   
        ::aws_smithy_http_server_python::context::PyContext,
  439    431   
    >,
  440    432   
    handler: ::aws_smithy_http_server_python::PyHandler,
  441    433   
) -> std::result::Result<
  442         -
    crate::output::GreetingWithErrorsOutput,
  443         -
    crate::error::GreetingWithErrorsError,
         434  +
    crate::output::SparseNullsOperationOutput,
         435  +
    crate::error::SparseNullsOperationError,
  444    436   
> {
  445    437   
    // Async block used to run the handler and catch any Python error.
  446    438   
    let result = if handler.is_coroutine {
  447    439   
        ::tracing::trace!(
  448         -
            name = "greeting_with_errors",
         440  +
            name = "sparse_nulls_operation",
  449    441   
            "executing python handler coroutine"
  450    442   
        );
  451    443   
        let result = ::pyo3::Python::with_gil(|py| {
  452    444   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  453    445   
            let coroutine = if handler.args == 1 {
  454    446   
                pyhandler.call1((input,))?
  455    447   
            } else {
  456    448   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  457    449   
            };
  458    450   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  459    451   
        })?;
  460    452   
        result.await.and_then(|r| {
  461         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GreetingWithErrorsOutput>(py))
         453  +
            ::pyo3::Python::with_gil(|py| {
         454  +
                r.extract::<crate::output::SparseNullsOperationOutput>(py)
         455  +
            })
  462    456   
        })
  463    457   
    } else {
  464    458   
        ::tracing::trace!(
  465         -
            name = "greeting_with_errors",
         459  +
            name = "sparse_nulls_operation",
  466    460   
            "executing python handler function"
  467    461   
        );
  468    462   
        ::pyo3::Python::with_gil(|py| {
  469    463   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  470    464   
            let output = if handler.args == 1 {
  471    465   
                pyhandler.call1((input,))?
  472    466   
            } else {
  473    467   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  474    468   
            };
  475         -
            output.extract::<crate::output::GreetingWithErrorsOutput>()
         469  +
            output.extract::<crate::output::SparseNullsOperationOutput>()
  476    470   
        })
  477    471   
    };
  478    472   
    // Catch and record a Python traceback.
  479    473   
    result.map_err(|e| {
  480    474   
        let rich_py_err =
  481    475   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  482    476   
                e.clone_ref(py)
  483    477   
            }));
  484    478   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  485    479   
        e.into()
  486    480   
    })
  487    481   
}
  488    482   
  489         -
/// Python handler for operation `SparseNullsOperation`.
  490         -
pub(crate) async fn sparse_nulls_operation(
  491         -
    input: crate::input::SparseNullsOperationInput,
         483  +
/// Python handler for operation `GreetingWithErrors`.
         484  +
pub(crate) async fn greeting_with_errors(
         485  +
    input: crate::input::GreetingWithErrorsInput,
  492    486   
    state: ::aws_smithy_legacy_http_server::Extension<
  493    487   
        ::aws_smithy_http_server_python::context::PyContext,
  494    488   
    >,
  495    489   
    handler: ::aws_smithy_http_server_python::PyHandler,
  496    490   
) -> std::result::Result<
  497         -
    crate::output::SparseNullsOperationOutput,
  498         -
    crate::error::SparseNullsOperationError,
         491  +
    crate::output::GreetingWithErrorsOutput,
         492  +
    crate::error::GreetingWithErrorsError,
  499    493   
> {
  500    494   
    // Async block used to run the handler and catch any Python error.
  501    495   
    let result = if handler.is_coroutine {
  502    496   
        ::tracing::trace!(
  503         -
            name = "sparse_nulls_operation",
         497  +
            name = "greeting_with_errors",
  504    498   
            "executing python handler coroutine"
  505    499   
        );
  506    500   
        let result = ::pyo3::Python::with_gil(|py| {
  507    501   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  508    502   
            let coroutine = if handler.args == 1 {
  509    503   
                pyhandler.call1((input,))?
  510    504   
            } else {
  511    505   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  512    506   
            };
  513    507   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  514    508   
        })?;
  515    509   
        result.await.and_then(|r| {
  516         -
            ::pyo3::Python::with_gil(|py| {
  517         -
                r.extract::<crate::output::SparseNullsOperationOutput>(py)
  518         -
            })
         510  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::GreetingWithErrorsOutput>(py))
  519    511   
        })
  520    512   
    } else {
  521    513   
        ::tracing::trace!(
  522         -
            name = "sparse_nulls_operation",
         514  +
            name = "greeting_with_errors",
  523    515   
            "executing python handler function"
  524    516   
        );
  525    517   
        ::pyo3::Python::with_gil(|py| {
  526    518   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  527    519   
            let output = if handler.args == 1 {
  528    520   
                pyhandler.call1((input,))?
  529    521   
            } else {
  530    522   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  531    523   
            };
  532         -
            output.extract::<crate::output::SparseNullsOperationOutput>()
         524  +
            output.extract::<crate::output::GreetingWithErrorsOutput>()
  533    525   
        })
  534    526   
    };
  535    527   
    // Catch and record a Python traceback.
  536    528   
    result.map_err(|e| {
  537    529   
        let rich_py_err =
  538    530   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  539    531   
                e.clone_ref(py)
  540    532   
            }));
  541    533   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  542    534   
        e.into()
  543    535   
    })
  544    536   
}
  545    537   
  546         -
/// Python handler for operation `NullOperation`.
  547         -
pub(crate) async fn null_operation(
  548         -
    input: crate::input::NullOperationInput,
         538  +
/// Python handler for operation `JsonUnions`.
         539  +
pub(crate) async fn json_unions(
         540  +
    input: crate::input::JsonUnionsInput,
  549    541   
    state: ::aws_smithy_legacy_http_server::Extension<
  550    542   
        ::aws_smithy_http_server_python::context::PyContext,
  551    543   
    >,
  552    544   
    handler: ::aws_smithy_http_server_python::PyHandler,
  553         -
) -> std::result::Result<crate::output::NullOperationOutput, crate::error::NullOperationError> {
         545  +
) -> std::result::Result<crate::output::JsonUnionsOutput, crate::error::JsonUnionsError> {
  554    546   
    // Async block used to run the handler and catch any Python error.
  555    547   
    let result = if handler.is_coroutine {
  556         -
        ::tracing::trace!(
  557         -
            name = "null_operation",
  558         -
            "executing python handler coroutine"
  559         -
        );
         548  +
        ::tracing::trace!(name = "json_unions", "executing python handler coroutine");
  560    549   
        let result = ::pyo3::Python::with_gil(|py| {
  561    550   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  562    551   
            let coroutine = if handler.args == 1 {
  563    552   
                pyhandler.call1((input,))?
  564    553   
            } else {
  565    554   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  566    555   
            };
  567    556   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  568    557   
        })?;
  569    558   
        result.await.and_then(|r| {
  570         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NullOperationOutput>(py))
         559  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonUnionsOutput>(py))
  571    560   
        })
  572    561   
    } else {
  573         -
        ::tracing::trace!(name = "null_operation", "executing python handler function");
         562  +
        ::tracing::trace!(name = "json_unions", "executing python handler function");
  574    563   
        ::pyo3::Python::with_gil(|py| {
  575    564   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  576    565   
            let output = if handler.args == 1 {
  577    566   
                pyhandler.call1((input,))?
  578    567   
            } else {
  579    568   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  580    569   
            };
  581         -
            output.extract::<crate::output::NullOperationOutput>()
         570  +
            output.extract::<crate::output::JsonUnionsOutput>()
  582    571   
        })
  583    572   
    };
  584    573   
    // Catch and record a Python traceback.
  585    574   
    result.map_err(|e| {
  586    575   
        let rich_py_err =
  587    576   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  588    577   
                e.clone_ref(py)
  589    578   
            }));
  590    579   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  591    580   
        e.into()
  592    581   
    })
  593    582   
}
  594    583   
  595         -
/// Python handler for operation `JsonIntEnums`.
  596         -
pub(crate) async fn json_int_enums(
  597         -
    input: crate::input::JsonIntEnumsInput,
         584  +
/// Python handler for operation `EndpointOperation`.
         585  +
pub(crate) async fn endpoint_operation(
         586  +
    input: crate::input::EndpointOperationInput,
  598    587   
    state: ::aws_smithy_legacy_http_server::Extension<
  599    588   
        ::aws_smithy_http_server_python::context::PyContext,
  600    589   
    >,
  601    590   
    handler: ::aws_smithy_http_server_python::PyHandler,
  602         -
) -> std::result::Result<crate::output::JsonIntEnumsOutput, crate::error::JsonIntEnumsError> {
         591  +
) -> std::result::Result<crate::output::EndpointOperationOutput, crate::error::EndpointOperationError>
         592  +
{
  603    593   
    // Async block used to run the handler and catch any Python error.
  604    594   
    let result = if handler.is_coroutine {
  605    595   
        ::tracing::trace!(
  606         -
            name = "json_int_enums",
         596  +
            name = "endpoint_operation",
  607    597   
            "executing python handler coroutine"
  608    598   
        );
  609    599   
        let result = ::pyo3::Python::with_gil(|py| {
  610    600   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  611    601   
            let coroutine = if handler.args == 1 {
  612    602   
                pyhandler.call1((input,))?
  613    603   
            } else {
  614    604   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  615    605   
            };
  616    606   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  617    607   
        })?;
  618    608   
        result.await.and_then(|r| {
  619         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonIntEnumsOutput>(py))
         609  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EndpointOperationOutput>(py))
  620    610   
        })
  621    611   
    } else {
  622         -
        ::tracing::trace!(name = "json_int_enums", "executing python handler function");
         612  +
        ::tracing::trace!(
         613  +
            name = "endpoint_operation",
         614  +
            "executing python handler function"
         615  +
        );
  623    616   
        ::pyo3::Python::with_gil(|py| {
  624    617   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  625    618   
            let output = if handler.args == 1 {
  626    619   
                pyhandler.call1((input,))?
  627    620   
            } else {
  628    621   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  629    622   
            };
  630         -
            output.extract::<crate::output::JsonIntEnumsOutput>()
         623  +
            output.extract::<crate::output::EndpointOperationOutput>()
  631    624   
        })
  632    625   
    };
  633    626   
    // Catch and record a Python traceback.
  634    627   
    result.map_err(|e| {
  635    628   
        let rich_py_err =
  636    629   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  637    630   
                e.clone_ref(py)
  638    631   
            }));
  639    632   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  640    633   
        e.into()
  641    634   
    })
  642    635   
}
  643    636   
  644         -
/// Python handler for operation `JsonEnums`.
  645         -
pub(crate) async fn json_enums(
  646         -
    input: crate::input::JsonEnumsInput,
         637  +
/// Python handler for operation `EndpointWithHostLabelOperation`.
         638  +
pub(crate) async fn endpoint_with_host_label_operation(
         639  +
    input: crate::input::EndpointWithHostLabelOperationInput,
  647    640   
    state: ::aws_smithy_legacy_http_server::Extension<
  648    641   
        ::aws_smithy_http_server_python::context::PyContext,
  649    642   
    >,
  650    643   
    handler: ::aws_smithy_http_server_python::PyHandler,
  651         -
) -> std::result::Result<crate::output::JsonEnumsOutput, crate::error::JsonEnumsError> {
         644  +
) -> std::result::Result<
         645  +
    crate::output::EndpointWithHostLabelOperationOutput,
         646  +
    crate::error::EndpointWithHostLabelOperationError,
         647  +
> {
  652    648   
    // Async block used to run the handler and catch any Python error.
  653    649   
    let result = if handler.is_coroutine {
  654         -
        ::tracing::trace!(name = "json_enums", "executing python handler coroutine");
         650  +
        ::tracing::trace!(
         651  +
            name = "endpoint_with_host_label_operation",
         652  +
            "executing python handler coroutine"
         653  +
        );
  655    654   
        let result = ::pyo3::Python::with_gil(|py| {
  656    655   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  657    656   
            let coroutine = if handler.args == 1 {
  658    657   
                pyhandler.call1((input,))?
  659    658   
            } else {
  660    659   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  661    660   
            };
  662    661   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  663    662   
        })?;
  664    663   
        result.await.and_then(|r| {
  665         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::JsonEnumsOutput>(py))
         664  +
            ::pyo3::Python::with_gil(|py| {
         665  +
                r.extract::<crate::output::EndpointWithHostLabelOperationOutput>(py)
         666  +
            })
  666    667   
        })
  667    668   
    } else {
  668         -
        ::tracing::trace!(name = "json_enums", "executing python handler function");
         669  +
        ::tracing::trace!(
         670  +
            name = "endpoint_with_host_label_operation",
         671  +
            "executing python handler function"
         672  +
        );
  669    673   
        ::pyo3::Python::with_gil(|py| {
  670    674   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  671    675   
            let output = if handler.args == 1 {
  672    676   
                pyhandler.call1((input,))?
  673    677   
            } else {
  674    678   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  675    679   
            };
  676         -
            output.extract::<crate::output::JsonEnumsOutput>()
         680  +
            output.extract::<crate::output::EndpointWithHostLabelOperationOutput>()
  677    681   
        })
  678    682   
    };
  679    683   
    // Catch and record a Python traceback.
  680    684   
    result.map_err(|e| {
  681    685   
        let rich_py_err =
  682    686   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  683    687   
                e.clone_ref(py)
  684    688   
            }));
  685    689   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  686    690   
        e.into()
  687    691   
    })
  688    692   
}
  689    693   
  690         -
/// Python handler for operation `PutAndGetInlineDocuments`.
  691         -
pub(crate) async fn put_and_get_inline_documents(
  692         -
    input: crate::input::PutAndGetInlineDocumentsInput,
         694  +
/// Python handler for operation `HostWithPathOperation`.
         695  +
pub(crate) async fn host_with_path_operation(
         696  +
    input: crate::input::HostWithPathOperationInput,
  693    697   
    state: ::aws_smithy_legacy_http_server::Extension<
  694    698   
        ::aws_smithy_http_server_python::context::PyContext,
  695    699   
    >,
  696    700   
    handler: ::aws_smithy_http_server_python::PyHandler,
  697    701   
) -> std::result::Result<
  698         -
    crate::output::PutAndGetInlineDocumentsOutput,
  699         -
    crate::error::PutAndGetInlineDocumentsError,
         702  +
    crate::output::HostWithPathOperationOutput,
         703  +
    crate::error::HostWithPathOperationError,
  700    704   
> {
  701    705   
    // Async block used to run the handler and catch any Python error.
  702    706   
    let result = if handler.is_coroutine {
  703    707   
        ::tracing::trace!(
  704         -
            name = "put_and_get_inline_documents",
         708  +
            name = "host_with_path_operation",
  705    709   
            "executing python handler coroutine"
  706    710   
        );
  707    711   
        let result = ::pyo3::Python::with_gil(|py| {
  708    712   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  709    713   
            let coroutine = if handler.args == 1 {
  710    714   
                pyhandler.call1((input,))?
  711    715   
            } else {
  712    716   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  713    717   
            };
  714    718   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  715    719   
        })?;
  716    720   
        result.await.and_then(|r| {
  717    721   
            ::pyo3::Python::with_gil(|py| {
  718         -
                r.extract::<crate::output::PutAndGetInlineDocumentsOutput>(py)
         722  +
                r.extract::<crate::output::HostWithPathOperationOutput>(py)
  719    723   
            })
  720    724   
        })
  721    725   
    } else {
  722    726   
        ::tracing::trace!(
  723         -
            name = "put_and_get_inline_documents",
         727  +
            name = "host_with_path_operation",
  724    728   
            "executing python handler function"
  725    729   
        );
  726    730   
        ::pyo3::Python::with_gil(|py| {
  727    731   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  728    732   
            let output = if handler.args == 1 {
  729    733   
                pyhandler.call1((input,))?
  730    734   
            } else {
  731    735   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  732    736   
            };
  733         -
            output.extract::<crate::output::PutAndGetInlineDocumentsOutput>()
         737  +
            output.extract::<crate::output::HostWithPathOperationOutput>()
  734    738   
        })
  735    739   
    };
  736    740   
    // Catch and record a Python traceback.
  737    741   
    result.map_err(|e| {
  738    742   
        let rich_py_err =
  739    743   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  740    744   
                e.clone_ref(py)
  741    745   
            }));
  742    746   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  743    747   
        e.into()
  744    748   
    })
  745    749   
}
  746    750   
  747         -
/// Python handler for operation `OperationWithOptionalInputOutput`.
  748         -
pub(crate) async fn operation_with_optional_input_output(
  749         -
    input: crate::input::OperationWithOptionalInputOutputInput,
         751  +
/// Python handler for operation `DatetimeOffsets`.
         752  +
pub(crate) async fn datetime_offsets(
         753  +
    input: crate::input::DatetimeOffsetsInput,
  750    754   
    state: ::aws_smithy_legacy_http_server::Extension<
  751    755   
        ::aws_smithy_http_server_python::context::PyContext,
  752    756   
    >,
  753    757   
    handler: ::aws_smithy_http_server_python::PyHandler,
  754         -
) -> std::result::Result<
  755         -
    crate::output::OperationWithOptionalInputOutputOutput,
  756         -
    crate::error::OperationWithOptionalInputOutputError,
  757         -
> {
         758  +
) -> std::result::Result<crate::output::DatetimeOffsetsOutput, crate::error::DatetimeOffsetsError> {
  758    759   
    // Async block used to run the handler and catch any Python error.
  759    760   
    let result = if handler.is_coroutine {
  760    761   
        ::tracing::trace!(
  761         -
            name = "operation_with_optional_input_output",
         762  +
            name = "datetime_offsets",
  762    763   
            "executing python handler coroutine"
  763    764   
        );
  764    765   
        let result = ::pyo3::Python::with_gil(|py| {
  765    766   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  766    767   
            let coroutine = if handler.args == 1 {
  767    768   
                pyhandler.call1((input,))?
  768    769   
            } else {
  769    770   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  770    771   
            };
  771    772   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  772    773   
        })?;
  773    774   
        result.await.and_then(|r| {
  774         -
            ::pyo3::Python::with_gil(|py| {
  775         -
                r.extract::<crate::output::OperationWithOptionalInputOutputOutput>(py)
  776         -
            })
         775  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::DatetimeOffsetsOutput>(py))
  777    776   
        })
  778    777   
    } else {
  779    778   
        ::tracing::trace!(
  780         -
            name = "operation_with_optional_input_output",
         779  +
            name = "datetime_offsets",
  781    780   
            "executing python handler function"
  782    781   
        );
  783    782   
        ::pyo3::Python::with_gil(|py| {
  784    783   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  785    784   
            let output = if handler.args == 1 {
  786    785   
                pyhandler.call1((input,))?
  787    786   
            } else {
  788    787   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  789    788   
            };
  790         -
            output.extract::<crate::output::OperationWithOptionalInputOutputOutput>()
         789  +
            output.extract::<crate::output::DatetimeOffsetsOutput>()
  791    790   
        })
  792    791   
    };
  793    792   
    // Catch and record a Python traceback.
  794    793   
    result.map_err(|e| {
  795    794   
        let rich_py_err =
  796    795   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  797    796   
                e.clone_ref(py)
  798    797   
            }));
  799    798   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  800    799   
        e.into()
  801    800   
    })
  802    801   
}
  803    802   
  804         -
/// Python handler for operation `SimpleScalarProperties`.
  805         -
pub(crate) async fn simple_scalar_properties(
  806         -
    input: crate::input::SimpleScalarPropertiesInput,
         803  +
/// Python handler for operation `FractionalSeconds`.
         804  +
pub(crate) async fn fractional_seconds(
         805  +
    input: crate::input::FractionalSecondsInput,
  807    806   
    state: ::aws_smithy_legacy_http_server::Extension<
  808    807   
        ::aws_smithy_http_server_python::context::PyContext,
  809    808   
    >,
  810    809   
    handler: ::aws_smithy_http_server_python::PyHandler,
  811         -
) -> std::result::Result<
  812         -
    crate::output::SimpleScalarPropertiesOutput,
  813         -
    crate::error::SimpleScalarPropertiesError,
  814         -
> {
         810  +
) -> std::result::Result<crate::output::FractionalSecondsOutput, crate::error::FractionalSecondsError>
         811  +
{
  815    812   
    // Async block used to run the handler and catch any Python error.
  816    813   
    let result = if handler.is_coroutine {
  817    814   
        ::tracing::trace!(
  818         -
            name = "simple_scalar_properties",
         815  +
            name = "fractional_seconds",
  819    816   
            "executing python handler coroutine"
  820    817   
        );
  821    818   
        let result = ::pyo3::Python::with_gil(|py| {
  822    819   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  823    820   
            let coroutine = if handler.args == 1 {
  824    821   
                pyhandler.call1((input,))?
  825    822   
            } else {
  826    823   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  827    824   
            };
  828    825   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  829    826   
        })?;
  830    827   
        result.await.and_then(|r| {
  831         -
            ::pyo3::Python::with_gil(|py| {
  832         -
                r.extract::<crate::output::SimpleScalarPropertiesOutput>(py)
  833         -
            })
         828  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::FractionalSecondsOutput>(py))
  834    829   
        })
  835    830   
    } else {
  836    831   
        ::tracing::trace!(
  837         -
            name = "simple_scalar_properties",
         832  +
            name = "fractional_seconds",
  838    833   
            "executing python handler function"
  839    834   
        );
  840    835   
        ::pyo3::Python::with_gil(|py| {
  841    836   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  842    837   
            let output = if handler.args == 1 {
  843    838   
                pyhandler.call1((input,))?
  844    839   
            } else {
  845    840   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  846    841   
            };
  847         -
            output.extract::<crate::output::SimpleScalarPropertiesOutput>()
         842  +
            output.extract::<crate::output::FractionalSecondsOutput>()
  848    843   
        })
  849    844   
    };
  850    845   
    // Catch and record a Python traceback.
  851    846   
    result.map_err(|e| {
  852    847   
        let rich_py_err =
  853    848   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  854    849   
                e.clone_ref(py)
  855    850   
            }));
  856    851   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  857    852   
        e.into()
  858    853   
    })
  859    854   
}
  860    855   
  861         -
/// Python handler for operation `KitchenSinkOperation`.
  862         -
pub(crate) async fn kitchen_sink_operation(
  863         -
    input: crate::input::KitchenSinkOperationInput,
         856  +
/// Python handler for operation `PutWithContentEncoding`.
         857  +
pub(crate) async fn put_with_content_encoding(
         858  +
    input: crate::input::PutWithContentEncodingInput,
  864    859   
    state: ::aws_smithy_legacy_http_server::Extension<
  865    860   
        ::aws_smithy_http_server_python::context::PyContext,
  866    861   
    >,
  867    862   
    handler: ::aws_smithy_http_server_python::PyHandler,
  868    863   
) -> std::result::Result<
  869         -
    crate::output::KitchenSinkOperationOutput,
  870         -
    crate::error::KitchenSinkOperationError,
         864  +
    crate::output::PutWithContentEncodingOutput,
         865  +
    crate::error::PutWithContentEncodingError,
  871    866   
> {
  872    867   
    // Async block used to run the handler and catch any Python error.
  873    868   
    let result = if handler.is_coroutine {
  874    869   
        ::tracing::trace!(
  875         -
            name = "kitchen_sink_operation",
         870  +
            name = "put_with_content_encoding",
  876    871   
            "executing python handler coroutine"
  877    872   
        );
  878    873   
        let result = ::pyo3::Python::with_gil(|py| {
  879    874   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  880    875   
            let coroutine = if handler.args == 1 {
  881    876   
                pyhandler.call1((input,))?
  882    877   
            } else {
  883    878   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  884    879   
            };
  885    880   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  886    881   
        })?;
  887    882   
        result.await.and_then(|r| {
  888    883   
            ::pyo3::Python::with_gil(|py| {
  889         -
                r.extract::<crate::output::KitchenSinkOperationOutput>(py)
         884  +
                r.extract::<crate::output::PutWithContentEncodingOutput>(py)
  890    885   
            })
  891    886   
        })
  892    887   
    } else {
  893    888   
        ::tracing::trace!(
  894         -
            name = "kitchen_sink_operation",
         889  +
            name = "put_with_content_encoding",
  895    890   
            "executing python handler function"
  896    891   
        );
  897    892   
        ::pyo3::Python::with_gil(|py| {
  898    893   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  899    894   
            let output = if handler.args == 1 {
  900    895   
                pyhandler.call1((input,))?
  901    896   
            } else {
  902    897   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  903    898   
            };
  904         -
            output.extract::<crate::output::KitchenSinkOperationOutput>()
         899  +
            output.extract::<crate::output::PutWithContentEncodingOutput>()
  905    900   
        })
  906    901   
    };
  907    902   
    // Catch and record a Python traceback.
  908    903   
    result.map_err(|e| {
  909    904   
        let rich_py_err =
  910    905   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  911    906   
                e.clone_ref(py)
  912    907   
            }));
  913    908   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  914    909   
        e.into()
  915    910   
    })
  916    911   
}
  917    912   
  918         -
/// Python handler for operation `EmptyOperation`.
  919         -
pub(crate) async fn empty_operation(
  920         -
    input: crate::input::EmptyOperationInput,
         913  +
/// Python handler for operation `ContentTypeParameters`.
         914  +
pub(crate) async fn content_type_parameters(
         915  +
    input: crate::input::ContentTypeParametersInput,
  921    916   
    state: ::aws_smithy_legacy_http_server::Extension<
  922    917   
        ::aws_smithy_http_server_python::context::PyContext,
  923    918   
    >,
  924    919   
    handler: ::aws_smithy_http_server_python::PyHandler,
  925         -
) -> std::result::Result<crate::output::EmptyOperationOutput, crate::error::EmptyOperationError> {
         920  +
) -> std::result::Result<
         921  +
    crate::output::ContentTypeParametersOutput,
         922  +
    crate::error::ContentTypeParametersError,
         923  +
> {
  926    924   
    // Async block used to run the handler and catch any Python error.
  927    925   
    let result = if handler.is_coroutine {
  928    926   
        ::tracing::trace!(
  929         -
            name = "empty_operation",
         927  +
            name = "content_type_parameters",
  930    928   
            "executing python handler coroutine"
  931    929   
        );
  932    930   
        let result = ::pyo3::Python::with_gil(|py| {
  933    931   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  934    932   
            let coroutine = if handler.args == 1 {
  935    933   
                pyhandler.call1((input,))?
  936    934   
            } else {
  937    935   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  938    936   
            };
  939    937   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  940    938   
        })?;
  941    939   
        result.await.and_then(|r| {
  942         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EmptyOperationOutput>(py))
         940  +
            ::pyo3::Python::with_gil(|py| {
         941  +
                r.extract::<crate::output::ContentTypeParametersOutput>(py)
         942  +
            })
  943    943   
        })
  944    944   
    } else {
  945    945   
        ::tracing::trace!(
  946         -
            name = "empty_operation",
         946  +
            name = "content_type_parameters",
  947    947   
            "executing python handler function"
  948    948   
        );
  949    949   
        ::pyo3::Python::with_gil(|py| {
  950    950   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  951    951   
            let output = if handler.args == 1 {
  952    952   
                pyhandler.call1((input,))?
  953    953   
            } else {
  954    954   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  955    955   
            };
  956         -
            output.extract::<crate::output::EmptyOperationOutput>()
         956  +
            output.extract::<crate::output::ContentTypeParametersOutput>()
  957    957   
        })
  958    958   
    };
  959    959   
    // Catch and record a Python traceback.
  960    960   
    result.map_err(|e| {
  961    961   
        let rich_py_err =
  962    962   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  963    963   
                e.clone_ref(py)
  964    964   
            }));
  965    965   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  966    966   
        e.into()

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

@@ -1,1 +202,201 @@
    4      4   
    type Unconstrained = crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained;
    5      5   
}
    6      6   
    7      7   
impl From<crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained>
    8      8   
    for crate::constrained::MaybeConstrained<crate::model::MyUnion>
    9      9   
{
   10     10   
    fn from(value: crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained) -> Self {
   11     11   
        Self::Unconstrained(value)
   12     12   
    }
   13     13   
}
          14  +
pub(crate) mod foo_enum_list_unconstrained {
   14     15   
   15         -
pub(crate) mod my_union_unconstrained {
   16         -
   17         -
    #[allow(clippy::enum_variant_names)]
   18     16   
    #[derive(Debug, Clone)]
   19         -
    pub(crate) enum MyUnionUnconstrained {
   20         -
        BlobValue(::aws_smithy_http_server_python::types::Blob),
   21         -
        BooleanValue(bool),
   22         -
        EnumValue(::std::string::String),
   23         -
        ListValue(::std::vec::Vec<::std::string::String>),
   24         -
        MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
   25         -
        NumberValue(i32),
   26         -
        StringValue(::std::string::String),
   27         -
        StructureValue(crate::model::GreetingStruct),
   28         -
        TimestampValue(::aws_smithy_http_server_python::types::DateTime),
   29         -
    }
   30         -
    impl ::std::convert::TryFrom<MyUnionUnconstrained> for crate::model::MyUnion {
   31         -
        type Error = crate::model::my_union_internal::ConstraintViolation;
          17  +
    pub(crate) struct FooEnumListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
   32     18   
   33         -
        fn try_from(value: MyUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
   34         -
            Ok(
   35         -
        match value {
   36         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(unconstrained) => Self::BlobValue(
   37         -
                unconstrained
   38         -
            ),
   39         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(unconstrained) => Self::BooleanValue(
   40         -
                unconstrained
   41         -
            ),
   42         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(unconstrained) => Self::EnumValue(
   43         -
                unconstrained
   44         -
                                        .try_into()
   45         -
                                        
   46         -
                                        
   47         -
                                        .map_err(Self::Error::EnumValue)?
   48         -
            ),
   49         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(unconstrained) => Self::ListValue(
   50         -
                unconstrained
   51         -
            ),
   52         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(unconstrained) => Self::MapValue(
   53         -
                unconstrained
   54         -
            ),
   55         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(unconstrained) => Self::NumberValue(
   56         -
                unconstrained
   57         -
            ),
   58         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(unconstrained) => Self::StringValue(
   59         -
                unconstrained
   60         -
            ),
   61         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(unconstrained) => Self::StructureValue(
   62         -
                unconstrained
   63         -
            ),
   64         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(unconstrained) => Self::TimestampValue(
   65         -
                unconstrained
   66         -
            ),
          19  +
    impl From<FooEnumListUnconstrained>
          20  +
        for crate::constrained::MaybeConstrained<
          21  +
            crate::constrained::foo_enum_list_constrained::FooEnumListConstrained,
          22  +
        >
          23  +
    {
          24  +
        fn from(value: FooEnumListUnconstrained) -> Self {
          25  +
            Self::Unconstrained(value)
   67     26   
        }
   68         -
    )
          27  +
    }
          28  +
    impl std::convert::TryFrom<FooEnumListUnconstrained>
          29  +
        for crate::constrained::foo_enum_list_constrained::FooEnumListConstrained
          30  +
    {
          31  +
        type Error = crate::model::foo_enum_list_internal::ConstraintViolation;
          32  +
        fn try_from(value: FooEnumListUnconstrained) -> std::result::Result<Self, Self::Error> {
          33  +
            let res: ::std::result::Result<
          34  +
                ::std::vec::Vec<crate::model::FooEnum>,
          35  +
                (usize, crate::model::foo_enum_internal::ConstraintViolation),
          36  +
            > = value
          37  +
                .0
          38  +
                .into_iter()
          39  +
                .enumerate()
          40  +
                .map(|(idx, inner)| {
          41  +
                    inner
          42  +
                        .try_into()
          43  +
                        .map_err(|inner_violation| (idx, inner_violation))
          44  +
                })
          45  +
                .collect();
          46  +
            let inner =
          47  +
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
          48  +
            Ok(Self(inner))
   69     49   
        }
   70     50   
    }
   71     51   
}
   72         -
pub(crate) mod integer_enum_set_unconstrained {
          52  +
pub(crate) mod foo_enum_set_unconstrained {
   73     53   
   74     54   
    #[derive(Debug, Clone)]
   75         -
    pub(crate) struct IntegerEnumSetUnconstrained(pub(crate) std::vec::Vec<i32>);
          55  +
    pub(crate) struct FooEnumSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
   76     56   
   77         -
    impl From<IntegerEnumSetUnconstrained>
   78         -
        for crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>
          57  +
    impl From<FooEnumSetUnconstrained>
          58  +
        for crate::constrained::MaybeConstrained<crate::model::FooEnumSet>
   79     59   
    {
   80         -
        fn from(value: IntegerEnumSetUnconstrained) -> Self {
          60  +
        fn from(value: FooEnumSetUnconstrained) -> Self {
   81     61   
            Self::Unconstrained(value)
   82     62   
        }
   83     63   
    }
   84         -
    impl std::convert::TryFrom<IntegerEnumSetUnconstrained> for crate::model::IntegerEnumSet {
   85         -
        type Error = crate::model::integer_enum_set_internal::ConstraintViolation;
   86         -
        fn try_from(value: IntegerEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
   87         -
            let inner = value.0;
          64  +
    impl std::convert::TryFrom<FooEnumSetUnconstrained> for crate::model::FooEnumSet {
          65  +
        type Error = crate::model::foo_enum_set_internal::ConstraintViolation;
          66  +
        fn try_from(value: FooEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
          67  +
            let res: ::std::result::Result<
          68  +
                ::std::vec::Vec<crate::model::FooEnum>,
          69  +
                (usize, crate::model::foo_enum_internal::ConstraintViolation),
          70  +
            > = value
          71  +
                .0
          72  +
                .into_iter()
          73  +
                .enumerate()
          74  +
                .map(|(idx, inner)| {
          75  +
                    inner
          76  +
                        .try_into()
          77  +
                        .map_err(|inner_violation| (idx, inner_violation))
          78  +
                })
          79  +
                .collect();
          80  +
            let inner =
          81  +
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
   88     82   
            Self::try_from(inner)
   89     83   
        }
   90     84   
    }
   91     85   
}
   92     86   
pub(crate) mod foo_enum_map_unconstrained {
   93     87   
   94     88   
    #[derive(Debug, Clone)]
   95     89   
    pub(crate) struct FooEnumMapUnconstrained(
   96     90   
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
   97     91   
    );
   98     92   
   99     93   
    impl From<FooEnumMapUnconstrained>
  100     94   
        for crate::constrained::MaybeConstrained<
  101     95   
            crate::constrained::foo_enum_map_constrained::FooEnumMapConstrained,
  102     96   
        >
  103     97   
    {
  104     98   
        fn from(value: FooEnumMapUnconstrained) -> Self {
  105     99   
            Self::Unconstrained(value)
  106    100   
        }
  107    101   
    }
  108    102   
    impl std::convert::TryFrom<FooEnumMapUnconstrained>
  109    103   
        for crate::constrained::foo_enum_map_constrained::FooEnumMapConstrained
  110    104   
    {
  111    105   
        type Error = crate::model::foo_enum_map_internal::ConstraintViolation;
  112    106   
        fn try_from(value: FooEnumMapUnconstrained) -> std::result::Result<Self, Self::Error> {
  113    107   
            let res: ::std::result::Result<
  114    108   
                ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
  115    109   
                Self::Error,
  116    110   
            > = value
  117    111   
                .0
  118    112   
                .into_iter()
  119    113   
                .map(|(k, v)| match crate::model::FooEnum::try_from(v) {
  120    114   
                    Ok(v) => Ok((k, v)),
  121    115   
                    Err(inner_constraint_violation) => {
  122    116   
                        Err(Self::Error::Value(k, inner_constraint_violation))
  123    117   
                    }
  124    118   
                })
  125    119   
                .collect();
  126    120   
            let hm = res?;
  127    121   
            Ok(Self(hm))
  128    122   
        }
  129    123   
    }
  130    124   
}
  131         -
pub(crate) mod foo_enum_set_unconstrained {
         125  +
pub(crate) mod integer_enum_set_unconstrained {
  132    126   
  133    127   
    #[derive(Debug, Clone)]
  134         -
    pub(crate) struct FooEnumSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
         128  +
    pub(crate) struct IntegerEnumSetUnconstrained(pub(crate) std::vec::Vec<i32>);
  135    129   
  136         -
    impl From<FooEnumSetUnconstrained>
  137         -
        for crate::constrained::MaybeConstrained<crate::model::FooEnumSet>
         130  +
    impl From<IntegerEnumSetUnconstrained>
         131  +
        for crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>
  138    132   
    {
  139         -
        fn from(value: FooEnumSetUnconstrained) -> Self {
         133  +
        fn from(value: IntegerEnumSetUnconstrained) -> Self {
  140    134   
            Self::Unconstrained(value)
  141    135   
        }
  142    136   
    }
  143         -
    impl std::convert::TryFrom<FooEnumSetUnconstrained> for crate::model::FooEnumSet {
  144         -
        type Error = crate::model::foo_enum_set_internal::ConstraintViolation;
  145         -
        fn try_from(value: FooEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
  146         -
            let res: ::std::result::Result<
  147         -
                ::std::vec::Vec<crate::model::FooEnum>,
  148         -
                (usize, crate::model::foo_enum_internal::ConstraintViolation),
  149         -
            > = value
  150         -
                .0
  151         -
                .into_iter()
  152         -
                .enumerate()
  153         -
                .map(|(idx, inner)| {
  154         -
                    inner
  155         -
                        .try_into()
  156         -
                        .map_err(|inner_violation| (idx, inner_violation))
  157         -
                })
  158         -
                .collect();
  159         -
            let inner =
  160         -
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         137  +
    impl std::convert::TryFrom<IntegerEnumSetUnconstrained> for crate::model::IntegerEnumSet {
         138  +
        type Error = crate::model::integer_enum_set_internal::ConstraintViolation;
         139  +
        fn try_from(value: IntegerEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         140  +
            let inner = value.0;
  161    141   
            Self::try_from(inner)
  162    142   
        }
  163    143   
    }
  164    144   
}
  165         -
pub(crate) mod foo_enum_list_unconstrained {
         145  +
pub(crate) mod my_union_unconstrained {
  166    146   
         147  +
    #[allow(clippy::enum_variant_names)]
  167    148   
    #[derive(Debug, Clone)]
  168         -
    pub(crate) struct FooEnumListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
         149  +
    pub(crate) enum MyUnionUnconstrained {
         150  +
        BlobValue(::aws_smithy_http_server_python::types::Blob),
         151  +
        BooleanValue(bool),
         152  +
        EnumValue(::std::string::String),
         153  +
        ListValue(::std::vec::Vec<::std::string::String>),
         154  +
        MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
         155  +
        NumberValue(i32),
         156  +
        StringValue(::std::string::String),
         157  +
        StructureValue(crate::model::GreetingStruct),
         158  +
        TimestampValue(::aws_smithy_http_server_python::types::DateTime),
         159  +
    }
         160  +
    impl ::std::convert::TryFrom<MyUnionUnconstrained> for crate::model::MyUnion {
         161  +
        type Error = crate::model::my_union_internal::ConstraintViolation;
  169    162   
  170         -
    impl From<FooEnumListUnconstrained>
  171         -
        for crate::constrained::MaybeConstrained<
  172         -
            crate::constrained::foo_enum_list_constrained::FooEnumListConstrained,
  173         -
        >
  174         -
    {
  175         -
        fn from(value: FooEnumListUnconstrained) -> Self {
  176         -
            Self::Unconstrained(value)
         163  +
        fn try_from(value: MyUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
         164  +
            Ok(
         165  +
        match value {
         166  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(unconstrained) => Self::BlobValue(
         167  +
                unconstrained
         168  +
            ),
         169  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(unconstrained) => Self::BooleanValue(
         170  +
                unconstrained
         171  +
            ),
         172  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(unconstrained) => Self::EnumValue(
         173  +
                unconstrained
         174  +
                                        .try_into()
         175  +
                                        
         176  +
                                        
         177  +
                                        .map_err(Self::Error::EnumValue)?
         178  +
            ),
         179  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(unconstrained) => Self::ListValue(
         180  +
                unconstrained
         181  +
            ),
         182  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(unconstrained) => Self::MapValue(
         183  +
                unconstrained
         184  +
            ),
         185  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(unconstrained) => Self::NumberValue(
         186  +
                unconstrained
         187  +
            ),
         188  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(unconstrained) => Self::StringValue(
         189  +
                unconstrained
         190  +
            ),
         191  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(unconstrained) => Self::StructureValue(
         192  +
                unconstrained
         193  +
            ),
         194  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(unconstrained) => Self::TimestampValue(
         195  +
                unconstrained
         196  +
            ),
  177    197   
        }
  178         -
    }
  179         -
    impl std::convert::TryFrom<FooEnumListUnconstrained>
  180         -
        for crate::constrained::foo_enum_list_constrained::FooEnumListConstrained
  181         -
    {
  182         -
        type Error = crate::model::foo_enum_list_internal::ConstraintViolation;
  183         -
        fn try_from(value: FooEnumListUnconstrained) -> std::result::Result<Self, Self::Error> {
  184         -
            let res: ::std::result::Result<
  185         -
                ::std::vec::Vec<crate::model::FooEnum>,
  186         -
                (usize, crate::model::foo_enum_internal::ConstraintViolation),
  187         -
            > = value
  188         -
                .0
  189         -
                .into_iter()
  190         -
                .enumerate()
  191         -
                .map(|(idx, inner)| {
  192         -
                    inner
  193         -
                        .try_into()
  194         -
                        .map_err(|inner_violation| (idx, inner_violation))
  195         -
                })
  196         -
                .collect();
  197         -
            let inner =
  198         -
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
  199         -
            Ok(Self(inner))
         198  +
    )
  200    199   
        }
  201    200   
    }
  202    201   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/error.rs

@@ -1,1 +197,243 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Error type for the `ResponseCodeDefaultOperation` operation.
    3         -
/// Each variant represents an error that can occur for the `ResponseCodeDefaultOperation` operation.
           2  +
/// Error type for the `TypeComplexityOperation` operation.
           3  +
/// Each variant represents an error that can occur for the `TypeComplexityOperation` operation.
    4      4   
#[derive(::std::fmt::Debug)]
    5         -
pub enum ResponseCodeDefaultOperationError {
           5  +
pub enum TypeComplexityOperationError {
    6      6   
    #[allow(missing_docs)] // documentation missing in model
    7      7   
    InternalServerError(crate::error::InternalServerError),
    8      8   
}
    9         -
impl ::std::fmt::Display for ResponseCodeDefaultOperationError {
           9  +
impl ::std::fmt::Display for TypeComplexityOperationError {
   10     10   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   11     11   
        match &self {
   12         -
            ResponseCodeDefaultOperationError::InternalServerError(_inner) => _inner.fmt(f),
          12  +
            TypeComplexityOperationError::InternalServerError(_inner) => _inner.fmt(f),
   13     13   
        }
   14     14   
    }
   15     15   
}
   16         -
impl ResponseCodeDefaultOperationError {
   17         -
    /// Returns `true` if the error kind is `ResponseCodeDefaultOperationError::InternalServerError`.
          16  +
impl TypeComplexityOperationError {
          17  +
    /// Returns `true` if the error kind is `TypeComplexityOperationError::InternalServerError`.
   18     18   
    pub fn is_internal_server_error(&self) -> bool {
   19         -
        matches!(
   20         -
            &self,
   21         -
            ResponseCodeDefaultOperationError::InternalServerError(_)
   22         -
        )
          19  +
        matches!(&self, TypeComplexityOperationError::InternalServerError(_))
   23     20   
    }
   24     21   
    /// Returns the error name string by matching the correct variant.
   25     22   
    pub fn name(&self) -> &'static str {
   26     23   
        match &self {
   27         -
            ResponseCodeDefaultOperationError::InternalServerError(_inner) => _inner.name(),
          24  +
            TypeComplexityOperationError::InternalServerError(_inner) => _inner.name(),
   28     25   
        }
   29     26   
    }
   30     27   
}
   31         -
impl ::std::error::Error for ResponseCodeDefaultOperationError {
          28  +
impl ::std::error::Error for TypeComplexityOperationError {
   32     29   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
   33     30   
        match &self {
   34         -
            ResponseCodeDefaultOperationError::InternalServerError(_inner) => Some(_inner),
          31  +
            TypeComplexityOperationError::InternalServerError(_inner) => Some(_inner),
   35     32   
        }
   36     33   
    }
   37     34   
}
   38     35   
impl ::std::convert::From<crate::error::InternalServerError>
   39         -
    for crate::error::ResponseCodeDefaultOperationError
          36  +
    for crate::error::TypeComplexityOperationError
   40     37   
{
   41     38   
    fn from(
   42     39   
        variant: crate::error::InternalServerError,
   43         -
    ) -> crate::error::ResponseCodeDefaultOperationError {
          40  +
    ) -> crate::error::TypeComplexityOperationError {
   44     41   
        Self::InternalServerError(variant)
   45     42   
    }
   46     43   
}
   47     44   
   48         -
impl ::std::convert::From<::pyo3::PyErr> for crate::error::ResponseCodeDefaultOperationError {
   49         -
    fn from(variant: ::pyo3::PyErr) -> crate::error::ResponseCodeDefaultOperationError {
          45  +
impl ::std::convert::From<::pyo3::PyErr> for crate::error::TypeComplexityOperationError {
          46  +
    fn from(variant: ::pyo3::PyErr) -> crate::error::TypeComplexityOperationError {
   50     47   
        ::pyo3::Python::with_gil(|py| {
   51     48   
            let error = variant.value(py);
   52     49   
   53     50   
            crate::error::InternalServerError {
   54     51   
                message: error.to_string(),
   55     52   
            }
   56     53   
            .into()
   57     54   
        })
   58     55   
    }
   59     56   
}
   60     57   
   61         -
#[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
   62         -
/// :param message str:
   63         -
/// :rtype None:
   64         -
#[allow(missing_docs)] // documentation missing in model
   65         -
#[derive(
   66         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   67         -
)]
   68         -
pub struct InternalServerError {
   69         -
    #[pyo3(get, set)]
   70         -
    /// :type str:
          58  +
/// Error type for the `RequiredInnerShapeOperation` operation.
          59  +
/// Each variant represents an error that can occur for the `RequiredInnerShapeOperation` operation.
          60  +
#[derive(::std::fmt::Debug)]
          61  +
pub enum RequiredInnerShapeOperationError {
          62  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          63  +
    ValidationException(crate::error::ValidationException),
   71     64   
    #[allow(missing_docs)] // documentation missing in model
   72         -
    pub message: ::std::string::String,
          65  +
    InternalServerError(crate::error::InternalServerError),
   73     66   
}
   74         -
#[allow(clippy::new_without_default)]
   75         -
#[allow(clippy::too_many_arguments)]
   76         -
#[::pyo3::pymethods]
   77         -
impl InternalServerError {
   78         -
    #[new]
   79         -
    pub fn new(message: ::std::string::String) -> Self {
   80         -
        Self { message }
   81         -
    }
   82         -
    fn __repr__(&self) -> String {
   83         -
        format!("{self:?}")
   84         -
    }
   85         -
    fn __str__(&self) -> String {
   86         -
        format!("{self:?}")
          67  +
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
          68  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          69  +
        match &self {
          70  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.fmt(f),
          71  +
            RequiredInnerShapeOperationError::InternalServerError(_inner) => _inner.fmt(f),
          72  +
        }
   87     73   
    }
   88     74   
}
   89         -
impl InternalServerError {
   90         -
    /// Returns the error message.
   91         -
    pub fn message(&self) -> &str {
   92         -
        &self.message
          75  +
impl RequiredInnerShapeOperationError {
          76  +
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationException`.
          77  +
    pub fn is_validation_exception(&self) -> bool {
          78  +
        matches!(
          79  +
            &self,
          80  +
            RequiredInnerShapeOperationError::ValidationException(_)
          81  +
        )
   93     82   
    }
   94         -
    #[doc(hidden)]
   95         -
    /// Returns the error name.
          83  +
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::InternalServerError`.
          84  +
    pub fn is_internal_server_error(&self) -> bool {
          85  +
        matches!(
          86  +
            &self,
          87  +
            RequiredInnerShapeOperationError::InternalServerError(_)
          88  +
        )
          89  +
    }
          90  +
    /// Returns the error name string by matching the correct variant.
   96     91   
    pub fn name(&self) -> &'static str {
   97         -
        "InternalServerError"
          92  +
        match &self {
          93  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.name(),
          94  +
            RequiredInnerShapeOperationError::InternalServerError(_inner) => _inner.name(),
          95  +
        }
   98     96   
    }
   99     97   
}
  100         -
impl ::std::fmt::Display for InternalServerError {
  101         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  102         -
        ::std::write!(f, "InternalServerError")?;
  103         -
        {
  104         -
            ::std::write!(f, ": {}", &self.message)?;
          98  +
impl ::std::error::Error for RequiredInnerShapeOperationError {
          99  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         100  +
        match &self {
         101  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => Some(_inner),
         102  +
            RequiredInnerShapeOperationError::InternalServerError(_inner) => Some(_inner),
  105    103   
        }
  106         -
        Ok(())
  107    104   
    }
  108    105   
}
  109         -
impl ::std::error::Error for InternalServerError {}
  110         -
impl InternalServerError {
  111         -
    /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
  112         -
    pub fn builder() -> crate::error::internal_server_error::Builder {
  113         -
        crate::error::internal_server_error::Builder::default()
         106  +
impl ::std::convert::From<crate::error::ValidationException>
         107  +
    for crate::error::RequiredInnerShapeOperationError
         108  +
{
         109  +
    fn from(
         110  +
        variant: crate::error::ValidationException,
         111  +
    ) -> crate::error::RequiredInnerShapeOperationError {
         112  +
        Self::ValidationException(variant)
         113  +
    }
         114  +
}
         115  +
impl ::std::convert::From<crate::error::InternalServerError>
         116  +
    for crate::error::RequiredInnerShapeOperationError
         117  +
{
         118  +
    fn from(
         119  +
        variant: crate::error::InternalServerError,
         120  +
    ) -> crate::error::RequiredInnerShapeOperationError {
         121  +
        Self::InternalServerError(variant)
  114    122   
    }
  115    123   
}
  116    124   
  117         -
/// Error type for the `ResponseCodeHttpFallbackOperation` operation.
  118         -
/// Each variant represents an error that can occur for the `ResponseCodeHttpFallbackOperation` operation.
         125  +
impl ::std::convert::From<::pyo3::PyErr> for crate::error::RequiredInnerShapeOperationError {
         126  +
    fn from(variant: ::pyo3::PyErr) -> crate::error::RequiredInnerShapeOperationError {
         127  +
        ::pyo3::Python::with_gil(|py| {
         128  +
            let error = variant.value(py);
         129  +
            if let Ok(error) = error.extract::<crate::error::ValidationException>() {
         130  +
                return error.into();
         131  +
            }
         132  +
            crate::error::InternalServerError {
         133  +
                message: error.to_string(),
         134  +
            }
         135  +
            .into()
         136  +
        })
         137  +
    }
         138  +
}
         139  +
         140  +
/// Error type for the `RequiredHeaderCollectionOperation` operation.
         141  +
/// Each variant represents an error that can occur for the `RequiredHeaderCollectionOperation` operation.
  119    142   
#[derive(::std::fmt::Debug)]
  120         -
pub enum ResponseCodeHttpFallbackOperationError {
         143  +
pub enum RequiredHeaderCollectionOperationError {
         144  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         145  +
    ValidationException(crate::error::ValidationException),
  121    146   
    #[allow(missing_docs)] // documentation missing in model
  122    147   
    InternalServerError(crate::error::InternalServerError),
  123    148   
}
  124         -
impl ::std::fmt::Display for ResponseCodeHttpFallbackOperationError {
         149  +
impl ::std::fmt::Display for RequiredHeaderCollectionOperationError {
  125    150   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  126    151   
        match &self {
  127         -
            ResponseCodeHttpFallbackOperationError::InternalServerError(_inner) => _inner.fmt(f),
         152  +
            RequiredHeaderCollectionOperationError::ValidationException(_inner) => _inner.fmt(f),
         153  +
            RequiredHeaderCollectionOperationError::InternalServerError(_inner) => _inner.fmt(f),
  128    154   
        }
  129    155   
    }
  130    156   
}
  131         -
impl ResponseCodeHttpFallbackOperationError {
  132         -
    /// Returns `true` if the error kind is `ResponseCodeHttpFallbackOperationError::InternalServerError`.
         157  +
impl RequiredHeaderCollectionOperationError {
         158  +
    /// Returns `true` if the error kind is `RequiredHeaderCollectionOperationError::ValidationException`.
         159  +
    pub fn is_validation_exception(&self) -> bool {
         160  +
        matches!(
         161  +
            &self,
         162  +
            RequiredHeaderCollectionOperationError::ValidationException(_)
         163  +
        )
         164  +
    }
         165  +
    /// Returns `true` if the error kind is `RequiredHeaderCollectionOperationError::InternalServerError`.
  133    166   
    pub fn is_internal_server_error(&self) -> bool {
  134    167   
        matches!(
  135    168   
            &self,
  136         -
            ResponseCodeHttpFallbackOperationError::InternalServerError(_)
         169  +
            RequiredHeaderCollectionOperationError::InternalServerError(_)
  137    170   
        )
  138    171   
    }
  139    172   
    /// Returns the error name string by matching the correct variant.
  140    173   
    pub fn name(&self) -> &'static str {
  141    174   
        match &self {
  142         -
            ResponseCodeHttpFallbackOperationError::InternalServerError(_inner) => _inner.name(),
         175  +
            RequiredHeaderCollectionOperationError::ValidationException(_inner) => _inner.name(),
         176  +
            RequiredHeaderCollectionOperationError::InternalServerError(_inner) => _inner.name(),
  143    177   
        }
  144    178   
    }
  145    179   
}
  146         -
impl ::std::error::Error for ResponseCodeHttpFallbackOperationError {
         180  +
impl ::std::error::Error for RequiredHeaderCollectionOperationError {
  147    181   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  148    182   
        match &self {
  149         -
            ResponseCodeHttpFallbackOperationError::InternalServerError(_inner) => Some(_inner),
         183  +
            RequiredHeaderCollectionOperationError::ValidationException(_inner) => Some(_inner),
         184  +
            RequiredHeaderCollectionOperationError::InternalServerError(_inner) => Some(_inner),
  150    185   
        }
  151    186   
    }
  152    187   
}
         188  +
impl ::std::convert::From<crate::error::ValidationException>
         189  +
    for crate::error::RequiredHeaderCollectionOperationError
         190  +
{
         191  +
    fn from(
         192  +
        variant: crate::error::ValidationException,
         193  +
    ) -> crate::error::RequiredHeaderCollectionOperationError {
         194  +
        Self::ValidationException(variant)
         195  +
    }
         196  +
}
  153    197   
impl ::std::convert::From<crate::error::InternalServerError>
  154         -
    for crate::error::ResponseCodeHttpFallbackOperationError
         198  +
    for crate::error::RequiredHeaderCollectionOperationError
  155    199   
{
  156    200   
    fn from(
  157    201   
        variant: crate::error::InternalServerError,
  158         -
    ) -> crate::error::ResponseCodeHttpFallbackOperationError {
         202  +
    ) -> crate::error::RequiredHeaderCollectionOperationError {
  159    203   
        Self::InternalServerError(variant)
  160    204   
    }
  161    205   
}
  162    206   
  163         -
impl ::std::convert::From<::pyo3::PyErr> for crate::error::ResponseCodeHttpFallbackOperationError {
  164         -
    fn from(variant: ::pyo3::PyErr) -> crate::error::ResponseCodeHttpFallbackOperationError {
         207  +
impl ::std::convert::From<::pyo3::PyErr> for crate::error::RequiredHeaderCollectionOperationError {
         208  +
    fn from(variant: ::pyo3::PyErr) -> crate::error::RequiredHeaderCollectionOperationError {
  165    209   
        ::pyo3::Python::with_gil(|py| {
  166    210   
            let error = variant.value(py);
  167         -
         211  +
            if let Ok(error) = error.extract::<crate::error::ValidationException>() {
         212  +
                return error.into();
         213  +
            }
  168    214   
            crate::error::InternalServerError {
  169    215   
                message: error.to_string(),
  170    216   
            }
  171    217   
            .into()
  172    218   
        })
  173    219   
    }
  174    220   
}
  175    221   
  176    222   
/// Error type for the `ResponseCodeRequiredOperation` operation.
  177    223   
/// Each variant represents an error that can occur for the `ResponseCodeRequiredOperation` operation.
@@ -205,251 +346,484 @@
  225    271   
            let error = variant.value(py);
  226    272   
  227    273   
            crate::error::InternalServerError {
  228    274   
                message: error.to_string(),
  229    275   
            }
  230    276   
            .into()
  231    277   
        })
  232    278   
    }
  233    279   
}
  234    280   
  235         -
/// Error type for the `RequiredHeaderCollectionOperation` operation.
  236         -
/// Each variant represents an error that can occur for the `RequiredHeaderCollectionOperation` operation.
         281  +
/// Error type for the `ResponseCodeHttpFallbackOperation` operation.
         282  +
/// Each variant represents an error that can occur for the `ResponseCodeHttpFallbackOperation` operation.
  237    283   
#[derive(::std::fmt::Debug)]
  238         -
pub enum RequiredHeaderCollectionOperationError {
  239         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
  240         -
    ValidationException(crate::error::ValidationException),
         284  +
pub enum ResponseCodeHttpFallbackOperationError {
  241    285   
    #[allow(missing_docs)] // documentation missing in model
  242    286   
    InternalServerError(crate::error::InternalServerError),
  243    287   
}
  244         -
impl ::std::fmt::Display for RequiredHeaderCollectionOperationError {
         288  +
impl ::std::fmt::Display for ResponseCodeHttpFallbackOperationError {
  245    289   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  246    290   
        match &self {
  247         -
            RequiredHeaderCollectionOperationError::ValidationException(_inner) => _inner.fmt(f),
  248         -
            RequiredHeaderCollectionOperationError::InternalServerError(_inner) => _inner.fmt(f),
         291  +
            ResponseCodeHttpFallbackOperationError::InternalServerError(_inner) => _inner.fmt(f),
  249    292   
        }
  250    293   
    }
  251    294   
}
  252         -
impl RequiredHeaderCollectionOperationError {
  253         -
    /// Returns `true` if the error kind is `RequiredHeaderCollectionOperationError::ValidationException`.
  254         -
    pub fn is_validation_exception(&self) -> bool {
  255         -
        matches!(
  256         -
            &self,
  257         -
            RequiredHeaderCollectionOperationError::ValidationException(_)
  258         -
        )
  259         -
    }
  260         -
    /// Returns `true` if the error kind is `RequiredHeaderCollectionOperationError::InternalServerError`.
         295  +
impl ResponseCodeHttpFallbackOperationError {
         296  +
    /// Returns `true` if the error kind is `ResponseCodeHttpFallbackOperationError::InternalServerError`.
  261    297   
    pub fn is_internal_server_error(&self) -> bool {
  262    298   
        matches!(
  263    299   
            &self,
  264         -
            RequiredHeaderCollectionOperationError::InternalServerError(_)
         300  +
            ResponseCodeHttpFallbackOperationError::InternalServerError(_)
  265    301   
        )
  266    302   
    }
  267    303   
    /// Returns the error name string by matching the correct variant.
  268    304   
    pub fn name(&self) -> &'static str {
  269    305   
        match &self {
  270         -
            RequiredHeaderCollectionOperationError::ValidationException(_inner) => _inner.name(),
  271         -
            RequiredHeaderCollectionOperationError::InternalServerError(_inner) => _inner.name(),
         306  +
            ResponseCodeHttpFallbackOperationError::InternalServerError(_inner) => _inner.name(),
  272    307   
        }
  273    308   
    }
  274    309   
}
  275         -
impl ::std::error::Error for RequiredHeaderCollectionOperationError {
         310  +
impl ::std::error::Error for ResponseCodeHttpFallbackOperationError {
  276    311   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  277    312   
        match &self {
  278         -
            RequiredHeaderCollectionOperationError::ValidationException(_inner) => Some(_inner),
  279         -
            RequiredHeaderCollectionOperationError::InternalServerError(_inner) => Some(_inner),
         313  +
            ResponseCodeHttpFallbackOperationError::InternalServerError(_inner) => Some(_inner),
  280    314   
        }
  281    315   
    }
  282    316   
}
  283         -
impl ::std::convert::From<crate::error::ValidationException>
  284         -
    for crate::error::RequiredHeaderCollectionOperationError
         317  +
impl ::std::convert::From<crate::error::InternalServerError>
         318  +
    for crate::error::ResponseCodeHttpFallbackOperationError
  285    319   
{
  286    320   
    fn from(
  287         -
        variant: crate::error::ValidationException,
  288         -
    ) -> crate::error::RequiredHeaderCollectionOperationError {
  289         -
        Self::ValidationException(variant)
         321  +
        variant: crate::error::InternalServerError,
         322  +
    ) -> crate::error::ResponseCodeHttpFallbackOperationError {
         323  +
        Self::InternalServerError(variant)
         324  +
    }
         325  +
}
         326  +
         327  +
impl ::std::convert::From<::pyo3::PyErr> for crate::error::ResponseCodeHttpFallbackOperationError {
         328  +
    fn from(variant: ::pyo3::PyErr) -> crate::error::ResponseCodeHttpFallbackOperationError {
         329  +
        ::pyo3::Python::with_gil(|py| {
         330  +
            let error = variant.value(py);
         331  +
         332  +
            crate::error::InternalServerError {
         333  +
                message: error.to_string(),
         334  +
            }
         335  +
            .into()
         336  +
        })
         337  +
    }
         338  +
}
         339  +
         340  +
/// Error type for the `ResponseCodeDefaultOperation` operation.
         341  +
/// Each variant represents an error that can occur for the `ResponseCodeDefaultOperation` operation.
         342  +
#[derive(::std::fmt::Debug)]
         343  +
pub enum ResponseCodeDefaultOperationError {
         344  +
    #[allow(missing_docs)] // documentation missing in model
         345  +
    InternalServerError(crate::error::InternalServerError),
         346  +
}
         347  +
impl ::std::fmt::Display for ResponseCodeDefaultOperationError {
         348  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         349  +
        match &self {
         350  +
            ResponseCodeDefaultOperationError::InternalServerError(_inner) => _inner.fmt(f),
         351  +
        }
         352  +
    }
         353  +
}
         354  +
impl ResponseCodeDefaultOperationError {
         355  +
    /// Returns `true` if the error kind is `ResponseCodeDefaultOperationError::InternalServerError`.
         356  +
    pub fn is_internal_server_error(&self) -> bool {
         357  +
        matches!(
         358  +
            &self,
         359  +
            ResponseCodeDefaultOperationError::InternalServerError(_)
         360  +
        )
         361  +
    }
         362  +
    /// Returns the error name string by matching the correct variant.
         363  +
    pub fn name(&self) -> &'static str {
         364  +
        match &self {
         365  +
            ResponseCodeDefaultOperationError::InternalServerError(_inner) => _inner.name(),
         366  +
        }
         367  +
    }
         368  +
}
         369  +
impl ::std::error::Error for ResponseCodeDefaultOperationError {
         370  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         371  +
        match &self {
         372  +
            ResponseCodeDefaultOperationError::InternalServerError(_inner) => Some(_inner),
         373  +
        }
  290    374   
    }
  291    375   
}
  292    376   
impl ::std::convert::From<crate::error::InternalServerError>
  293         -
    for crate::error::RequiredHeaderCollectionOperationError
         377  +
    for crate::error::ResponseCodeDefaultOperationError
  294    378   
{
  295    379   
    fn from(
  296    380   
        variant: crate::error::InternalServerError,
  297         -
    ) -> crate::error::RequiredHeaderCollectionOperationError {
         381  +
    ) -> crate::error::ResponseCodeDefaultOperationError {
  298    382   
        Self::InternalServerError(variant)
  299    383   
    }
  300    384   
}
  301    385   
  302         -
impl ::std::convert::From<::pyo3::PyErr> for crate::error::RequiredHeaderCollectionOperationError {
  303         -
    fn from(variant: ::pyo3::PyErr) -> crate::error::RequiredHeaderCollectionOperationError {
         386  +
impl ::std::convert::From<::pyo3::PyErr> for crate::error::ResponseCodeDefaultOperationError {
         387  +
    fn from(variant: ::pyo3::PyErr) -> crate::error::ResponseCodeDefaultOperationError {
  304    388   
        ::pyo3::Python::with_gil(|py| {
  305    389   
            let error = variant.value(py);
  306         -
            if let Ok(error) = error.extract::<crate::error::ValidationException>() {
  307         -
                return error.into();
  308         -
            }
         390  +
  309    391   
            crate::error::InternalServerError {
  310    392   
                message: error.to_string(),
  311    393   
            }
  312    394   
            .into()
  313    395   
        })
  314    396   
    }
  315    397   
}
  316    398   
         399  +
#[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
         400  +
/// :param message str:
         401  +
/// :rtype None:
         402  +
#[allow(missing_docs)] // documentation missing in model
         403  +
#[derive(
         404  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         405  +
)]
         406  +
pub struct InternalServerError {
         407  +
    #[pyo3(get, set)]
         408  +
    /// :type str:
         409  +
    #[allow(missing_docs)] // documentation missing in model
         410  +
    pub message: ::std::string::String,
         411  +
}
         412  +
#[allow(clippy::new_without_default)]
         413  +
#[allow(clippy::too_many_arguments)]
         414  +
#[::pyo3::pymethods]
         415  +
impl InternalServerError {
         416  +
    #[new]
         417  +
    pub fn new(message: ::std::string::String) -> Self {
         418  +
        Self { message }
         419  +
    }
         420  +
    fn __repr__(&self) -> String {
         421  +
        format!("{self:?}")
         422  +
    }
         423  +
    fn __str__(&self) -> String {
         424  +
        format!("{self:?}")
         425  +
    }
         426  +
}
         427  +
impl InternalServerError {
         428  +
    /// Returns the error message.
         429  +
    pub fn message(&self) -> &str {
         430  +
        &self.message
         431  +
    }
         432  +
    #[doc(hidden)]
         433  +
    /// Returns the error name.
         434  +
    pub fn name(&self) -> &'static str {
         435  +
        "InternalServerError"
         436  +
    }
         437  +
}
         438  +
impl ::std::fmt::Display for InternalServerError {
         439  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         440  +
        ::std::write!(f, "InternalServerError")?;
         441  +
        {
         442  +
            ::std::write!(f, ": {}", &self.message)?;
         443  +
        }
         444  +
        Ok(())
         445  +
    }
         446  +
}
         447  +
impl ::std::error::Error for InternalServerError {}
         448  +
impl InternalServerError {
         449  +
    /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
         450  +
    pub fn builder() -> crate::error::internal_server_error::Builder {
         451  +
        crate::error::internal_server_error::Builder::default()
         452  +
    }
         453  +
}
         454  +
  317    455   
#[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
  318    456   
/// :param message str:
  319    457   
/// :param field_list typing.Optional\[typing.List\[misc.model.ValidationExceptionField\]\]:
  320    458   
/// :rtype None:
  321    459   
/// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
  322    460   
#[derive(
  323    461   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  324    462   
)]
  325    463   
pub struct ValidationException {
  326    464   
    #[pyo3(get, set)]
@@ -359,497 +556,556 @@
  379    517   
        Ok(())
  380    518   
    }
  381    519   
}
  382    520   
impl ::std::error::Error for ValidationException {}
  383    521   
impl ValidationException {
  384    522   
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
  385    523   
    pub fn builder() -> crate::error::validation_exception::Builder {
  386    524   
        crate::error::validation_exception::Builder::default()
  387    525   
    }
  388    526   
}
  389         -
  390         -
/// Error type for the `RequiredInnerShapeOperation` operation.
  391         -
/// Each variant represents an error that can occur for the `RequiredInnerShapeOperation` operation.
  392         -
#[derive(::std::fmt::Debug)]
  393         -
pub enum RequiredInnerShapeOperationError {
  394         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
  395         -
    ValidationException(crate::error::ValidationException),
  396         -
    #[allow(missing_docs)] // documentation missing in model
  397         -
    InternalServerError(crate::error::InternalServerError),
  398         -
}
  399         -
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
  400         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  401         -
        match &self {
  402         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.fmt(f),
  403         -
            RequiredInnerShapeOperationError::InternalServerError(_inner) => _inner.fmt(f),
  404         -
        }
  405         -
    }
  406         -
}
  407         -
impl RequiredInnerShapeOperationError {
  408         -
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationException`.
  409         -
    pub fn is_validation_exception(&self) -> bool {
  410         -
        matches!(
  411         -
            &self,
  412         -
            RequiredInnerShapeOperationError::ValidationException(_)
  413         -
        )
  414         -
    }
  415         -
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::InternalServerError`.
  416         -
    pub fn is_internal_server_error(&self) -> bool {
  417         -
        matches!(
  418         -
            &self,
  419         -
            RequiredInnerShapeOperationError::InternalServerError(_)
  420         -
        )
  421         -
    }
  422         -
    /// Returns the error name string by matching the correct variant.
  423         -
    pub fn name(&self) -> &'static str {
  424         -
        match &self {
  425         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.name(),
  426         -
            RequiredInnerShapeOperationError::InternalServerError(_inner) => _inner.name(),
  427         -
        }
  428         -
    }
  429         -
}
  430         -
impl ::std::error::Error for RequiredInnerShapeOperationError {
  431         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  432         -
        match &self {
  433         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => Some(_inner),
  434         -
            RequiredInnerShapeOperationError::InternalServerError(_inner) => Some(_inner),
  435         -
        }
  436         -
    }
  437         -
}
  438         -
impl ::std::convert::From<crate::error::ValidationException>
  439         -
    for crate::error::RequiredInnerShapeOperationError
  440         -
{
  441         -
    fn from(
  442         -
        variant: crate::error::ValidationException,
  443         -
    ) -> crate::error::RequiredInnerShapeOperationError {
  444         -
        Self::ValidationException(variant)
  445         -
    }
  446         -
}
  447         -
impl ::std::convert::From<crate::error::InternalServerError>
  448         -
    for crate::error::RequiredInnerShapeOperationError
  449         -
{
  450         -
    fn from(
  451         -
        variant: crate::error::InternalServerError,
  452         -
    ) -> crate::error::RequiredInnerShapeOperationError {
  453         -
        Self::InternalServerError(variant)
  454         -
    }
  455         -
}
  456         -
  457         -
impl ::std::convert::From<::pyo3::PyErr> for crate::error::RequiredInnerShapeOperationError {
  458         -
    fn from(variant: ::pyo3::PyErr) -> crate::error::RequiredInnerShapeOperationError {
  459         -
        ::pyo3::Python::with_gil(|py| {
  460         -
            let error = variant.value(py);
  461         -
            if let Ok(error) = error.extract::<crate::error::ValidationException>() {
  462         -
                return error.into();
  463         -
            }
  464         -
            crate::error::InternalServerError {
  465         -
                message: error.to_string(),
  466         -
            }
  467         -
            .into()
  468         -
        })
  469         -
    }
  470         -
}
  471         -
  472         -
/// Error type for the `TypeComplexityOperation` operation.
  473         -
/// Each variant represents an error that can occur for the `TypeComplexityOperation` operation.
  474         -
#[derive(::std::fmt::Debug)]
  475         -
pub enum TypeComplexityOperationError {
  476         -
    #[allow(missing_docs)] // documentation missing in model
  477         -
    InternalServerError(crate::error::InternalServerError),
  478         -
}
  479         -
impl ::std::fmt::Display for TypeComplexityOperationError {
  480         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  481         -
        match &self {
  482         -
            TypeComplexityOperationError::InternalServerError(_inner) => _inner.fmt(f),
  483         -
        }
  484         -
    }
  485         -
}
  486         -
impl TypeComplexityOperationError {
  487         -
    /// Returns `true` if the error kind is `TypeComplexityOperationError::InternalServerError`.
  488         -
    pub fn is_internal_server_error(&self) -> bool {
  489         -
        matches!(&self, TypeComplexityOperationError::InternalServerError(_))
  490         -
    }
  491         -
    /// Returns the error name string by matching the correct variant.
  492         -
    pub fn name(&self) -> &'static str {
  493         -
        match &self {
  494         -
            TypeComplexityOperationError::InternalServerError(_inner) => _inner.name(),
  495         -
        }
  496         -
    }
  497         -
}
  498         -
impl ::std::error::Error for TypeComplexityOperationError {
  499         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  500         -
        match &self {
  501         -
            TypeComplexityOperationError::InternalServerError(_inner) => Some(_inner),
  502         -
        }
  503         -
    }
  504         -
}
  505         -
impl ::std::convert::From<crate::error::InternalServerError>
  506         -
    for crate::error::TypeComplexityOperationError
  507         -
{
  508         -
    fn from(
  509         -
        variant: crate::error::InternalServerError,
  510         -
    ) -> crate::error::TypeComplexityOperationError {
  511         -
        Self::InternalServerError(variant)
  512         -
    }
  513         -
}
  514         -
  515         -
impl ::std::convert::From<::pyo3::PyErr> for crate::error::TypeComplexityOperationError {
  516         -
    fn from(variant: ::pyo3::PyErr) -> crate::error::TypeComplexityOperationError {
  517         -
        ::pyo3::Python::with_gil(|py| {
  518         -
            let error = variant.value(py);
  519         -
  520         -
            crate::error::InternalServerError {
  521         -
                message: error.to_string(),
  522         -
            }
  523         -
            .into()
  524         -
        })
  525         -
    }
  526         -
}
  527    527   
/// See [`InternalServerError`](crate::error::InternalServerError).
  528    528   
pub mod internal_server_error {
  529    529   
  530    530   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  531    531   
    /// Holds one variant for each of the ways the builder can fail.
  532    532   
    #[allow(clippy::enum_variant_names)]
  533    533   
    pub enum ConstraintViolation {
  534    534   
        /// `message` was not provided but it is required when building `InternalServerError`.
  535    535   
        MissingMessage,
  536    536   
    }