Server Test Python

Server Test Python

rev. d838bf488731ae5e751cce0fe13f339a5b9be858

Files changed:

tmp-codegen-diff/codegen-server-test-python/naming_test_ops/rust-server-codegen-python/src/lib.rs

@@ -1,1 +44,45 @@
    5      5   
#![allow(clippy::large_enum_variant)]
    6      6   
#![allow(clippy::wrong_self_convention)]
    7      7   
#![allow(clippy::should_implement_trait)]
    8      8   
#![allow(clippy::disallowed_names)]
    9      9   
#![allow(clippy::vec_init_then_push)]
   10     10   
#![allow(clippy::type_complexity)]
   11     11   
#![allow(clippy::needless_return)]
   12     12   
#![allow(clippy::derive_partial_eq_without_eq)]
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::useless_conversion)]
   15     16   
#![allow(clippy::deprecated_semver)]
   16     17   
#![allow(clippy::uninlined_format_args)]
   17     18   
#![allow(rustdoc::bare_urls)]
   18     19   
#![allow(rustdoc::redundant_explicit_links)]
   19     20   
#![allow(rustdoc::broken_intra_doc_links)]
   20     21   
#![allow(rustdoc::invalid_html_tags)]
   21     22   
#![forbid(unsafe_code)]
   22     23   
#![cfg_attr(docsrs, feature(doc_cfg))]
   23     24   
//! Confounds model generation machinery with lots of problematic names
   24     25   

tmp-codegen-diff/codegen-server-test-python/naming_test_ops/rust-server-codegen-python/src/model.rs

@@ -1,1 +94,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[::pyo3::pyclass]
    3         -
/// :param path str:
    4         -
/// :param message str:
    5         -
/// :rtype None:
    6         -
/// Describes one specific validation failure for an input member.
    7         -
#[derive(
    8         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    9         -
)]
   10         -
pub struct ValidationExceptionField {
   11         -
    #[pyo3(get, set)]
   12         -
    /// :type str:
   13         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   14         -
    pub path: ::std::string::String,
   15         -
    #[pyo3(get, set)]
   16         -
    /// :type str:
   17         -
    /// A detailed description of the validation failure.
   18         -
    pub message: ::std::string::String,
   19         -
}
   20         -
impl ValidationExceptionField {
   21         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   22         -
    pub fn path(&self) -> &str {
   23         -
        use std::ops::Deref;
   24         -
        self.path.deref()
   25         -
    }
   26         -
    /// A detailed description of the validation failure.
   27         -
    pub fn message(&self) -> &str {
   28         -
        use std::ops::Deref;
   29         -
        self.message.deref()
   30         -
    }
   31         -
}
   32         -
#[allow(clippy::new_without_default)]
   33         -
#[allow(clippy::too_many_arguments)]
   34         -
#[::pyo3::pymethods]
   35         -
impl ValidationExceptionField {
   36         -
    #[new]
   37         -
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
   38         -
        Self { path, message }
   39         -
    }
   40         -
    fn __repr__(&self) -> String {
   41         -
        format!("{self:?}")
   42         -
    }
   43         -
    fn __str__(&self) -> String {
   44         -
        format!("{self:?}")
   45         -
    }
   46         -
}
   47         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
   48         -
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   49         -
        ob.extract::<ValidationExceptionField>().map(Box::new)
   50         -
    }
   51         -
}
   52         -
   53         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
   54         -
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   55         -
        (*self).into_py(py)
   56         -
    }
   57         -
}
   58         -
impl ValidationExceptionField {
   59         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
   60         -
    pub fn builder() -> crate::model::validation_exception_field::Builder {
   61         -
        crate::model::validation_exception_field::Builder::default()
   62         -
    }
   63         -
}
   64         -
   65      2   
#[::pyo3::pyclass]
   66      3   
///
   67      4   
/// _Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
   68      5   
/// `UnknownVariantCollidingEnum::SelfValue` has been renamed to `::SelfValue_`._
   69      6   
#[derive(
   70      7   
    ::std::clone::Clone,
   71      8   
    ::std::cmp::Eq,
   72      9   
    ::std::cmp::Ord,
   73     10   
    ::std::cmp::PartialEq,
   74     11   
    ::std::cmp::PartialOrd,
@@ -235,172 +354,292 @@
  255    192   
}
  256    193   
impl crate::constrained::Constrained for crate::model::Vec {
  257    194   
    type Unconstrained = crate::model::vec_internal::Builder;
  258    195   
}
  259    196   
impl Vec {
  260    197   
    /// Creates a new builder-style object to manufacture [`Vec`](crate::model::Vec).
  261    198   
    pub fn builder() -> crate::model::vec::Builder {
  262    199   
        crate::model::vec::Builder::default()
  263    200   
    }
  264    201   
}
  265         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  266         -
pub mod validation_exception_field {
  267    202   
  268         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  269         -
    /// Holds one variant for each of the ways the builder can fail.
  270         -
    #[allow(clippy::enum_variant_names)]
  271         -
    pub enum ConstraintViolation {
  272         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  273         -
        MissingPath,
  274         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  275         -
        MissingMessage,
         203  +
#[::pyo3::pyclass]
         204  +
/// :param path str:
         205  +
/// :param message str:
         206  +
/// :rtype None:
         207  +
/// Describes one specific validation failure for an input member.
         208  +
#[derive(
         209  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         210  +
)]
         211  +
pub struct ValidationExceptionField {
         212  +
    #[pyo3(get, set)]
         213  +
    /// :type str:
         214  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         215  +
    pub path: ::std::string::String,
         216  +
    #[pyo3(get, set)]
         217  +
    /// :type str:
         218  +
    /// A detailed description of the validation failure.
         219  +
    pub message: ::std::string::String,
         220  +
}
         221  +
impl ValidationExceptionField {
         222  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         223  +
    pub fn path(&self) -> &str {
         224  +
        use std::ops::Deref;
         225  +
        self.path.deref()
  276    226   
    }
  277         -
    impl ::std::fmt::Display for ConstraintViolation {
  278         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  279         -
            match self {
  280         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  281         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  282         -
            }
  283         -
        }
         227  +
    /// A detailed description of the validation failure.
         228  +
    pub fn message(&self) -> &str {
         229  +
        use std::ops::Deref;
         230  +
        self.message.deref()
  284    231   
    }
  285         -
    impl ::std::error::Error for ConstraintViolation {}
  286         -
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  287         -
        type Error = ConstraintViolation;
  288         -
  289         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  290         -
            builder.build()
  291         -
        }
         232  +
}
         233  +
#[allow(clippy::new_without_default)]
         234  +
#[allow(clippy::too_many_arguments)]
         235  +
#[::pyo3::pymethods]
         236  +
impl ValidationExceptionField {
         237  +
    #[new]
         238  +
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
         239  +
        Self { path, message }
  292    240   
    }
  293         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  294         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  295         -
    pub struct Builder {
  296         -
        pub(crate) path: ::std::option::Option<::std::string::String>,
  297         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
         241  +
    fn __repr__(&self) -> String {
         242  +
        format!("{self:?}")
  298    243   
    }
  299         -
    impl Builder {
  300         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  301         -
        pub fn path(mut self, input: ::std::string::String) -> Self {
  302         -
            self.path = Some(input);
  303         -
            self
  304         -
        }
  305         -
        /// A detailed description of the validation failure.
  306         -
        pub fn message(mut self, input: ::std::string::String) -> Self {
  307         -
            self.message = Some(input);
  308         -
            self
  309         -
        }
  310         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  311         -
        ///
  312         -
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
  313         -
        ///
  314         -
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  315         -
            self.build_enforcing_required_and_enum_traits()
  316         -
        }
  317         -
        fn build_enforcing_required_and_enum_traits(
  318         -
            self,
  319         -
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  320         -
            Ok(crate::model::ValidationExceptionField {
  321         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  322         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  323         -
            })
  324         -
        }
         244  +
    fn __str__(&self) -> String {
         245  +
        format!("{self:?}")
         246  +
    }
         247  +
}
         248  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
         249  +
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
         250  +
        ob.extract::<ValidationExceptionField>().map(Box::new)
         251  +
    }
         252  +
}
         253  +
         254  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
         255  +
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
         256  +
        (*self).into_py(py)
         257  +
    }
         258  +
}
         259  +
impl ValidationExceptionField {
         260  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         261  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
         262  +
        crate::model::validation_exception_field::Builder::default()
  325    263   
    }
  326    264   
}
  327    265   
/// See [`Vec`](crate::model::Vec).
  328    266   
pub(crate) mod vec_internal {
  329    267   
  330    268   
    impl ::std::convert::From<Builder> for crate::model::Vec {
  331    269   
        fn from(builder: Builder) -> Self {
  332    270   
            builder.build()
  333    271   
        }
  334    272   
    }
@@ -360,298 +0,389 @@
  380    318   
        pub fn build(self) -> crate::model::Vec {
  381    319   
            self.build_enforcing_required_and_enum_traits()
  382    320   
        }
  383    321   
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Vec {
  384    322   
            crate::model::Vec {
  385    323   
                pv_member: self.pv_member,
  386    324   
            }
  387    325   
        }
  388    326   
    }
  389    327   
}
         328  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         329  +
pub mod validation_exception_field {
         330  +
         331  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         332  +
    /// Holds one variant for each of the ways the builder can fail.
         333  +
    #[allow(clippy::enum_variant_names)]
         334  +
    pub enum ConstraintViolation {
         335  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         336  +
        MissingPath,
         337  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         338  +
        MissingMessage,
         339  +
    }
         340  +
    impl ::std::fmt::Display for ConstraintViolation {
         341  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         342  +
            match self {
         343  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         344  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         345  +
            }
         346  +
        }
         347  +
    }
         348  +
    impl ::std::error::Error for ConstraintViolation {}
         349  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         350  +
        type Error = ConstraintViolation;
         351  +
         352  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         353  +
            builder.build()
         354  +
        }
         355  +
    }
         356  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         357  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         358  +
    pub struct Builder {
         359  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         360  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         361  +
    }
         362  +
    impl Builder {
         363  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         364  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         365  +
            self.path = Some(input);
         366  +
            self
         367  +
        }
         368  +
        /// A detailed description of the validation failure.
         369  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         370  +
            self.message = Some(input);
         371  +
            self
         372  +
        }
         373  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         374  +
        ///
         375  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
         376  +
        ///
         377  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         378  +
            self.build_enforcing_required_and_enum_traits()
         379  +
        }
         380  +
        fn build_enforcing_required_and_enum_traits(
         381  +
            self,
         382  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         383  +
            Ok(crate::model::ValidationExceptionField {
         384  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         385  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         386  +
            })
         387  +
        }
         388  +
    }
         389  +
}

tmp-codegen-diff/codegen-server-test-python/naming_test_ops/rust-server-codegen-python/src/operation.rs

@@ -1,1 +309,304 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
::pin_project_lite::pin_project! {
    3      3   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    4         -
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
    5         -
    pub struct RpcEchoInputFuture {
    6         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RpcEchoInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
           4  +
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
           5  +
    pub struct ReservedWordsAsMembersInputFuture {
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ReservedWordsAsMembersInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
    7      7   
    }
    8      8   
}
    9      9   
   10         -
impl std::future::Future for RpcEchoInputFuture {
          10  +
impl std::future::Future for ReservedWordsAsMembersInputFuture {
   11     11   
    type Output = Result<
   12         -
        crate::input::RpcEchoInput,
          12  +
        crate::input::ReservedWordsAsMembersInput,
   13     13   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
   14     14   
    >;
   15     15   
   16     16   
    fn poll(
   17     17   
        self: std::pin::Pin<&mut Self>,
   18     18   
        cx: &mut std::task::Context<'_>,
   19     19   
    ) -> std::task::Poll<Self::Output> {
   20     20   
        let this = self.project();
   21     21   
        this.inner.as_mut().poll(cx)
   22     22   
    }
   23     23   
}
   24     24   
   25     25   
impl<B>
   26     26   
    ::aws_smithy_legacy_http_server::request::FromRequest<
   27     27   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
   28     28   
        B,
   29         -
    > for crate::input::RpcEchoInput
          29  +
    > for crate::input::ReservedWordsAsMembersInput
   30     30   
where
   31     31   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
   36     36   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38     38   
    type Rejection =
   39     39   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
   40         -
    type Future = RpcEchoInputFuture;
          40  +
    type Future = ReservedWordsAsMembersInputFuture;
   41     41   
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50         -
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_request(request).await
          50  +
            crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members_http_request(request)
          51  +
                            .await
   51     52   
        };
   52     53   
        use ::futures_util::future::TryFutureExt;
   53     54   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
   54     55   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
   55     56   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   56     57   
                    });
   57         -
        RpcEchoInputFuture {
          58  +
        ReservedWordsAsMembersInputFuture {
   58     59   
            inner: Box::pin(fut),
   59     60   
        }
   60     61   
    }
   61     62   
}
   62     63   
impl
   63     64   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   64     65   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
   65         -
    > for crate::output::RpcEchoOutput
          66  +
    > for crate::output::ReservedWordsAsMembersOutput
   66     67   
{
   67     68   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   68         -
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_response(self) {
   69         -
            Ok(response) => response,
   70         -
            Err(e) => {
   71         -
                ::tracing::error!(error = %e, "failed to serialize response");
   72         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
   73         -
            }
   74         -
        }
          69  +
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_response(self) {
          70  +
                        Ok(response) => response,
          71  +
                        Err(e) => {
          72  +
                            ::tracing::error!(error = %e, "failed to serialize response");
          73  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
          74  +
                        }
          75  +
                    }
   75     76   
    }
   76     77   
}
   77     78   
impl
   78     79   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   79     80   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
   80         -
    > for crate::error::RPCEchoError
          81  +
    > for crate::error::ReservedWordsAsMembersError
   81     82   
{
   82     83   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   83         -
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_error(&self) {
          84  +
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_error(&self) {
   84     85   
            Ok(mut response) => {
   85         -
                response.extensions_mut().insert(
   86         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
   87         -
                        self.name(),
   88         -
                    ),
   89         -
                );
          86  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
   90     87   
                response
   91         -
            }
          88  +
            },
   92     89   
            Err(e) => {
   93     90   
                ::tracing::error!(error = %e, "failed to serialize response");
   94     91   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
   95     92   
            }
   96     93   
        }
   97     94   
    }
   98     95   
}
   99     96   
  100     97   
::pin_project_lite::pin_project! {
  101     98   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  102         -
    /// [`MatchInput`](crate::input::MatchInput) using modelled bindings.
  103         -
    pub struct MatchInputFuture {
  104         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MatchInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
          99  +
    /// [`StructureNamePunningInput`](crate::input::StructureNamePunningInput) using modelled bindings.
         100  +
    pub struct StructureNamePunningInputFuture {
         101  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StructureNamePunningInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  105    102   
    }
  106    103   
}
  107    104   
  108         -
impl std::future::Future for MatchInputFuture {
         105  +
impl std::future::Future for StructureNamePunningInputFuture {
  109    106   
    type Output = Result<
  110         -
        crate::input::MatchInput,
         107  +
        crate::input::StructureNamePunningInput,
  111    108   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  112    109   
    >;
  113    110   
  114    111   
    fn poll(
  115    112   
        self: std::pin::Pin<&mut Self>,
  116    113   
        cx: &mut std::task::Context<'_>,
  117    114   
    ) -> std::task::Poll<Self::Output> {
  118    115   
        let this = self.project();
  119    116   
        this.inner.as_mut().poll(cx)
  120    117   
    }
  121    118   
}
  122    119   
  123    120   
impl<B>
  124    121   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  125    122   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  126    123   
        B,
  127         -
    > for crate::input::MatchInput
         124  +
    > for crate::input::StructureNamePunningInput
  128    125   
where
  129    126   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  130    127   
    B: 'static,
  131    128   
  132    129   
    B::Data: Send,
  133    130   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  134    131   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  135    132   
{
  136    133   
    type Rejection =
  137    134   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  138         -
    type Future = MatchInputFuture;
         135  +
    type Future = StructureNamePunningInputFuture;
  139    136   
  140    137   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  141    138   
        let fut = async move {
  142    139   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  143    140   
                request.headers(),
  144    141   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  145    142   
            ) {
  146    143   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  147    144   
            }
  148         -
            crate::protocol_serde::shape_match::de_match_http_request(request).await
         145  +
            crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning_http_request(request)
         146  +
                            .await
  149    147   
        };
  150    148   
        use ::futures_util::future::TryFutureExt;
  151    149   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  152    150   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  153    151   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  154    152   
                    });
  155         -
        MatchInputFuture {
         153  +
        StructureNamePunningInputFuture {
  156    154   
            inner: Box::pin(fut),
  157    155   
        }
  158    156   
    }
  159    157   
}
  160    158   
impl
  161    159   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  162    160   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  163         -
    > for crate::output::MatchOutput
         161  +
    > for crate::output::StructureNamePunningOutput
  164    162   
{
  165    163   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  166         -
        match crate::protocol_serde::shape_match::ser_match_http_response(self) {
  167         -
            Ok(response) => response,
  168         -
            Err(e) => {
  169         -
                ::tracing::error!(error = %e, "failed to serialize response");
  170         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  171         -
            }
  172         -
        }
         164  +
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
         165  +
                        Ok(response) => response,
         166  +
                        Err(e) => {
         167  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         168  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         169  +
                        }
         170  +
                    }
  173    171   
    }
  174    172   
}
  175    173   
impl
  176    174   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  177    175   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  178         -
    > for crate::error::MatchError
         176  +
    > for crate::error::StructureNamePunningError
  179    177   
{
  180    178   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  181         -
        match crate::protocol_serde::shape_match::ser_match_http_error(&self) {
         179  +
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_error(&self) {
  182    180   
            Ok(mut response) => {
  183         -
                response.extensions_mut().insert(
  184         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  185         -
                        self.name(),
  186         -
                    ),
  187         -
                );
         181  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
  188    182   
                response
  189         -
            }
         183  +
            },
  190    184   
            Err(e) => {
  191    185   
                ::tracing::error!(error = %e, "failed to serialize response");
  192    186   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  193    187   
            }
  194    188   
        }
  195    189   
    }
  196    190   
}
  197    191   
  198    192   
::pin_project_lite::pin_project! {
  199    193   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  200         -
    /// [`OptionInput`](crate::input::OptionInput) using modelled bindings.
  201         -
    pub struct OptionInputFuture {
  202         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OptionInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         194  +
    /// [`ErrCollisionsInput`](crate::input::ErrCollisionsInput) using modelled bindings.
         195  +
    pub struct ErrCollisionsInputFuture {
         196  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ErrCollisionsInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  203    197   
    }
  204    198   
}
  205    199   
  206         -
impl std::future::Future for OptionInputFuture {
         200  +
impl std::future::Future for ErrCollisionsInputFuture {
  207    201   
    type Output = Result<
  208         -
        crate::input::OptionInput,
         202  +
        crate::input::ErrCollisionsInput,
  209    203   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  210    204   
    >;
  211    205   
  212    206   
    fn poll(
  213    207   
        self: std::pin::Pin<&mut Self>,
  214    208   
        cx: &mut std::task::Context<'_>,
  215    209   
    ) -> std::task::Poll<Self::Output> {
  216    210   
        let this = self.project();
  217    211   
        this.inner.as_mut().poll(cx)
  218    212   
    }
  219    213   
}
  220    214   
  221    215   
impl<B>
  222    216   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  223    217   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  224    218   
        B,
  225         -
    > for crate::input::OptionInput
         219  +
    > for crate::input::ErrCollisionsInput
  226    220   
where
  227    221   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  228    222   
    B: 'static,
  229    223   
  230    224   
    B::Data: Send,
  231    225   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  232    226   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  233    227   
{
  234    228   
    type Rejection =
  235    229   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  236         -
    type Future = OptionInputFuture;
         230  +
    type Future = ErrCollisionsInputFuture;
  237    231   
  238    232   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  239    233   
        let fut = async move {
  240    234   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  241    235   
                request.headers(),
  242    236   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  243    237   
            ) {
  244    238   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  245    239   
            }
  246         -
            crate::protocol_serde::shape_option::de_option_http_request(request).await
         240  +
            crate::protocol_serde::shape_err_collisions::de_err_collisions_http_request(request)
         241  +
                .await
  247    242   
        };
  248    243   
        use ::futures_util::future::TryFutureExt;
  249    244   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  250    245   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  251    246   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  252    247   
                    });
  253         -
        OptionInputFuture {
         248  +
        ErrCollisionsInputFuture {
  254    249   
            inner: Box::pin(fut),
  255    250   
        }
  256    251   
    }
  257    252   
}
  258    253   
impl
  259    254   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  260    255   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  261         -
    > for crate::output::OptionOutput
         256  +
    > for crate::output::ErrCollisionsOutput
  262    257   
{
  263    258   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  264         -
        match crate::protocol_serde::shape_option::ser_option_http_response(self) {
         259  +
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_response(self) {
  265    260   
            Ok(response) => response,
  266    261   
            Err(e) => {
  267    262   
                ::tracing::error!(error = %e, "failed to serialize response");
  268    263   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  269    264   
            }
  270    265   
        }
  271    266   
    }
  272    267   
}
  273    268   
impl
  274    269   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  275    270   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  276         -
    > for crate::error::OptionError
         271  +
    > for crate::error::ErrCollisionsError
  277    272   
{
  278    273   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  279         -
        match crate::protocol_serde::shape_option::ser_option_http_error(&self) {
         274  +
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_error(&self) {
  280    275   
            Ok(mut response) => {
  281    276   
                response.extensions_mut().insert(
  282    277   
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  283    278   
                        self.name(),
  284    279   
                    ),
  285    280   
                );
  286    281   
                response
  287    282   
            }
  288    283   
            Err(e) => {
  289    284   
                ::tracing::error!(error = %e, "failed to serialize response");
@@ -366,361 +681,681 @@
  386    381   
            Err(e) => {
  387    382   
                ::tracing::error!(error = %e, "failed to serialize response");
  388    383   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  389    384   
            }
  390    385   
        }
  391    386   
    }
  392    387   
}
  393    388   
  394    389   
::pin_project_lite::pin_project! {
  395    390   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  396         -
    /// [`ErrCollisionsInput`](crate::input::ErrCollisionsInput) using modelled bindings.
  397         -
    pub struct ErrCollisionsInputFuture {
  398         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ErrCollisionsInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         391  +
    /// [`OptionInput`](crate::input::OptionInput) using modelled bindings.
         392  +
    pub struct OptionInputFuture {
         393  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OptionInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  399    394   
    }
  400    395   
}
  401    396   
  402         -
impl std::future::Future for ErrCollisionsInputFuture {
         397  +
impl std::future::Future for OptionInputFuture {
  403    398   
    type Output = Result<
  404         -
        crate::input::ErrCollisionsInput,
         399  +
        crate::input::OptionInput,
  405    400   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  406    401   
    >;
  407    402   
  408    403   
    fn poll(
  409    404   
        self: std::pin::Pin<&mut Self>,
  410    405   
        cx: &mut std::task::Context<'_>,
  411    406   
    ) -> std::task::Poll<Self::Output> {
  412    407   
        let this = self.project();
  413    408   
        this.inner.as_mut().poll(cx)
  414    409   
    }
  415    410   
}
  416    411   
  417    412   
impl<B>
  418    413   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  419    414   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  420    415   
        B,
  421         -
    > for crate::input::ErrCollisionsInput
         416  +
    > for crate::input::OptionInput
  422    417   
where
  423    418   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  424    419   
    B: 'static,
  425    420   
  426    421   
    B::Data: Send,
  427    422   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  428    423   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  429    424   
{
  430    425   
    type Rejection =
  431    426   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  432         -
    type Future = ErrCollisionsInputFuture;
         427  +
    type Future = OptionInputFuture;
  433    428   
  434    429   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  435    430   
        let fut = async move {
  436    431   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  437    432   
                request.headers(),
  438    433   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  439    434   
            ) {
  440    435   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  441    436   
            }
  442         -
            crate::protocol_serde::shape_err_collisions::de_err_collisions_http_request(request)
  443         -
                .await
         437  +
            crate::protocol_serde::shape_option::de_option_http_request(request).await
  444    438   
        };
  445    439   
        use ::futures_util::future::TryFutureExt;
  446    440   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  447    441   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  448    442   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  449    443   
                    });
  450         -
        ErrCollisionsInputFuture {
         444  +
        OptionInputFuture {
  451    445   
            inner: Box::pin(fut),
  452    446   
        }
  453    447   
    }
  454    448   
}
  455    449   
impl
  456    450   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  457    451   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  458         -
    > for crate::output::ErrCollisionsOutput
         452  +
    > for crate::output::OptionOutput
  459    453   
{
  460    454   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  461         -
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_response(self) {
         455  +
        match crate::protocol_serde::shape_option::ser_option_http_response(self) {
  462    456   
            Ok(response) => response,
  463    457   
            Err(e) => {
  464    458   
                ::tracing::error!(error = %e, "failed to serialize response");
  465    459   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  466    460   
            }
  467    461   
        }
  468    462   
    }
  469    463   
}
  470    464   
impl
  471    465   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  472    466   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  473         -
    > for crate::error::ErrCollisionsError
         467  +
    > for crate::error::OptionError
  474    468   
{
  475    469   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  476         -
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_error(&self) {
         470  +
        match crate::protocol_serde::shape_option::ser_option_http_error(&self) {
  477    471   
            Ok(mut response) => {
  478    472   
                response.extensions_mut().insert(
  479    473   
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  480    474   
                        self.name(),
  481    475   
                    ),
  482    476   
                );
  483    477   
                response
  484    478   
            }
  485    479   
            Err(e) => {
  486    480   
                ::tracing::error!(error = %e, "failed to serialize response");
  487    481   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  488    482   
            }
  489    483   
        }
  490    484   
    }
  491    485   
}
  492    486   
  493    487   
::pin_project_lite::pin_project! {
  494    488   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  495         -
    /// [`StructureNamePunningInput`](crate::input::StructureNamePunningInput) using modelled bindings.
  496         -
    pub struct StructureNamePunningInputFuture {
  497         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StructureNamePunningInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         489  +
    /// [`MatchInput`](crate::input::MatchInput) using modelled bindings.
         490  +
    pub struct MatchInputFuture {
         491  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MatchInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  498    492   
    }
  499    493   
}
  500    494   
  501         -
impl std::future::Future for StructureNamePunningInputFuture {
         495  +
impl std::future::Future for MatchInputFuture {
  502    496   
    type Output = Result<
  503         -
        crate::input::StructureNamePunningInput,
         497  +
        crate::input::MatchInput,
  504    498   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  505    499   
    >;
  506    500   
  507    501   
    fn poll(
  508    502   
        self: std::pin::Pin<&mut Self>,
  509    503   
        cx: &mut std::task::Context<'_>,
  510    504   
    ) -> std::task::Poll<Self::Output> {
  511    505   
        let this = self.project();
  512    506   
        this.inner.as_mut().poll(cx)
  513    507   
    }
  514    508   
}
  515    509   
  516    510   
impl<B>
  517    511   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  518    512   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  519    513   
        B,
  520         -
    > for crate::input::StructureNamePunningInput
         514  +
    > for crate::input::MatchInput
  521    515   
where
  522    516   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  523    517   
    B: 'static,
  524    518   
  525    519   
    B::Data: Send,
  526    520   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  527    521   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  528    522   
{
  529    523   
    type Rejection =
  530    524   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  531         -
    type Future = StructureNamePunningInputFuture;
         525  +
    type Future = MatchInputFuture;
  532    526   
  533    527   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  534    528   
        let fut = async move {
  535    529   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  536    530   
                request.headers(),
  537    531   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  538    532   
            ) {
  539    533   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  540    534   
            }
  541         -
            crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning_http_request(request)
  542         -
                            .await
         535  +
            crate::protocol_serde::shape_match::de_match_http_request(request).await
  543    536   
        };
  544    537   
        use ::futures_util::future::TryFutureExt;
  545    538   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  546    539   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  547    540   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  548    541   
                    });
  549         -
        StructureNamePunningInputFuture {
         542  +
        MatchInputFuture {
  550    543   
            inner: Box::pin(fut),
  551    544   
        }
  552    545   
    }
  553    546   
}
  554    547   
impl
  555    548   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  556    549   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  557         -
    > for crate::output::StructureNamePunningOutput
         550  +
    > for crate::output::MatchOutput
  558    551   
{
  559    552   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  560         -
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
  561         -
                        Ok(response) => response,
  562         -
                        Err(e) => {
  563         -
                            ::tracing::error!(error = %e, "failed to serialize response");
  564         -
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  565         -
                        }
  566         -
                    }
         553  +
        match crate::protocol_serde::shape_match::ser_match_http_response(self) {
         554  +
            Ok(response) => response,
         555  +
            Err(e) => {
         556  +
                ::tracing::error!(error = %e, "failed to serialize response");
         557  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         558  +
            }
         559  +
        }
  567    560   
    }
  568    561   
}
  569    562   
impl
  570    563   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  571    564   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  572         -
    > for crate::error::StructureNamePunningError
         565  +
    > for crate::error::MatchError
  573    566   
{
  574    567   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  575         -
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_error(&self) {
         568  +
        match crate::protocol_serde::shape_match::ser_match_http_error(&self) {
  576    569   
            Ok(mut response) => {
  577         -
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
         570  +
                response.extensions_mut().insert(
         571  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         572  +
                        self.name(),
         573  +
                    ),
         574  +
                );
  578    575   
                response
  579         -
            },
         576  +
            }
  580    577   
            Err(e) => {
  581    578   
                ::tracing::error!(error = %e, "failed to serialize response");
  582    579   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  583    580   
            }
  584    581   
        }
  585    582   
    }
  586    583   
}
  587    584   
  588    585   
::pin_project_lite::pin_project! {
  589    586   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  590         -
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
  591         -
    pub struct ReservedWordsAsMembersInputFuture {
  592         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ReservedWordsAsMembersInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         587  +
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
         588  +
    pub struct RpcEchoInputFuture {
         589  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RpcEchoInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  593    590   
    }
  594    591   
}
  595    592   
  596         -
impl std::future::Future for ReservedWordsAsMembersInputFuture {
         593  +
impl std::future::Future for RpcEchoInputFuture {
  597    594   
    type Output = Result<
  598         -
        crate::input::ReservedWordsAsMembersInput,
         595  +
        crate::input::RpcEchoInput,
  599    596   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  600    597   
    >;
  601    598   
  602    599   
    fn poll(
  603    600   
        self: std::pin::Pin<&mut Self>,
  604    601   
        cx: &mut std::task::Context<'_>,
  605    602   
    ) -> std::task::Poll<Self::Output> {
  606    603   
        let this = self.project();
  607    604   
        this.inner.as_mut().poll(cx)
  608    605   
    }
  609    606   
}
  610    607   
  611    608   
impl<B>
  612    609   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  613    610   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  614    611   
        B,
  615         -
    > for crate::input::ReservedWordsAsMembersInput
         612  +
    > for crate::input::RpcEchoInput
  616    613   
where
  617    614   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  618    615   
    B: 'static,
  619    616   
  620    617   
    B::Data: Send,
  621    618   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  622    619   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  623    620   
{
  624    621   
    type Rejection =
  625    622   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  626         -
    type Future = ReservedWordsAsMembersInputFuture;
         623  +
    type Future = RpcEchoInputFuture;
  627    624   
  628    625   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  629    626   
        let fut = async move {
  630    627   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  631    628   
                request.headers(),
  632    629   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  633    630   
            ) {
  634    631   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  635    632   
            }
  636         -
            crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members_http_request(request)
  637         -
                            .await
         633  +
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_request(request).await
  638    634   
        };
  639    635   
        use ::futures_util::future::TryFutureExt;
  640    636   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  641    637   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  642    638   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  643    639   
                    });
  644         -
        ReservedWordsAsMembersInputFuture {
         640  +
        RpcEchoInputFuture {
  645    641   
            inner: Box::pin(fut),
  646    642   
        }
  647    643   
    }
  648    644   
}
  649    645   
impl
  650    646   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  651    647   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  652         -
    > for crate::output::ReservedWordsAsMembersOutput
         648  +
    > for crate::output::RpcEchoOutput
  653    649   
{
  654    650   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  655         -
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_response(self) {
  656         -
                        Ok(response) => response,
  657         -
                        Err(e) => {
  658         -
                            ::tracing::error!(error = %e, "failed to serialize response");
  659         -
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  660         -
                        }
  661         -
                    }
         651  +
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_response(self) {
         652  +
            Ok(response) => response,
         653  +
            Err(e) => {
         654  +
                ::tracing::error!(error = %e, "failed to serialize response");
         655  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         656  +
            }
         657  +
        }
  662    658   
    }
  663    659   
}
  664    660   
impl
  665    661   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  666    662   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  667         -
    > for crate::error::ReservedWordsAsMembersError
         663  +
    > for crate::error::RPCEchoError
  668    664   
{
  669    665   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  670         -
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_error(&self) {
         666  +
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_error(&self) {
  671    667   
            Ok(mut response) => {
  672         -
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
         668  +
                response.extensions_mut().insert(
         669  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         670  +
                        self.name(),
         671  +
                    ),
         672  +
                );
  673    673   
                response
  674         -
            },
         674  +
            }
  675    675   
            Err(e) => {
  676    676   
                ::tracing::error!(error = %e, "failed to serialize response");
  677    677   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  678    678   
            }
  679    679   
        }
  680    680   
    }
  681    681   
}

tmp-codegen-diff/codegen-server-test-python/naming_test_ops/rust-server-codegen-python/src/operation_shape.rs

@@ -1,1 +209,209 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3         -
pub struct RpcEcho;
           3  +
pub struct ReservedWordsAsMembers;
    4      4   
    5         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for RpcEcho {
           5  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ReservedWordsAsMembers {
    6      6   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
    7      7   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
    8         -
            "crate#RPCEcho",
           8  +
            "crate#ReservedWordsAsMembers",
    9      9   
            "crate",
   10         -
            "RPCEcho",
          10  +
            "ReservedWordsAsMembers",
   11     11   
        );
   12     12   
   13         -
    type Input = crate::input::RpcEchoInput;
   14         -
    type Output = crate::output::RpcEchoOutput;
   15         -
    type Error = crate::error::RPCEchoError;
          13  +
    type Input = crate::input::ReservedWordsAsMembersInput;
          14  +
    type Output = crate::output::ReservedWordsAsMembersOutput;
          15  +
    type Error = crate::error::ReservedWordsAsMembersError;
   16     16   
}
   17     17   
   18         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
          18  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
          19  +
    for ReservedWordsAsMembers
          20  +
{
   19     21   
    type RequestFmt =
   20     22   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   21     23   
    type ResponseFmt =
   22     24   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   23     25   
   24     26   
    fn request_fmt() -> Self::RequestFmt {
   25     27   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   26     28   
    }
   27     29   
   28     30   
    fn response_fmt() -> Self::ResponseFmt {
   29     31   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   30     32   
    }
   31     33   
}
   32     34   
   33     35   
#[allow(missing_docs)] // documentation missing in model
   34         -
pub struct Match;
          36  +
pub struct StructureNamePunning;
   35     37   
   36         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Match {
          38  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for StructureNamePunning {
   37     39   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   38         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
          40  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
          41  +
            "crate#StructureNamePunning",
          42  +
            "crate",
          43  +
            "StructureNamePunning",
          44  +
        );
   39     45   
   40         -
    type Input = crate::input::MatchInput;
   41         -
    type Output = crate::output::MatchOutput;
   42         -
    type Error = crate::error::MatchError;
          46  +
    type Input = crate::input::StructureNamePunningInput;
          47  +
    type Output = crate::output::StructureNamePunningOutput;
          48  +
    type Error = crate::error::StructureNamePunningError;
   43     49   
}
   44     50   
   45         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Match {
          51  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
          52  +
    for StructureNamePunning
          53  +
{
   46     54   
    type RequestFmt =
   47     55   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   48     56   
    type ResponseFmt =
   49     57   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   50     58   
   51     59   
    fn request_fmt() -> Self::RequestFmt {
   52     60   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   53     61   
    }
   54     62   
   55     63   
    fn response_fmt() -> Self::ResponseFmt {
   56     64   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   57     65   
    }
   58     66   
}
   59     67   
   60     68   
#[allow(missing_docs)] // documentation missing in model
   61         -
pub struct Option;
          69  +
pub struct ErrCollisions;
   62     70   
   63         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Option {
          71  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ErrCollisions {
   64     72   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   65         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
          73  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
          74  +
            "crate#ErrCollisions",
          75  +
            "crate",
          76  +
            "ErrCollisions",
          77  +
        );
   66     78   
   67         -
    type Input = crate::input::OptionInput;
   68         -
    type Output = crate::output::OptionOutput;
   69         -
    type Error = crate::error::OptionError;
          79  +
    type Input = crate::input::ErrCollisionsInput;
          80  +
    type Output = crate::output::ErrCollisionsOutput;
          81  +
    type Error = crate::error::ErrCollisionsError;
   70     82   
}
   71     83   
   72         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Option {
          84  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
   73     85   
    type RequestFmt =
   74     86   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   75     87   
    type ResponseFmt =
   76     88   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   77     89   
   78     90   
    fn request_fmt() -> Self::RequestFmt {
   79     91   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   80     92   
    }
   81     93   
   82     94   
    fn response_fmt() -> Self::ResponseFmt {
   83     95   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   84     96   
    }
   85     97   
}
   86     98   
   87     99   
#[allow(missing_docs)] // documentation missing in model
   88    100   
pub struct Result;
   89    101   
   90    102   
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Result {
   91    103   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   92    104   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Result", "crate", "Result");
   93    105   
   94    106   
    type Input = crate::input::ResultInput;
   95    107   
    type Output = crate::output::ResultOutput;
   96    108   
    type Error = crate::error::ResultError;
   97    109   
}
   98    110   
   99    111   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Result {
  100    112   
    type RequestFmt =
  101    113   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  102    114   
    type ResponseFmt =
  103    115   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  104    116   
  105    117   
    fn request_fmt() -> Self::RequestFmt {
  106    118   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  107    119   
    }
  108    120   
  109    121   
    fn response_fmt() -> Self::ResponseFmt {
  110    122   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  111    123   
    }
  112    124   
}
  113    125   
  114    126   
#[allow(missing_docs)] // documentation missing in model
  115         -
pub struct ErrCollisions;
         127  +
pub struct Option;
  116    128   
  117         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ErrCollisions {
         129  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Option {
  118    130   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  119         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  120         -
            "crate#ErrCollisions",
  121         -
            "crate",
  122         -
            "ErrCollisions",
  123         -
        );
         131  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
  124    132   
  125         -
    type Input = crate::input::ErrCollisionsInput;
  126         -
    type Output = crate::output::ErrCollisionsOutput;
  127         -
    type Error = crate::error::ErrCollisionsError;
         133  +
    type Input = crate::input::OptionInput;
         134  +
    type Output = crate::output::OptionOutput;
         135  +
    type Error = crate::error::OptionError;
  128    136   
}
  129    137   
  130         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
         138  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Option {
  131    139   
    type RequestFmt =
  132    140   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  133    141   
    type ResponseFmt =
  134    142   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  135    143   
  136    144   
    fn request_fmt() -> Self::RequestFmt {
  137    145   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  138    146   
    }
  139    147   
  140    148   
    fn response_fmt() -> Self::ResponseFmt {
  141    149   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  142    150   
    }
  143    151   
}
  144    152   
  145    153   
#[allow(missing_docs)] // documentation missing in model
  146         -
pub struct StructureNamePunning;
         154  +
pub struct Match;
  147    155   
  148         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for StructureNamePunning {
         156  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Match {
  149    157   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  150         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  151         -
            "crate#StructureNamePunning",
  152         -
            "crate",
  153         -
            "StructureNamePunning",
  154         -
        );
         158  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
  155    159   
  156         -
    type Input = crate::input::StructureNamePunningInput;
  157         -
    type Output = crate::output::StructureNamePunningOutput;
  158         -
    type Error = crate::error::StructureNamePunningError;
         160  +
    type Input = crate::input::MatchInput;
         161  +
    type Output = crate::output::MatchOutput;
         162  +
    type Error = crate::error::MatchError;
  159    163   
}
  160    164   
  161         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  162         -
    for StructureNamePunning
  163         -
{
         165  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Match {
  164    166   
    type RequestFmt =
  165    167   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  166    168   
    type ResponseFmt =
  167    169   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  168    170   
  169    171   
    fn request_fmt() -> Self::RequestFmt {
  170    172   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  171    173   
    }
  172    174   
  173    175   
    fn response_fmt() -> Self::ResponseFmt {
  174    176   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  175    177   
    }
  176    178   
}
  177    179   
  178    180   
#[allow(missing_docs)] // documentation missing in model
  179         -
pub struct ReservedWordsAsMembers;
         181  +
pub struct RpcEcho;
  180    182   
  181         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ReservedWordsAsMembers {
         183  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for RpcEcho {
  182    184   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  183    185   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  184         -
            "crate#ReservedWordsAsMembers",
         186  +
            "crate#RPCEcho",
  185    187   
            "crate",
  186         -
            "ReservedWordsAsMembers",
         188  +
            "RPCEcho",
  187    189   
        );
  188    190   
  189         -
    type Input = crate::input::ReservedWordsAsMembersInput;
  190         -
    type Output = crate::output::ReservedWordsAsMembersOutput;
  191         -
    type Error = crate::error::ReservedWordsAsMembersError;
         191  +
    type Input = crate::input::RpcEchoInput;
         192  +
    type Output = crate::output::RpcEchoOutput;
         193  +
    type Error = crate::error::RPCEchoError;
  192    194   
}
  193    195   
  194         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  195         -
    for ReservedWordsAsMembers
  196         -
{
         196  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
  197    197   
    type RequestFmt =
  198    198   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  199    199   
    type ResponseFmt =
  200    200   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  201    201   
  202    202   
    fn request_fmt() -> Self::RequestFmt {
  203    203   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  204    204   
    }
  205    205   
  206    206   
    fn response_fmt() -> Self::ResponseFmt {

tmp-codegen-diff/codegen-server-test-python/naming_test_ops/rust-server-codegen-python/src/output.rs

@@ -1,1 +148,148 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[::pyo3::pyclass]
    3      3   
/// :rtype None:
    4      4   
#[allow(missing_docs)] // documentation missing in model
    5      5   
#[derive(
    6      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    7      7   
)]
    8         -
pub struct RpcEchoOutput {}
           8  +
pub struct ReservedWordsAsMembersOutput {}
    9      9   
#[allow(clippy::new_without_default)]
   10     10   
#[allow(clippy::too_many_arguments)]
   11     11   
#[::pyo3::pymethods]
   12         -
impl RpcEchoOutput {
          12  +
impl ReservedWordsAsMembersOutput {
   13     13   
    #[new]
   14     14   
    pub fn new() -> Self {
   15     15   
        Self {}
   16     16   
    }
   17     17   
    fn __repr__(&self) -> String {
   18     18   
        format!("{self:?}")
   19     19   
    }
   20     20   
    fn __str__(&self) -> String {
   21     21   
        format!("{self:?}")
   22     22   
    }
   23     23   
}
   24         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RpcEchoOutput> {
          24  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ReservedWordsAsMembersOutput> {
   25     25   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   26         -
        ob.extract::<RpcEchoOutput>().map(Box::new)
          26  +
        ob.extract::<ReservedWordsAsMembersOutput>().map(Box::new)
   27     27   
    }
   28     28   
}
   29     29   
   30         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RpcEchoOutput> {
          30  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ReservedWordsAsMembersOutput> {
   31     31   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   32     32   
        (*self).into_py(py)
   33     33   
    }
   34     34   
}
   35         -
impl RpcEchoOutput {
   36         -
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
   37         -
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
   38         -
        crate::output::rpc_echo_output::Builder::default()
          35  +
impl ReservedWordsAsMembersOutput {
          36  +
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
          37  +
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
          38  +
        crate::output::reserved_words_as_members_output::Builder::default()
   39     39   
    }
   40     40   
}
   41     41   
   42     42   
#[::pyo3::pyclass]
   43     43   
/// :rtype None:
   44     44   
#[allow(missing_docs)] // documentation missing in model
   45     45   
#[derive(
   46     46   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   47     47   
)]
   48         -
pub struct MatchOutput {}
          48  +
pub struct StructureNamePunningOutput {}
   49     49   
#[allow(clippy::new_without_default)]
   50     50   
#[allow(clippy::too_many_arguments)]
   51     51   
#[::pyo3::pymethods]
   52         -
impl MatchOutput {
          52  +
impl StructureNamePunningOutput {
   53     53   
    #[new]
   54     54   
    pub fn new() -> Self {
   55     55   
        Self {}
   56     56   
    }
   57     57   
    fn __repr__(&self) -> String {
   58     58   
        format!("{self:?}")
   59     59   
    }
   60     60   
    fn __str__(&self) -> String {
   61     61   
        format!("{self:?}")
   62     62   
    }
   63     63   
}
   64         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<MatchOutput> {
          64  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructureNamePunningOutput> {
   65     65   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   66         -
        ob.extract::<MatchOutput>().map(Box::new)
          66  +
        ob.extract::<StructureNamePunningOutput>().map(Box::new)
   67     67   
    }
   68     68   
}
   69     69   
   70         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<MatchOutput> {
          70  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructureNamePunningOutput> {
   71     71   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   72     72   
        (*self).into_py(py)
   73     73   
    }
   74     74   
}
   75         -
impl MatchOutput {
   76         -
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
   77         -
    pub fn builder() -> crate::output::match_output::Builder {
   78         -
        crate::output::match_output::Builder::default()
          75  +
impl StructureNamePunningOutput {
          76  +
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
          77  +
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
          78  +
        crate::output::structure_name_punning_output::Builder::default()
   79     79   
    }
   80     80   
}
   81     81   
   82     82   
#[::pyo3::pyclass]
   83     83   
/// :rtype None:
   84     84   
#[allow(missing_docs)] // documentation missing in model
   85     85   
#[derive(
   86     86   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   87     87   
)]
   88         -
pub struct OptionOutput {}
          88  +
pub struct ErrCollisionsOutput {}
   89     89   
#[allow(clippy::new_without_default)]
   90     90   
#[allow(clippy::too_many_arguments)]
   91     91   
#[::pyo3::pymethods]
   92         -
impl OptionOutput {
          92  +
impl ErrCollisionsOutput {
   93     93   
    #[new]
   94     94   
    pub fn new() -> Self {
   95     95   
        Self {}
   96     96   
    }
   97     97   
    fn __repr__(&self) -> String {
   98     98   
        format!("{self:?}")
   99     99   
    }
  100    100   
    fn __str__(&self) -> String {
  101    101   
        format!("{self:?}")
  102    102   
    }
  103    103   
}
  104         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<OptionOutput> {
         104  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ErrCollisionsOutput> {
  105    105   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  106         -
        ob.extract::<OptionOutput>().map(Box::new)
         106  +
        ob.extract::<ErrCollisionsOutput>().map(Box::new)
  107    107   
    }
  108    108   
}
  109    109   
  110         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<OptionOutput> {
         110  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ErrCollisionsOutput> {
  111    111   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  112    112   
        (*self).into_py(py)
  113    113   
    }
  114    114   
}
  115         -
impl OptionOutput {
  116         -
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
  117         -
    pub fn builder() -> crate::output::option_output::Builder {
  118         -
        crate::output::option_output::Builder::default()
         115  +
impl ErrCollisionsOutput {
         116  +
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         117  +
    pub fn builder() -> crate::output::err_collisions_output::Builder {
         118  +
        crate::output::err_collisions_output::Builder::default()
  119    119   
    }
  120    120   
}
  121    121   
  122    122   
#[::pyo3::pyclass]
  123    123   
/// :param pv_member typing.Optional\[bool\]:
  124    124   
/// :rtype None:
  125    125   
#[allow(missing_docs)] // documentation missing in model
  126    126   
#[derive(
  127    127   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  128    128   
)]
@@ -150,150 +452,452 @@
  170    170   
        crate::output::result_output::Builder::default()
  171    171   
    }
  172    172   
}
  173    173   
  174    174   
#[::pyo3::pyclass]
  175    175   
/// :rtype None:
  176    176   
#[allow(missing_docs)] // documentation missing in model
  177    177   
#[derive(
  178    178   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  179    179   
)]
  180         -
pub struct ErrCollisionsOutput {}
         180  +
pub struct OptionOutput {}
  181    181   
#[allow(clippy::new_without_default)]
  182    182   
#[allow(clippy::too_many_arguments)]
  183    183   
#[::pyo3::pymethods]
  184         -
impl ErrCollisionsOutput {
         184  +
impl OptionOutput {
  185    185   
    #[new]
  186    186   
    pub fn new() -> Self {
  187    187   
        Self {}
  188    188   
    }
  189    189   
    fn __repr__(&self) -> String {
  190    190   
        format!("{self:?}")
  191    191   
    }
  192    192   
    fn __str__(&self) -> String {
  193    193   
        format!("{self:?}")
  194    194   
    }
  195    195   
}
  196         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ErrCollisionsOutput> {
         196  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<OptionOutput> {
  197    197   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  198         -
        ob.extract::<ErrCollisionsOutput>().map(Box::new)
         198  +
        ob.extract::<OptionOutput>().map(Box::new)
  199    199   
    }
  200    200   
}
  201    201   
  202         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ErrCollisionsOutput> {
         202  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<OptionOutput> {
  203    203   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  204    204   
        (*self).into_py(py)
  205    205   
    }
  206    206   
}
  207         -
impl ErrCollisionsOutput {
  208         -
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  209         -
    pub fn builder() -> crate::output::err_collisions_output::Builder {
  210         -
        crate::output::err_collisions_output::Builder::default()
         207  +
impl OptionOutput {
         208  +
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
         209  +
    pub fn builder() -> crate::output::option_output::Builder {
         210  +
        crate::output::option_output::Builder::default()
  211    211   
    }
  212    212   
}
  213    213   
  214    214   
#[::pyo3::pyclass]
  215    215   
/// :rtype None:
  216    216   
#[allow(missing_docs)] // documentation missing in model
  217    217   
#[derive(
  218    218   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  219    219   
)]
  220         -
pub struct StructureNamePunningOutput {}
         220  +
pub struct MatchOutput {}
  221    221   
#[allow(clippy::new_without_default)]
  222    222   
#[allow(clippy::too_many_arguments)]
  223    223   
#[::pyo3::pymethods]
  224         -
impl StructureNamePunningOutput {
         224  +
impl MatchOutput {
  225    225   
    #[new]
  226    226   
    pub fn new() -> Self {
  227    227   
        Self {}
  228    228   
    }
  229    229   
    fn __repr__(&self) -> String {
  230    230   
        format!("{self:?}")
  231    231   
    }
  232    232   
    fn __str__(&self) -> String {
  233    233   
        format!("{self:?}")
  234    234   
    }
  235    235   
}
  236         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructureNamePunningOutput> {
         236  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<MatchOutput> {
  237    237   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  238         -
        ob.extract::<StructureNamePunningOutput>().map(Box::new)
         238  +
        ob.extract::<MatchOutput>().map(Box::new)
  239    239   
    }
  240    240   
}
  241    241   
  242         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructureNamePunningOutput> {
         242  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<MatchOutput> {
  243    243   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  244    244   
        (*self).into_py(py)
  245    245   
    }
  246    246   
}
  247         -
impl StructureNamePunningOutput {
  248         -
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  249         -
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
  250         -
        crate::output::structure_name_punning_output::Builder::default()
         247  +
impl MatchOutput {
         248  +
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
         249  +
    pub fn builder() -> crate::output::match_output::Builder {
         250  +
        crate::output::match_output::Builder::default()
  251    251   
    }
  252    252   
}
  253    253   
  254    254   
#[::pyo3::pyclass]
  255    255   
/// :rtype None:
  256    256   
#[allow(missing_docs)] // documentation missing in model
  257    257   
#[derive(
  258    258   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  259    259   
)]
  260         -
pub struct ReservedWordsAsMembersOutput {}
         260  +
pub struct RpcEchoOutput {}
  261    261   
#[allow(clippy::new_without_default)]
  262    262   
#[allow(clippy::too_many_arguments)]
  263    263   
#[::pyo3::pymethods]
  264         -
impl ReservedWordsAsMembersOutput {
         264  +
impl RpcEchoOutput {
  265    265   
    #[new]
  266    266   
    pub fn new() -> Self {
  267    267   
        Self {}
  268    268   
    }
  269    269   
    fn __repr__(&self) -> String {
  270    270   
        format!("{self:?}")
  271    271   
    }
  272    272   
    fn __str__(&self) -> String {
  273    273   
        format!("{self:?}")
  274    274   
    }
  275    275   
}
  276         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ReservedWordsAsMembersOutput> {
         276  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RpcEchoOutput> {
  277    277   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  278         -
        ob.extract::<ReservedWordsAsMembersOutput>().map(Box::new)
         278  +
        ob.extract::<RpcEchoOutput>().map(Box::new)
  279    279   
    }
  280    280   
}
  281    281   
  282         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ReservedWordsAsMembersOutput> {
         282  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RpcEchoOutput> {
  283    283   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  284    284   
        (*self).into_py(py)
  285    285   
    }
  286    286   
}
  287         -
impl ReservedWordsAsMembersOutput {
  288         -
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  289         -
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
  290         -
        crate::output::reserved_words_as_members_output::Builder::default()
         287  +
impl RpcEchoOutput {
         288  +
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         289  +
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
         290  +
        crate::output::rpc_echo_output::Builder::default()
  291    291   
    }
  292    292   
}
  293         -
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  294         -
pub mod rpc_echo_output {
         293  +
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         294  +
pub mod reserved_words_as_members_output {
  295    295   
  296         -
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
         296  +
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
  297    297   
        fn from(builder: Builder) -> Self {
  298    298   
            builder.build()
  299    299   
        }
  300    300   
    }
  301         -
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         301  +
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  302    302   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  303    303   
    pub struct Builder {}
  304    304   
    impl Builder {
  305         -
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  306         -
        pub fn build(self) -> crate::output::RpcEchoOutput {
         305  +
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         306  +
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
  307    307   
            self.build_enforcing_required_and_enum_traits()
  308    308   
        }
  309         -
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::RpcEchoOutput {
  310         -
            crate::output::RpcEchoOutput {}
         309  +
        fn build_enforcing_required_and_enum_traits(
         310  +
            self,
         311  +
        ) -> crate::output::ReservedWordsAsMembersOutput {
         312  +
            crate::output::ReservedWordsAsMembersOutput {}
  311    313   
        }
  312    314   
    }
  313    315   
}
  314         -
/// See [`MatchOutput`](crate::output::MatchOutput).
  315         -
pub mod match_output {
         316  +
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         317  +
pub mod structure_name_punning_output {
  316    318   
  317         -
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
         319  +
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
  318    320   
        fn from(builder: Builder) -> Self {
  319    321   
            builder.build()
  320    322   
        }
  321    323   
    }
  322         -
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
         324  +
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  323    325   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  324    326   
    pub struct Builder {}
  325    327   
    impl Builder {
  326         -
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
  327         -
        pub fn build(self) -> crate::output::MatchOutput {
         328  +
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         329  +
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
  328    330   
            self.build_enforcing_required_and_enum_traits()
  329    331   
        }
  330         -
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::MatchOutput {
  331         -
            crate::output::MatchOutput {}
         332  +
        fn build_enforcing_required_and_enum_traits(
         333  +
            self,
         334  +
        ) -> crate::output::StructureNamePunningOutput {
         335  +
            crate::output::StructureNamePunningOutput {}
  332    336   
        }
  333    337   
    }
  334    338   
}
  335         -
/// See [`OptionOutput`](crate::output::OptionOutput).
  336         -
pub mod option_output {
         339  +
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         340  +
pub mod err_collisions_output {
  337    341   
  338         -
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
         342  +
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
  339    343   
        fn from(builder: Builder) -> Self {
  340    344   
            builder.build()
  341    345   
        }
  342    346   
    }
  343         -
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
         347  +
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  344    348   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  345    349   
    pub struct Builder {}
  346    350   
    impl Builder {
  347         -
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
  348         -
        pub fn build(self) -> crate::output::OptionOutput {
         351  +
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         352  +
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
  349    353   
            self.build_enforcing_required_and_enum_traits()
  350    354   
        }
  351         -
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::OptionOutput {
  352         -
            crate::output::OptionOutput {}
         355  +
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::ErrCollisionsOutput {
         356  +
            crate::output::ErrCollisionsOutput {}
  353    357   
        }
  354    358   
    }
  355    359   
}
  356    360   
/// See [`ResultOutput`](crate::output::ResultOutput).
  357    361   
pub mod result_output {
  358    362   
  359    363   
    impl ::std::convert::From<Builder> for crate::output::ResultOutput {
  360    364   
        fn from(builder: Builder) -> Self {
  361    365   
            builder.build()
  362    366   
        }
  363    367   
    }
  364    368   
    /// A builder for [`ResultOutput`](crate::output::ResultOutput).
  365    369   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  366    370   
    pub struct Builder {
  367    371   
        pub(crate) pv_member: ::std::option::Option<bool>,
  368    372   
    }
  369    373   
    impl Builder {
  370    374   
        #[allow(missing_docs)] // documentation missing in model
  371    375   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  372    376   
            self.pv_member = input;
  373    377   
            self
  374    378   
        }
  375    379   
        /// Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
  376    380   
        pub fn build(self) -> crate::output::ResultOutput {
  377    381   
            self.build_enforcing_required_and_enum_traits()
  378    382   
        }
  379    383   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::ResultOutput {
  380    384   
            crate::output::ResultOutput {
  381    385   
                pv_member: self.pv_member,
  382    386   
            }
  383    387   
        }
  384    388   
    }
  385    389   
}
  386         -
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  387         -
pub mod err_collisions_output {
         390  +
/// See [`OptionOutput`](crate::output::OptionOutput).
         391  +
pub mod option_output {
  388    392   
  389         -
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
         393  +
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
  390    394   
        fn from(builder: Builder) -> Self {
  391    395   
            builder.build()
  392    396   
        }
  393    397   
    }
  394         -
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         398  +
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
  395    399   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  396    400   
    pub struct Builder {}
  397    401   
    impl Builder {
  398         -
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  399         -
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
         402  +
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         403  +
        pub fn build(self) -> crate::output::OptionOutput {
  400    404   
            self.build_enforcing_required_and_enum_traits()
  401    405   
        }
  402         -
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::ErrCollisionsOutput {
  403         -
            crate::output::ErrCollisionsOutput {}
         406  +
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::OptionOutput {
         407  +
            crate::output::OptionOutput {}
  404    408   
        }
  405    409   
    }
  406    410   
}
  407         -
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  408         -
pub mod structure_name_punning_output {
         411  +
/// See [`MatchOutput`](crate::output::MatchOutput).
         412  +
pub mod match_output {
  409    413   
  410         -
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
         414  +
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
  411    415   
        fn from(builder: Builder) -> Self {
  412    416   
            builder.build()
  413    417   
        }
  414    418   
    }
  415         -
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         419  +
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
  416    420   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  417    421   
    pub struct Builder {}
  418    422   
    impl Builder {
  419         -
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  420         -
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
         423  +
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         424  +
        pub fn build(self) -> crate::output::MatchOutput {
  421    425   
            self.build_enforcing_required_and_enum_traits()
  422    426   
        }
  423         -
        fn build_enforcing_required_and_enum_traits(
  424         -
            self,
  425         -
        ) -> crate::output::StructureNamePunningOutput {
  426         -
            crate::output::StructureNamePunningOutput {}
         427  +
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::MatchOutput {
         428  +
            crate::output::MatchOutput {}
  427    429   
        }
  428    430   
    }
  429    431   
}
  430         -
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  431         -
pub mod reserved_words_as_members_output {
         432  +
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         433  +
pub mod rpc_echo_output {
  432    434   
  433         -
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
         435  +
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
  434    436   
        fn from(builder: Builder) -> Self {
  435    437   
            builder.build()
  436    438   
        }
  437    439   
    }
  438         -
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         440  +
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  439    441   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  440    442   
    pub struct Builder {}
  441    443   
    impl Builder {
  442         -
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  443         -
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
         444  +
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         445  +
        pub fn build(self) -> crate::output::RpcEchoOutput {
  444    446   
            self.build_enforcing_required_and_enum_traits()
  445    447   
        }
  446         -
        fn build_enforcing_required_and_enum_traits(
  447         -
            self,
  448         -
        ) -> crate::output::ReservedWordsAsMembersOutput {
  449         -
            crate::output::ReservedWordsAsMembersOutput {}
         448  +
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::RpcEchoOutput {
         449  +
            crate::output::RpcEchoOutput {}
  450    450   
        }
  451    451   
    }
  452    452   
}

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

@@ -1,1 +59,59 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[::pyo3::pymodule]
    3      3   
#[pyo3(name = "naming_test_ops")]
    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         -
    error.add_class::<crate::error::InternalServerError>()?;
           8  +
    input.add_class::<crate::input::ReservedWordsAsMembersInput>()?;
           9  +
    output.add_class::<crate::output::ReservedWordsAsMembersOutput>()?;
    9     10   
    error.add_class::<crate::error::ValidationException>()?;
   10         -
    let model = ::pyo3::types::PyModule::new(py, "model")?;
   11         -
    model.add_class::<crate::model::ValidationExceptionField>()?;
   12         -
    output.add_class::<crate::output::RpcEchoOutput>()?;
          11  +
    error.add_class::<crate::error::InternalServerError>()?;
          12  +
    input.add_class::<crate::input::StructureNamePunningInput>()?;
          13  +
    output.add_class::<crate::output::StructureNamePunningOutput>()?;
          14  +
    input.add_class::<crate::input::ErrCollisionsInput>()?;
          15  +
    output.add_class::<crate::output::ErrCollisionsOutput>()?;
          16  +
    error.add_class::<crate::error::CollidingError>()?;
          17  +
    error.add_class::<crate::error::CollidingException>()?;
          18  +
    input.add_class::<crate::input::ResultInput>()?;
          19  +
    output.add_class::<crate::output::ResultOutput>()?;
          20  +
    input.add_class::<crate::input::OptionInput>()?;
          21  +
    output.add_class::<crate::output::OptionOutput>()?;
          22  +
    input.add_class::<crate::input::MatchInput>()?;
          23  +
    output.add_class::<crate::output::MatchOutput>()?;
   13     24   
    input.add_class::<crate::input::RpcEchoInput>()?;
          25  +
    output.add_class::<crate::output::RpcEchoOutput>()?;
          26  +
    let model = ::pyo3::types::PyModule::new(py, "model")?;
   14     27   
    model.add_class::<crate::model::UnknownVariantCollidingEnum>()?;
   15         -
    output.add_class::<crate::output::MatchOutput>()?;
   16         -
    input.add_class::<crate::input::MatchInput>()?;
   17         -
    output.add_class::<crate::output::OptionOutput>()?;
   18         -
    input.add_class::<crate::input::OptionInput>()?;
   19         -
    output.add_class::<crate::output::ResultOutput>()?;
   20         -
    input.add_class::<crate::input::ResultInput>()?;
   21         -
    error.add_class::<crate::error::CollidingException>()?;
   22         -
    error.add_class::<crate::error::CollidingError>()?;
   23         -
    output.add_class::<crate::output::ErrCollisionsOutput>()?;
   24         -
    input.add_class::<crate::input::ErrCollisionsInput>()?;
   25         -
    output.add_class::<crate::output::StructureNamePunningOutput>()?;
   26         -
    input.add_class::<crate::input::StructureNamePunningInput>()?;
   27     28   
    model.add_class::<crate::model::Vec>()?;
   28         -
    output.add_class::<crate::output::ReservedWordsAsMembersOutput>()?;
   29         -
    input.add_class::<crate::input::ReservedWordsAsMembersInput>()?;
          29  +
    model.add_class::<crate::model::ValidationExceptionField>()?;
   30     30   
    ::pyo3::py_run!(
   31     31   
        py,
   32     32   
        input,
   33     33   
        "import sys; sys.modules['naming_test_ops.input'] = input"
   34     34   
    );
   35     35   
    m.add_submodule(input)?;
   36     36   
    ::pyo3::py_run!(
   37     37   
        py,
   38     38   
        output,
   39     39   
        "import sys; sys.modules['naming_test_ops.output'] = output"

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

@@ -1,1 +347,347 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Python handler for operation `RPCEcho`.
    3         -
pub(crate) async fn rpc_echo(
    4         -
    input: crate::input::RpcEchoInput,
           2  +
/// Python handler for operation `ReservedWordsAsMembers`.
           3  +
pub(crate) async fn reserved_words_as_members(
           4  +
    input: crate::input::ReservedWordsAsMembersInput,
    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<crate::output::RpcEchoOutput, crate::error::RPCEchoError> {
           9  +
) -> std::result::Result<
          10  +
    crate::output::ReservedWordsAsMembersOutput,
          11  +
    crate::error::ReservedWordsAsMembersError,
          12  +
> {
   10     13   
    // Async block used to run the handler and catch any Python error.
   11     14   
    let result = if handler.is_coroutine {
   12         -
        ::tracing::trace!(name = "rpc_echo", "executing python handler coroutine");
          15  +
        ::tracing::trace!(
          16  +
            name = "reserved_words_as_members",
          17  +
            "executing python handler coroutine"
          18  +
        );
   13     19   
        let result = ::pyo3::Python::with_gil(|py| {
   14     20   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   15     21   
            let coroutine = if handler.args == 1 {
   16     22   
                pyhandler.call1((input,))?
   17     23   
            } else {
   18     24   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   19     25   
            };
   20     26   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   21     27   
        })?;
   22     28   
        result.await.and_then(|r| {
   23         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::RpcEchoOutput>(py))
          29  +
            ::pyo3::Python::with_gil(|py| {
          30  +
                r.extract::<crate::output::ReservedWordsAsMembersOutput>(py)
          31  +
            })
   24     32   
        })
   25     33   
    } else {
   26         -
        ::tracing::trace!(name = "rpc_echo", "executing python handler function");
          34  +
        ::tracing::trace!(
          35  +
            name = "reserved_words_as_members",
          36  +
            "executing python handler function"
          37  +
        );
   27     38   
        ::pyo3::Python::with_gil(|py| {
   28     39   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   29     40   
            let output = if handler.args == 1 {
   30     41   
                pyhandler.call1((input,))?
   31     42   
            } else {
   32     43   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   33     44   
            };
   34         -
            output.extract::<crate::output::RpcEchoOutput>()
          45  +
            output.extract::<crate::output::ReservedWordsAsMembersOutput>()
   35     46   
        })
   36     47   
    };
   37     48   
    // Catch and record a Python traceback.
   38     49   
    result.map_err(|e| {
   39     50   
        let rich_py_err =
   40     51   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   41     52   
                e.clone_ref(py)
   42     53   
            }));
   43     54   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   44     55   
        e.into()
   45     56   
    })
   46     57   
}
   47     58   
   48         -
/// Python handler for operation `Match`.
   49         -
pub(crate) async fn r#match(
   50         -
    input: crate::input::MatchInput,
          59  +
/// Python handler for operation `StructureNamePunning`.
          60  +
pub(crate) async fn structure_name_punning(
          61  +
    input: crate::input::StructureNamePunningInput,
   51     62   
    state: ::aws_smithy_legacy_http_server::Extension<
   52     63   
        ::aws_smithy_http_server_python::context::PyContext,
   53     64   
    >,
   54     65   
    handler: ::aws_smithy_http_server_python::PyHandler,
   55         -
) -> std::result::Result<crate::output::MatchOutput, crate::error::MatchError> {
          66  +
) -> std::result::Result<
          67  +
    crate::output::StructureNamePunningOutput,
          68  +
    crate::error::StructureNamePunningError,
          69  +
> {
   56     70   
    // Async block used to run the handler and catch any Python error.
   57     71   
    let result = if handler.is_coroutine {
   58         -
        ::tracing::trace!(name = "r#match", "executing python handler coroutine");
          72  +
        ::tracing::trace!(
          73  +
            name = "structure_name_punning",
          74  +
            "executing python handler coroutine"
          75  +
        );
   59     76   
        let result = ::pyo3::Python::with_gil(|py| {
   60     77   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   61     78   
            let coroutine = if handler.args == 1 {
   62     79   
                pyhandler.call1((input,))?
   63     80   
            } else {
   64     81   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   65     82   
            };
   66     83   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   67     84   
        })?;
   68     85   
        result.await.and_then(|r| {
   69         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MatchOutput>(py))
          86  +
            ::pyo3::Python::with_gil(|py| {
          87  +
                r.extract::<crate::output::StructureNamePunningOutput>(py)
          88  +
            })
   70     89   
        })
   71     90   
    } else {
   72         -
        ::tracing::trace!(name = "r#match", "executing python handler function");
          91  +
        ::tracing::trace!(
          92  +
            name = "structure_name_punning",
          93  +
            "executing python handler function"
          94  +
        );
   73     95   
        ::pyo3::Python::with_gil(|py| {
   74     96   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   75     97   
            let output = if handler.args == 1 {
   76     98   
                pyhandler.call1((input,))?
   77     99   
            } else {
   78    100   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   79    101   
            };
   80         -
            output.extract::<crate::output::MatchOutput>()
         102  +
            output.extract::<crate::output::StructureNamePunningOutput>()
   81    103   
        })
   82    104   
    };
   83    105   
    // Catch and record a Python traceback.
   84    106   
    result.map_err(|e| {
   85    107   
        let rich_py_err =
   86    108   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   87    109   
                e.clone_ref(py)
   88    110   
            }));
   89    111   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   90    112   
        e.into()
   91    113   
    })
   92    114   
}
   93    115   
   94         -
/// Python handler for operation `Option`.
   95         -
pub(crate) async fn option(
   96         -
    input: crate::input::OptionInput,
         116  +
/// Python handler for operation `ErrCollisions`.
         117  +
pub(crate) async fn err_collisions(
         118  +
    input: crate::input::ErrCollisionsInput,
   97    119   
    state: ::aws_smithy_legacy_http_server::Extension<
   98    120   
        ::aws_smithy_http_server_python::context::PyContext,
   99    121   
    >,
  100    122   
    handler: ::aws_smithy_http_server_python::PyHandler,
  101         -
) -> std::result::Result<crate::output::OptionOutput, crate::error::OptionError> {
         123  +
) -> std::result::Result<crate::output::ErrCollisionsOutput, crate::error::ErrCollisionsError> {
  102    124   
    // Async block used to run the handler and catch any Python error.
  103    125   
    let result = if handler.is_coroutine {
  104         -
        ::tracing::trace!(name = "option", "executing python handler coroutine");
         126  +
        ::tracing::trace!(
         127  +
            name = "err_collisions",
         128  +
            "executing python handler coroutine"
         129  +
        );
  105    130   
        let result = ::pyo3::Python::with_gil(|py| {
  106    131   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  107    132   
            let coroutine = if handler.args == 1 {
  108    133   
                pyhandler.call1((input,))?
  109    134   
            } else {
  110    135   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  111    136   
            };
  112    137   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  113    138   
        })?;
  114    139   
        result.await.and_then(|r| {
  115         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::OptionOutput>(py))
         140  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ErrCollisionsOutput>(py))
  116    141   
        })
  117    142   
    } else {
  118         -
        ::tracing::trace!(name = "option", "executing python handler function");
         143  +
        ::tracing::trace!(name = "err_collisions", "executing python handler function");
  119    144   
        ::pyo3::Python::with_gil(|py| {
  120    145   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  121    146   
            let output = if handler.args == 1 {
  122    147   
                pyhandler.call1((input,))?
  123    148   
            } else {
  124    149   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  125    150   
            };
  126         -
            output.extract::<crate::output::OptionOutput>()
         151  +
            output.extract::<crate::output::ErrCollisionsOutput>()
  127    152   
        })
  128    153   
    };
  129    154   
    // Catch and record a Python traceback.
  130    155   
    result.map_err(|e| {
  131    156   
        let rich_py_err =
  132    157   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  133    158   
                e.clone_ref(py)
  134    159   
            }));
  135    160   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  136    161   
        e.into()
  137    162   
    })
  138    163   
}
  139    164   
  140    165   
/// Python handler for operation `Result`.
  141    166   
pub(crate) async fn result(
  142    167   
    input: crate::input::ResultInput,
  143    168   
    state: ::aws_smithy_legacy_http_server::Extension<
  144    169   
        ::aws_smithy_http_server_python::context::PyContext,
  145    170   
    >,
  146    171   
    handler: ::aws_smithy_http_server_python::PyHandler,
  147    172   
) -> std::result::Result<crate::output::ResultOutput, crate::error::ResultError> {
  148    173   
    // Async block used to run the handler and catch any Python error.
  149    174   
    let result = if handler.is_coroutine {
  150    175   
        ::tracing::trace!(name = "result", "executing python handler coroutine");
  151    176   
        let result = ::pyo3::Python::with_gil(|py| {
  152    177   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  153    178   
            let coroutine = if handler.args == 1 {
  154    179   
                pyhandler.call1((input,))?
  155    180   
            } else {
  156    181   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  157    182   
            };
  158    183   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  159    184   
        })?;
  160    185   
        result.await.and_then(|r| {
  161    186   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ResultOutput>(py))
  162    187   
        })
  163    188   
    } else {
  164    189   
        ::tracing::trace!(name = "result", "executing python handler function");
  165    190   
        ::pyo3::Python::with_gil(|py| {
  166    191   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  167    192   
            let output = if handler.args == 1 {
  168    193   
                pyhandler.call1((input,))?
  169    194   
            } else {
  170    195   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  171    196   
            };
  172    197   
            output.extract::<crate::output::ResultOutput>()
  173    198   
        })
  174    199   
    };
  175    200   
    // Catch and record a Python traceback.
  176    201   
    result.map_err(|e| {
  177    202   
        let rich_py_err =
  178    203   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  179    204   
                e.clone_ref(py)
  180    205   
            }));
  181    206   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  182    207   
        e.into()
  183    208   
    })
  184    209   
}
  185    210   
  186         -
/// Python handler for operation `ErrCollisions`.
  187         -
pub(crate) async fn err_collisions(
  188         -
    input: crate::input::ErrCollisionsInput,
         211  +
/// Python handler for operation `Option`.
         212  +
pub(crate) async fn option(
         213  +
    input: crate::input::OptionInput,
  189    214   
    state: ::aws_smithy_legacy_http_server::Extension<
  190    215   
        ::aws_smithy_http_server_python::context::PyContext,
  191    216   
    >,
  192    217   
    handler: ::aws_smithy_http_server_python::PyHandler,
  193         -
) -> std::result::Result<crate::output::ErrCollisionsOutput, crate::error::ErrCollisionsError> {
         218  +
) -> std::result::Result<crate::output::OptionOutput, crate::error::OptionError> {
  194    219   
    // Async block used to run the handler and catch any Python error.
  195    220   
    let result = if handler.is_coroutine {
  196         -
        ::tracing::trace!(
  197         -
            name = "err_collisions",
  198         -
            "executing python handler coroutine"
  199         -
        );
         221  +
        ::tracing::trace!(name = "option", "executing python handler coroutine");
  200    222   
        let result = ::pyo3::Python::with_gil(|py| {
  201    223   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  202    224   
            let coroutine = if handler.args == 1 {
  203    225   
                pyhandler.call1((input,))?
  204    226   
            } else {
  205    227   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  206    228   
            };
  207    229   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  208    230   
        })?;
  209    231   
        result.await.and_then(|r| {
  210         -
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::ErrCollisionsOutput>(py))
         232  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::OptionOutput>(py))
  211    233   
        })
  212    234   
    } else {
  213         -
        ::tracing::trace!(name = "err_collisions", "executing python handler function");
         235  +
        ::tracing::trace!(name = "option", "executing python handler function");
  214    236   
        ::pyo3::Python::with_gil(|py| {
  215    237   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  216    238   
            let output = if handler.args == 1 {
  217    239   
                pyhandler.call1((input,))?
  218    240   
            } else {
  219    241   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  220    242   
            };
  221         -
            output.extract::<crate::output::ErrCollisionsOutput>()
         243  +
            output.extract::<crate::output::OptionOutput>()
  222    244   
        })
  223    245   
    };
  224    246   
    // Catch and record a Python traceback.
  225    247   
    result.map_err(|e| {
  226    248   
        let rich_py_err =
  227    249   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  228    250   
                e.clone_ref(py)
  229    251   
            }));
  230    252   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  231    253   
        e.into()
  232    254   
    })
  233    255   
}
  234    256   
  235         -
/// Python handler for operation `StructureNamePunning`.
  236         -
pub(crate) async fn structure_name_punning(
  237         -
    input: crate::input::StructureNamePunningInput,
         257  +
/// Python handler for operation `Match`.
         258  +
pub(crate) async fn r#match(
         259  +
    input: crate::input::MatchInput,
  238    260   
    state: ::aws_smithy_legacy_http_server::Extension<
  239    261   
        ::aws_smithy_http_server_python::context::PyContext,
  240    262   
    >,
  241    263   
    handler: ::aws_smithy_http_server_python::PyHandler,
  242         -
) -> std::result::Result<
  243         -
    crate::output::StructureNamePunningOutput,
  244         -
    crate::error::StructureNamePunningError,
  245         -
> {
         264  +
) -> std::result::Result<crate::output::MatchOutput, crate::error::MatchError> {
  246    265   
    // Async block used to run the handler and catch any Python error.
  247    266   
    let result = if handler.is_coroutine {
  248         -
        ::tracing::trace!(
  249         -
            name = "structure_name_punning",
  250         -
            "executing python handler coroutine"
  251         -
        );
         267  +
        ::tracing::trace!(name = "r#match", "executing python handler coroutine");
  252    268   
        let result = ::pyo3::Python::with_gil(|py| {
  253    269   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  254    270   
            let coroutine = if handler.args == 1 {
  255    271   
                pyhandler.call1((input,))?
  256    272   
            } else {
  257    273   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  258    274   
            };
  259    275   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  260    276   
        })?;
  261    277   
        result.await.and_then(|r| {
  262         -
            ::pyo3::Python::with_gil(|py| {
  263         -
                r.extract::<crate::output::StructureNamePunningOutput>(py)
  264         -
            })
         278  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MatchOutput>(py))
  265    279   
        })
  266    280   
    } else {
  267         -
        ::tracing::trace!(
  268         -
            name = "structure_name_punning",
  269         -
            "executing python handler function"
  270         -
        );
         281  +
        ::tracing::trace!(name = "r#match", "executing python handler function");
  271    282   
        ::pyo3::Python::with_gil(|py| {
  272    283   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  273    284   
            let output = if handler.args == 1 {
  274    285   
                pyhandler.call1((input,))?
  275    286   
            } else {
  276    287   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  277    288   
            };
  278         -
            output.extract::<crate::output::StructureNamePunningOutput>()
         289  +
            output.extract::<crate::output::MatchOutput>()
  279    290   
        })
  280    291   
    };
  281    292   
    // Catch and record a Python traceback.
  282    293   
    result.map_err(|e| {
  283    294   
        let rich_py_err =
  284    295   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  285    296   
                e.clone_ref(py)
  286    297   
            }));
  287    298   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  288    299   
        e.into()
  289    300   
    })
  290    301   
}
  291    302   
  292         -
/// Python handler for operation `ReservedWordsAsMembers`.
  293         -
pub(crate) async fn reserved_words_as_members(
  294         -
    input: crate::input::ReservedWordsAsMembersInput,
         303  +
/// Python handler for operation `RPCEcho`.
         304  +
pub(crate) async fn rpc_echo(
         305  +
    input: crate::input::RpcEchoInput,
  295    306   
    state: ::aws_smithy_legacy_http_server::Extension<
  296    307   
        ::aws_smithy_http_server_python::context::PyContext,
  297    308   
    >,
  298    309   
    handler: ::aws_smithy_http_server_python::PyHandler,
  299         -
) -> std::result::Result<
  300         -
    crate::output::ReservedWordsAsMembersOutput,
  301         -
    crate::error::ReservedWordsAsMembersError,
  302         -
> {
         310  +
) -> std::result::Result<crate::output::RpcEchoOutput, crate::error::RPCEchoError> {
  303    311   
    // Async block used to run the handler and catch any Python error.
  304    312   
    let result = if handler.is_coroutine {
  305         -
        ::tracing::trace!(
  306         -
            name = "reserved_words_as_members",
  307         -
            "executing python handler coroutine"
  308         -
        );
         313  +
        ::tracing::trace!(name = "rpc_echo", "executing python handler coroutine");
  309    314   
        let result = ::pyo3::Python::with_gil(|py| {
  310    315   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  311    316   
            let coroutine = if handler.args == 1 {
  312    317   
                pyhandler.call1((input,))?
  313    318   
            } else {
  314    319   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  315    320   
            };
  316    321   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  317    322   
        })?;
  318    323   
        result.await.and_then(|r| {
  319         -
            ::pyo3::Python::with_gil(|py| {
  320         -
                r.extract::<crate::output::ReservedWordsAsMembersOutput>(py)
  321         -
            })
         324  +
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::RpcEchoOutput>(py))
  322    325   
        })
  323    326   
    } else {
  324         -
        ::tracing::trace!(
  325         -
            name = "reserved_words_as_members",
  326         -
            "executing python handler function"
  327         -
        );
         327  +
        ::tracing::trace!(name = "rpc_echo", "executing python handler function");
  328    328   
        ::pyo3::Python::with_gil(|py| {
  329    329   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  330    330   
            let output = if handler.args == 1 {
  331    331   
                pyhandler.call1((input,))?
  332    332   
            } else {
  333    333   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  334    334   
            };
  335         -
            output.extract::<crate::output::ReservedWordsAsMembersOutput>()
         335  +
            output.extract::<crate::output::RpcEchoOutput>()
  336    336   
        })
  337    337   
    };
  338    338   
    // Catch and record a Python traceback.
  339    339   
    result.map_err(|e| {
  340    340   
        let rich_py_err =
  341    341   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  342    342   
                e.clone_ref(py)
  343    343   
            }));
  344    344   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  345    345   
        e.into()

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/lib.rs

@@ -1,1 +44,45 @@
    5      5   
#![allow(clippy::large_enum_variant)]
    6      6   
#![allow(clippy::wrong_self_convention)]
    7      7   
#![allow(clippy::should_implement_trait)]
    8      8   
#![allow(clippy::disallowed_names)]
    9      9   
#![allow(clippy::vec_init_then_push)]
   10     10   
#![allow(clippy::type_complexity)]
   11     11   
#![allow(clippy::needless_return)]
   12     12   
#![allow(clippy::derive_partial_eq_without_eq)]
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::useless_conversion)]
   15     16   
#![allow(clippy::deprecated_semver)]
   16     17   
#![allow(clippy::uninlined_format_args)]
   17     18   
#![allow(rustdoc::bare_urls)]
   18     19   
#![allow(rustdoc::redundant_explicit_links)]
   19     20   
#![allow(rustdoc::broken_intra_doc_links)]
   20     21   
#![allow(rustdoc::invalid_html_tags)]
   21     22   
#![forbid(unsafe_code)]
   22     23   
#![cfg_attr(docsrs, feature(doc_cfg))]
   23     24   
//! Confounds model generation machinery with lots of problematic names
   24     25   

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/rust-server-codegen-python/src/model.rs

@@ -1,1 +31,141 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[::pyo3::pyclass]
           3  +
/// :param value typing.Optional\[str\]:
           4  +
/// :rtype None:
           5  +
#[allow(missing_docs)] // documentation missing in model
           6  +
#[derive(
           7  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           8  +
)]
           9  +
pub struct Result {
          10  +
    #[pyo3(get, set)]
          11  +
    /// :type typing.Optional\[str\]:
          12  +
    #[allow(missing_docs)] // documentation missing in model
          13  +
    pub value: ::std::option::Option<::std::string::String>,
          14  +
}
          15  +
impl Result {
          16  +
    #[allow(missing_docs)] // documentation missing in model
          17  +
    pub fn value(&self) -> ::std::option::Option<&str> {
          18  +
        self.value.as_deref()
          19  +
    }
          20  +
}
          21  +
#[allow(clippy::new_without_default)]
          22  +
#[allow(clippy::too_many_arguments)]
          23  +
#[::pyo3::pymethods]
          24  +
impl Result {
          25  +
    #[new]
          26  +
    pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
          27  +
        Self { value }
          28  +
    }
          29  +
    fn __repr__(&self) -> String {
          30  +
        format!("{self:?}")
          31  +
    }
          32  +
    fn __str__(&self) -> String {
          33  +
        format!("{self:?}")
          34  +
    }
          35  +
}
          36  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Result> {
          37  +
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
          38  +
        ob.extract::<Result>().map(Box::new)
          39  +
    }
          40  +
}
          41  +
          42  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Result> {
          43  +
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
          44  +
        (*self).into_py(py)
          45  +
    }
          46  +
}
          47  +
impl crate::constrained::Constrained for crate::model::Result {
          48  +
    type Unconstrained = crate::model::result_internal::Builder;
          49  +
}
          50  +
impl Result {
          51  +
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
          52  +
    pub fn builder() -> crate::model::result::Builder {
          53  +
        crate::model::result::Builder::default()
          54  +
    }
          55  +
}
          56  +
          57  +
#[::pyo3::pyclass]
          58  +
/// :param value typing.Optional\[str\]:
          59  +
/// :rtype None:
          60  +
#[allow(missing_docs)] // documentation missing in model
          61  +
#[derive(
          62  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          63  +
)]
          64  +
pub struct Option {
          65  +
    #[pyo3(get, set)]
          66  +
    /// :type typing.Optional\[str\]:
          67  +
    #[allow(missing_docs)] // documentation missing in model
          68  +
    pub value: ::std::option::Option<::std::string::String>,
          69  +
}
          70  +
impl Option {
          71  +
    #[allow(missing_docs)] // documentation missing in model
          72  +
    pub fn value(&self) -> ::std::option::Option<&str> {
          73  +
        self.value.as_deref()
          74  +
    }
          75  +
}
          76  +
#[allow(clippy::new_without_default)]
          77  +
#[allow(clippy::too_many_arguments)]
          78  +
#[::pyo3::pymethods]
          79  +
impl Option {
          80  +
    #[new]
          81  +
    pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
          82  +
        Self { value }
          83  +
    }
          84  +
    fn __repr__(&self) -> String {
          85  +
        format!("{self:?}")
          86  +
    }
          87  +
    fn __str__(&self) -> String {
          88  +
        format!("{self:?}")
          89  +
    }
          90  +
}
          91  +
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Option> {
          92  +
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
          93  +
        ob.extract::<Option>().map(Box::new)
          94  +
    }
          95  +
}
          96  +
          97  +
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Option> {
          98  +
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
          99  +
        (*self).into_py(py)
         100  +
    }
         101  +
}
         102  +
impl crate::constrained::Constrained for crate::model::Option {
         103  +
    type Unconstrained = crate::model::option_internal::Builder;
         104  +
}
         105  +
impl Option {
         106  +
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
         107  +
    pub fn builder() -> crate::model::option::Builder {
         108  +
        crate::model::option::Builder::default()
         109  +
    }
         110  +
}
         111  +
    2    112   
#[::pyo3::pyclass]
    3    113   
/// :param result typing.Optional\[naming_test_structs.model.Result\]:
    4    114   
/// :param result_list typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
    5    115   
/// :param option typing.Optional\[naming_test_structs.model.Option\]:
    6    116   
/// :param option_list typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
    7    117   
/// :param some_union typing.Optional\[naming_test_structs.model.SomeUnion\]:
    8    118   
/// :rtype None:
    9    119   
#[allow(missing_docs)] // documentation missing in model
   10    120   
#[derive(
   11    121   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
@@ -176,286 +343,461 @@
  196    306   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  197    307   
        PyUnionMarkerSomeUnion(self).into_py(py)
  198    308   
    }
  199    309   
}
  200    310   
impl<'source> ::pyo3::FromPyObject<'source> for SomeUnion {
  201    311   
    fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  202    312   
        let data: PyUnionMarkerSomeUnion = obj.extract()?;
  203    313   
        Ok(data.0)
  204    314   
    }
  205    315   
}
         316  +
/// See [`Result`](crate::model::Result).
         317  +
pub(crate) mod result_internal {
  206    318   
  207         -
#[::pyo3::pyclass]
  208         -
/// :param value typing.Optional\[str\]:
  209         -
/// :rtype None:
  210         -
#[allow(missing_docs)] // documentation missing in model
  211         -
#[derive(
  212         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  213         -
)]
  214         -
pub struct Option {
  215         -
    #[pyo3(get, set)]
  216         -
    /// :type typing.Optional\[str\]:
  217         -
    #[allow(missing_docs)] // documentation missing in model
  218         -
    pub value: ::std::option::Option<::std::string::String>,
  219         -
}
  220         -
impl Option {
  221         -
    #[allow(missing_docs)] // documentation missing in model
  222         -
    pub fn value(&self) -> ::std::option::Option<&str> {
  223         -
        self.value.as_deref()
  224         -
    }
  225         -
}
  226         -
#[allow(clippy::new_without_default)]
  227         -
#[allow(clippy::too_many_arguments)]
  228         -
#[::pyo3::pymethods]
  229         -
impl Option {
  230         -
    #[new]
  231         -
    pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
  232         -
        Self { value }
  233         -
    }
  234         -
    fn __repr__(&self) -> String {
  235         -
        format!("{self:?}")
         319  +
    impl ::std::convert::From<Builder> for crate::model::Result {
         320  +
        fn from(builder: Builder) -> Self {
         321  +
            builder.build()
         322  +
        }
  236    323   
    }
  237         -
    fn __str__(&self) -> String {
  238         -
        format!("{self:?}")
         324  +
    /// A builder for [`Result`](crate::model::Result).
         325  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         326  +
    pub(crate) struct Builder {
         327  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
  239    328   
    }
  240         -
}
  241         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Option> {
  242         -
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  243         -
        ob.extract::<Option>().map(Box::new)
         329  +
    impl Builder {
         330  +
        #[allow(missing_docs)] // documentation missing in model
         331  +
        pub(crate) fn set_value(
         332  +
            mut self,
         333  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         334  +
        ) -> Self {
         335  +
            self.value = input.map(|v| v.into());
         336  +
            self
         337  +
        }
         338  +
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         339  +
        pub fn build(self) -> crate::model::Result {
         340  +
            self.build_enforcing_all_constraints()
         341  +
        }
         342  +
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
         343  +
            crate::model::Result { value: self.value }
         344  +
        }
  244    345   
    }
  245    346   
}
         347  +
/// See [`Result`](crate::model::Result).
         348  +
pub mod result {
  246    349   
  247         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Option> {
  248         -
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  249         -
        (*self).into_py(py)
         350  +
    impl ::std::convert::From<Builder> for crate::model::Result {
         351  +
        fn from(builder: Builder) -> Self {
         352  +
            builder.build()
         353  +
        }
  250    354   
    }
  251         -
}
  252         -
impl crate::constrained::Constrained for crate::model::Option {
  253         -
    type Unconstrained = crate::model::option_internal::Builder;
  254         -
}
  255         -
impl Option {
  256         -
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
  257         -
    pub fn builder() -> crate::model::option::Builder {
  258         -
        crate::model::option::Builder::default()
         355  +
    /// A builder for [`Result`](crate::model::Result).
         356  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         357  +
    pub struct Builder {
         358  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
  259    359   
    }
  260         -
}
  261         -
  262         -
#[::pyo3::pyclass]
  263         -
/// :param value typing.Optional\[str\]:
  264         -
/// :rtype None:
  265         -
#[allow(missing_docs)] // documentation missing in model
  266         -
#[derive(
  267         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  268         -
)]
  269         -
pub struct Result {
  270         -
    #[pyo3(get, set)]
  271         -
    /// :type typing.Optional\[str\]:
  272         -
    #[allow(missing_docs)] // documentation missing in model
  273         -
    pub value: ::std::option::Option<::std::string::String>,
  274         -
}
  275         -
impl Result {
  276         -
    #[allow(missing_docs)] // documentation missing in model
  277         -
    pub fn value(&self) -> ::std::option::Option<&str> {
  278         -
        self.value.as_deref()
         360  +
    impl Builder {
         361  +
        #[allow(missing_docs)] // documentation missing in model
         362  +
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         363  +
            self.value = input;
         364  +
            self
         365  +
        }
         366  +
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         367  +
        pub fn build(self) -> crate::model::Result {
         368  +
            self.build_enforcing_required_and_enum_traits()
         369  +
        }
         370  +
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Result {
         371  +
            crate::model::Result { value: self.value }
         372  +
        }
  279    373   
    }
  280    374   
}
  281         -
#[allow(clippy::new_without_default)]
  282         -
#[allow(clippy::too_many_arguments)]
  283         -
#[::pyo3::pymethods]
  284         -
impl Result {
  285         -
    #[new]
  286         -
    pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
  287         -
        Self { value }
  288         -
    }
  289         -
    fn __repr__(&self) -> String {
  290         -
        format!("{self:?}")
         375  +
/// See [`Option`](crate::model::Option).
         376  +
pub(crate) mod option_internal {
         377  +
         378  +
    impl ::std::convert::From<Builder> for crate::model::Option {
         379  +
        fn from(builder: Builder) -> Self {
         380  +
            builder.build()
         381  +
        }
  291    382   
    }
  292         -
    fn __str__(&self) -> String {
  293         -
        format!("{self:?}")
         383  +
    /// A builder for [`Option`](crate::model::Option).
         384  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         385  +
    pub(crate) struct Builder {
         386  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
  294    387   
    }
  295         -
}
  296         -
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Result> {
  297         -
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  298         -
        ob.extract::<Result>().map(Box::new)
         388  +
    impl Builder {
         389  +
        #[allow(missing_docs)] // documentation missing in model
         390  +
        pub(crate) fn set_value(
         391  +
            mut self,
         392  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         393  +
        ) -> Self {
         394  +
            self.value = input.map(|v| v.into());
         395  +
            self
         396  +
        }
         397  +
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         398  +
        pub fn build(self) -> crate::model::Option {
         399  +
            self.build_enforcing_all_constraints()
         400  +
        }
         401  +
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
         402  +
            crate::model::Option { value: self.value }
         403  +
        }
  299    404   
    }
  300    405   
}
         406  +
/// See [`Option`](crate::model::Option).
         407  +
pub mod option {
  301    408   
  302         -
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Result> {
  303         -
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  304         -
        (*self).into_py(py)
         409  +
    impl ::std::convert::From<Builder> for crate::model::Option {
         410  +
        fn from(builder: Builder) -> Self {
         411  +
            builder.build()
         412  +
        }
  305    413   
    }
  306         -
}
  307         -
impl crate::constrained::Constrained for crate::model::Result {
  308         -
    type Unconstrained = crate::model::result_internal::Builder;
  309         -
}
  310         -
impl Result {
  311         -
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
  312         -
    pub fn builder() -> crate::model::result::Builder {
  313         -
        crate::model::result::Builder::default()
         414  +
    /// A builder for [`Option`](crate::model::Option).
         415  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         416  +
    pub struct Builder {
         417  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
         418  +
    }
         419  +
    impl Builder {
         420  +
        #[allow(missing_docs)] // documentation missing in model
         421  +
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         422  +
            self.value = input;
         423  +
            self
         424  +
        }
         425  +
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         426  +
        pub fn build(self) -> crate::model::Option {
         427  +
            self.build_enforcing_required_and_enum_traits()
         428  +
        }
         429  +
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Option {
         430  +
            crate::model::Option { value: self.value }
         431  +
        }
  314    432   
    }
  315    433   
}
  316    434   
/// See [`SomethingElse`](crate::model::SomethingElse).
  317    435   
pub(crate) mod something_else_internal {
  318    436   
  319    437   
    impl ::std::convert::From<Builder> for crate::model::SomethingElse {
  320    438   
        fn from(builder: Builder) -> Self {
  321    439   
            builder.build()
  322    440   
        }
  323    441   
    }
@@ -423,541 +570,0 @@
  443    561   
            crate::model::SomethingElse {
  444    562   
                result: self.result,
  445    563   
                result_list: self.result_list,
  446    564   
                option: self.option,
  447    565   
                option_list: self.option_list,
  448    566   
                some_union: self.some_union,
  449    567   
            }
  450    568   
        }
  451    569   
    }
  452    570   
}
  453         -
/// See [`Option`](crate::model::Option).
  454         -
pub(crate) mod option_internal {
  455         -
  456         -
    impl ::std::convert::From<Builder> for crate::model::Option {
  457         -
        fn from(builder: Builder) -> Self {
  458         -
            builder.build()
  459         -
        }
  460         -
    }
  461         -
    /// A builder for [`Option`](crate::model::Option).
  462         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  463         -
    pub(crate) struct Builder {
  464         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  465         -
    }
  466         -
    impl Builder {
  467         -
        #[allow(missing_docs)] // documentation missing in model
  468         -
        pub(crate) fn set_value(
  469         -
            mut self,
  470         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  471         -
        ) -> Self {
  472         -
            self.value = input.map(|v| v.into());
  473         -
            self
  474         -
        }
  475         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
  476         -
        pub fn build(self) -> crate::model::Option {
  477         -
            self.build_enforcing_all_constraints()
  478         -
        }
  479         -
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
  480         -
            crate::model::Option { value: self.value }
  481         -
        }
  482         -
    }
  483         -
}
  484         -
/// See [`Option`](crate::model::Option).
  485         -
pub mod option {
  486         -
  487         -
    impl ::std::convert::From<Builder> for crate::model::Option {
  488         -
        fn from(builder: Builder) -> Self {
  489         -
            builder.build()
  490         -
        }
  491         -
    }
  492         -
    /// A builder for [`Option`](crate::model::Option).
  493         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  494         -
    pub struct Builder {
  495         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  496         -
    }
  497         -
    impl Builder {
  498         -
        #[allow(missing_docs)] // documentation missing in model
  499         -
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  500         -
            self.value = input;
  501         -
            self
  502         -
        }
  503         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
  504         -
        pub fn build(self) -> crate::model::Option {
  505         -
            self.build_enforcing_required_and_enum_traits()
  506         -
        }
  507         -
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Option {
  508         -
            crate::model::Option { value: self.value }
  509         -
        }
  510         -
    }
  511         -
}
  512         -
/// See [`Result`](crate::model::Result).
  513         -
pub(crate) mod result_internal {
  514         -
  515         -
    impl ::std::convert::From<Builder> for crate::model::Result {
  516         -
        fn from(builder: Builder) -> Self {
  517         -
            builder.build()
  518         -
        }
  519         -
    }
  520         -
    /// A builder for [`Result`](crate::model::Result).
  521         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  522         -
    pub(crate) struct Builder {
  523         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  524         -
    }
  525         -
    impl Builder {
  526         -
        #[allow(missing_docs)] // documentation missing in model
  527         -
        pub(crate) fn set_value(
  528         -
            mut self,
  529         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  530         -
        ) -> Self {
  531         -
            self.value = input.map(|v| v.into());
  532         -
            self
  533         -
        }
  534         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
  535         -
        pub fn build(self) -> crate::model::Result {
  536         -
            self.build_enforcing_all_constraints()
  537         -
        }
  538         -
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
  539         -
            crate::model::Result { value: self.value }
  540         -
        }
  541         -
    }
  542         -
}
  543         -
/// See [`Result`](crate::model::Result).
  544         -
pub mod result {
  545         -
  546         -
    impl ::std::convert::From<Builder> for crate::model::Result {
  547         -
        fn from(builder: Builder) -> Self {
  548         -
            builder.build()
  549         -
        }
  550         -
    }
  551         -
    /// A builder for [`Result`](crate::model::Result).
  552         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  553         -
    pub struct Builder {
  554         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  555         -
    }
  556         -
    impl Builder {
  557         -
        #[allow(missing_docs)] // documentation missing in model
  558         -
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  559         -
            self.value = input;
  560         -
            self
  561         -
        }
  562         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
  563         -
        pub fn build(self) -> crate::model::Result {
  564         -
            self.build_enforcing_required_and_enum_traits()
  565         -
        }
  566         -
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Result {
  567         -
            crate::model::Result { value: self.value }
  568         -
        }
  569         -
    }
  570         -
}