Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +52,53 @@
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
   15     15   
#![allow(rustdoc::bare_urls)]
   16     16   
#![allow(rustdoc::redundant_explicit_links)]
   17     17   
#![allow(rustdoc::invalid_html_tags)]
   18     18   
#![forbid(unsafe_code)]
   19     19   
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
   20     20   
//! Confounds model generation machinery with lots of problematic names
   21     21   
   22     22   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          23  +
/* ServerRootGenerator.kt:65 */
   23     24   
//! A fast and customizable Rust implementation of the Config Smithy service.
   24     25   
//!
   25     26   
//! # Using Config
   26     27   
//!
   27     28   
//! The primary entrypoint is [`Config`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
   28     29   
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`Config::into_make_service`]
   29     30   
//! or used in AWS Lambda
   30     31   
#![cfg_attr(
   31     32   
    feature = "aws-lambda",
   32     33   
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
@@ -197,198 +288,301 @@
  217    218   
//! }
  218    219   
//!
  219    220   
//! ```
  220    221   
//!
  221    222   
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
  222    223   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  223    224   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  224    225   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  225    226   
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  226    227   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         228  +
/* ServerRootGenerator.kt:261 */
  227    229   
pub use crate::service::{
  228    230   
    Config, ConfigBuilder, ConfigConfig, ConfigConfigBuilder, MissingOperationsError,
  229    231   
};
  230    232   
  231         -
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         233  +
/// /* ServerRustModule.kt:55 */Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  232    234   
pub mod server {
  233    235   
    // Re-export all types from the `aws-smithy-http-server` crate.
  234    236   
    pub use ::aws_smithy_http_server::*;
         237  +
         238  +
    /* CodegenDelegator.kt:200 */
  235    239   
}
  236    240   
         241  +
/* CrateVersionCustomization.kt:23 */
  237    242   
/// Crate version number.
  238    243   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
  239    244   
  240         -
/// All error types that operations can return. Documentation on these types is copied from the model.
         245  +
/// /* ServerRustModule.kt:55 */All error types that operations can return. Documentation on these types is copied from the model.
  241    246   
pub mod error;
  242    247   
  243         -
/// Input structures for operations. Documentation on these types is copied from the model.
         248  +
/// /* ServerRustModule.kt:55 */Input structures for operations. Documentation on these types is copied from the model.
  244    249   
pub mod input;
  245    250   
  246         -
/// Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
         251  +
/// /* ServerRustModule.kt:55 */Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
  247    252   
pub mod model;
  248    253   
  249         -
/// All operations that this crate can perform.
         254  +
/// /* ServerRustModule.kt:55 */All operations that this crate can perform.
  250    255   
pub mod operation;
  251    256   
         257  +
/* ServerRustModule.kt:79 */
  252    258   
/// A collection of types representing each operation defined in the service closure.
  253    259   
///
  254    260   
/// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
  255    261   
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
  256    262   
/// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
  257    263   
/// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
  258    264   
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
  259    265   
pub mod operation_shape;
  260    266   
  261         -
/// Output structures for operations. Documentation on these types is copied from the model.
         267  +
/// /* ServerRustModule.kt:55 */Output structures for operations. Documentation on these types is copied from the model.
  262    268   
pub mod output;
  263    269   
  264         -
/// Export PyO3 symbols in the shared library
         270  +
/// /* PythonServerRustModule.kt:23 */Export PyO3 symbols in the shared library
  265    271   
pub mod python_module_export;
  266    272   
  267         -
/// Operation adapters that delegate to Python handlers.
         273  +
/// /* PythonServerRustModule.kt:23 */Operation adapters that delegate to Python handlers.
  268    274   
pub mod python_operation_adaptor;
  269    275   
  270         -
/// Python server and application implementation.
         276  +
/// /* PythonServerRustModule.kt:23 */Python server and application implementation.
  271    277   
pub mod python_server_application;
  272    278   
         279  +
/* RustModule.kt:172 */
  273    280   
mod service;
  274    281   
  275         -
/// Data primitives referenced by other data types.
         282  +
/// /* ServerRustModule.kt:55 */Data primitives referenced by other data types.
  276    283   
pub mod types;
  277    284   
  278         -
/// Constrained types for constrained shapes.
         285  +
/// /* ServerRustModule.kt:55 */Constrained types for constrained shapes.
         286  +
/* RustModule.kt:172 */
  279    287   
mod constrained;
  280    288   
  281    289   
pub(crate) mod protocol_serde;
  282    290   
  283         -
/// Re-exported Python types from supporting crates.
         291  +
/// /* PythonServerCodegenDecorator.kt:57 */Re-exported Python types from supporting crates.
         292  +
/* PythonServerCodegenDecorator.kt:58 */
  284    293   
pub mod python_types {
         294  +
    /* PythonServerCodegenDecorator.kt:59 */
  285    295   
    pub use ::aws_smithy_http_server_python::types::Blob;
         296  +
    /* PythonServerCodegenDecorator.kt:60 */
  286    297   
    pub use ::aws_smithy_http_server_python::types::DateTime;
         298  +
    /* PythonServerCodegenDecorator.kt:61 */
  287    299   
    pub use ::aws_smithy_http_server_python::types::Document;
         300  +
    /* PythonServerCodegenDecorator.kt:58 */
  288    301   
}

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

@@ -1,1 +390,554 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[::pyo3::pyclass]
           4  +
/* PythonServerStructureGenerator.kt:63 */
    3      5   
/// :param path str:
    4      6   
/// :param message str:
    5      7   
/// :rtype None:
    6         -
/// Describes one specific validation failure for an input member.
           8  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           9  +
/* RustType.kt:516 */
    7     10   
#[derive(
    8     11   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    9     12   
)]
   10         -
pub struct ValidationExceptionField {
          13  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
          14  +
    /* RustType.kt:516 */
   11     15   
    #[pyo3(get, set)]
          16  +
    /* PythonServerStructureGenerator.kt:80 */
   12     17   
    /// :type str:
   13         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   14     19   
    pub path: ::std::string::String,
          20  +
    /* RustType.kt:516 */
   15     21   
    #[pyo3(get, set)]
          22  +
    /* PythonServerStructureGenerator.kt:80 */
   16     23   
    /// :type str:
   17         -
    /// A detailed description of the validation failure.
          24  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
   18     25   
    pub message: ::std::string::String,
          26  +
    /* StructureGenerator.kt:201 */
   19     27   
}
          28  +
/* StructureGenerator.kt:135 */
   20     29   
impl ValidationExceptionField {
   21         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          30  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          31  +
    /* StructureGenerator.kt:166 */
   22     32   
    pub fn path(&self) -> &str {
          33  +
        /* StructureGenerator.kt:171 */
   23     34   
        use std::ops::Deref;
   24     35   
        self.path.deref()
          36  +
        /* StructureGenerator.kt:166 */
   25     37   
    }
   26         -
    /// A detailed description of the validation failure.
          38  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          39  +
    /* StructureGenerator.kt:166 */
   27     40   
    pub fn message(&self) -> &str {
          41  +
        /* StructureGenerator.kt:171 */
   28     42   
        use std::ops::Deref;
   29     43   
        self.message.deref()
          44  +
        /* StructureGenerator.kt:166 */
   30     45   
    }
          46  +
    /* StructureGenerator.kt:135 */
   31     47   
}
          48  +
/* RustType.kt:516 */
   32     49   
#[allow(clippy::new_without_default)]
          50  +
/* RustType.kt:516 */
   33     51   
#[allow(clippy::too_many_arguments)]
          52  +
/* RustType.kt:516 */
   34     53   
#[::pyo3::pymethods]
          54  +
/* PythonServerStructureGenerator.kt:88 */
   35     55   
impl ValidationExceptionField {
   36     56   
    #[new]
   37     57   
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
   38     58   
        Self { path, message }
   39     59   
    }
   40     60   
    fn __repr__(&self) -> String {
   41     61   
        format!("{self:?}")
   42     62   
    }
   43     63   
    fn __str__(&self) -> String {
   44     64   
        format!("{self:?}")
   45     65   
    }
   46     66   
}
          67  +
/* PythonServerStructureGenerator.kt:111 */
   47     68   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
   48     69   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   49     70   
        ob.extract::<ValidationExceptionField>().map(Box::new)
   50     71   
    }
   51     72   
}
   52     73   
   53     74   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
   54     75   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   55     76   
        (*self).into_py(py)
   56     77   
    }
   57     78   
}
          79  +
/* ServerCodegenVisitor.kt:370 */
   58     80   
impl ValidationExceptionField {
   59         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          81  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          82  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   60     83   
    pub fn builder() -> crate::model::validation_exception_field::Builder {
          84  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
   61     85   
        crate::model::validation_exception_field::Builder::default()
          86  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   62     87   
    }
          88  +
    /* ServerCodegenVisitor.kt:370 */
   63     89   
}
   64     90   
          91  +
/* RustType.kt:516 */
   65     92   
#[::pyo3::pyclass]
          93  +
/* EnumGenerator.kt:159 */
   66     94   
///
   67         -
/// _Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
          95  +
/// /* EnumGenerator.kt:160 */_Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
   68     96   
/// `UnknownVariantCollidingEnum::SelfValue` has been renamed to `::SelfValue_`._
          97  +
/* RustType.kt:516 */
   69     98   
#[derive(
   70     99   
    ::std::clone::Clone,
   71    100   
    ::std::cmp::Eq,
   72    101   
    ::std::cmp::Ord,
   73    102   
    ::std::cmp::PartialEq,
   74    103   
    ::std::cmp::PartialOrd,
   75    104   
    ::std::fmt::Debug,
   76    105   
    ::std::hash::Hash,
   77    106   
)]
   78         -
pub enum UnknownVariantCollidingEnum {
         107  +
pub /* EnumGenerator.kt:267 */ enum UnknownVariantCollidingEnum {
         108  +
    /* EnumGenerator.kt:154 */
   79    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
    /* EnumGenerator.kt:143 */
   80    111   
    Known,
         112  +
    /* EnumGenerator.kt:159 */
   81    113   
    ///
   82         -
    /// _Note: `::Self` has been renamed to `::SelfValue`._
         114  +
    /// /* EnumGenerator.kt:160 */_Note: `::Self` has been renamed to `::SelfValue`._
         115  +
    /* EnumGenerator.kt:143 */
   83    116   
    SelfValue,
         117  +
    /* EnumGenerator.kt:159 */
   84    118   
    ///
   85         -
    /// _Note: `::SelfValue` has been renamed to `::SelfValue_`._
         119  +
    /// /* EnumGenerator.kt:160 */_Note: `::SelfValue` has been renamed to `::SelfValue_`._
         120  +
    /* EnumGenerator.kt:143 */
   86    121   
    SelfValue_,
         122  +
    /* EnumGenerator.kt:154 */
   87    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
    /* EnumGenerator.kt:143 */
   88    125   
    Unknown,
         126  +
    /* EnumGenerator.kt:154 */
   89    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
    /* EnumGenerator.kt:143 */
   90    129   
    UnknownValue,
         130  +
    /* EnumGenerator.kt:267 */
   91    131   
}
   92    132   
pub(crate) mod unknown_variant_colliding_enum_internal {
   93    133   
    #[derive(Debug, PartialEq)]
   94    134   
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
   95    135   
   96    136   
    impl ::std::fmt::Display for ConstraintViolation {
   97    137   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   98    138   
            write!(
   99    139   
                f,
  100    140   
                r#"Value provided for 'crate#UnknownVariantCollidingEnum' failed to satisfy constraint: Member must satisfy enum value set: [Known, Unknown, Self, UnknownValue, SelfValue]"#
  101    141   
            )
  102    142   
        }
  103    143   
    }
  104    144   
  105    145   
    impl ::std::error::Error for ConstraintViolation {}
  106    146   
    impl ConstraintViolation {
  107    147   
        pub(crate) fn as_validation_exception_field(
  108    148   
            self,
  109    149   
            path: ::std::string::String,
  110    150   
        ) -> crate::model::ValidationExceptionField {
  111    151   
            crate::model::ValidationExceptionField {
  112    152   
                message: format!(
  113    153   
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Known, Unknown, Self, UnknownValue, SelfValue]"#,
  114    154   
                    &path
  115    155   
                ),
  116    156   
                path,
  117    157   
            }
  118    158   
        }
  119    159   
    }
         160  +
         161  +
    /* ServerEnumGenerator.kt:46 */
  120    162   
}
         163  +
/* ServerEnumGenerator.kt:85 */
  121    164   
impl ::std::convert::TryFrom<&str> for UnknownVariantCollidingEnum {
  122    165   
    type Error = crate::model::unknown_variant_colliding_enum_internal::ConstraintViolation;
  123    166   
    fn try_from(
  124    167   
        s: &str,
  125    168   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
  126    169   
        match s {
  127    170   
            "Known" => Ok(UnknownVariantCollidingEnum::Known),
  128    171   
            "Self" => Ok(UnknownVariantCollidingEnum::SelfValue),
  129    172   
            "SelfValue" => Ok(UnknownVariantCollidingEnum::SelfValue_),
  130    173   
            "Unknown" => Ok(UnknownVariantCollidingEnum::Unknown),
  131    174   
            "UnknownValue" => Ok(UnknownVariantCollidingEnum::UnknownValue),
  132    175   
            _ => Err(
  133    176   
                crate::model::unknown_variant_colliding_enum_internal::ConstraintViolation(
  134    177   
                    s.to_owned(),
  135    178   
                ),
  136    179   
            ),
  137    180   
        }
  138    181   
    }
  139    182   
}
  140    183   
impl ::std::convert::TryFrom<::std::string::String> for UnknownVariantCollidingEnum {
  141    184   
    type Error = crate::model::unknown_variant_colliding_enum_internal::ConstraintViolation;
  142    185   
    fn try_from(
  143    186   
        s: ::std::string::String,
  144    187   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
  145    188   
    {
  146    189   
        s.as_str().try_into()
  147    190   
    }
  148    191   
}
         192  +
/* ServerEnumGenerator.kt:145 */
  149    193   
impl std::str::FromStr for UnknownVariantCollidingEnum {
  150    194   
    type Err = crate::model::unknown_variant_colliding_enum_internal::ConstraintViolation;
  151    195   
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
  152    196   
        Self::try_from(s)
  153    197   
    }
  154    198   
}
         199  +
/* EnumGenerator.kt:274 */
  155    200   
impl UnknownVariantCollidingEnum {
  156    201   
    /// Returns the `&str` value of the enum member.
  157    202   
    pub fn as_str(&self) -> &str {
  158    203   
        match self {
  159    204   
            UnknownVariantCollidingEnum::Known => "Known",
  160    205   
            UnknownVariantCollidingEnum::SelfValue => "Self",
  161    206   
            UnknownVariantCollidingEnum::SelfValue_ => "SelfValue",
  162    207   
            UnknownVariantCollidingEnum::Unknown => "Unknown",
  163    208   
            UnknownVariantCollidingEnum::UnknownValue => "UnknownValue",
  164    209   
        }
  165    210   
    }
  166    211   
    /// Returns all the `&str` representations of the enum members.
  167    212   
    pub const fn values() -> &'static [&'static str] {
  168    213   
        &["Known", "Self", "SelfValue", "Unknown", "UnknownValue"]
  169    214   
    }
  170    215   
}
         216  +
/* EnumGenerator.kt:223 */
  171    217   
impl ::std::convert::AsRef<str> for UnknownVariantCollidingEnum {
  172    218   
    fn as_ref(&self) -> &str {
  173    219   
        self.as_str()
  174    220   
    }
  175    221   
}
         222  +
/* RustType.kt:516 */
  176    223   
#[::pyo3::pymethods]
         224  +
/* PythonServerEnumGenerator.kt:41 */
  177    225   
impl UnknownVariantCollidingEnum {
  178    226   
    #[getter]
  179    227   
    pub fn name(&self) -> &str {
  180    228   
        match self {
  181    229   
            UnknownVariantCollidingEnum::Known => "Known",
  182    230   
            UnknownVariantCollidingEnum::SelfValue => "SelfValue",
  183    231   
            UnknownVariantCollidingEnum::SelfValue_ => "SelfValue_",
  184    232   
            UnknownVariantCollidingEnum::Unknown => "Unknown",
  185    233   
            UnknownVariantCollidingEnum::UnknownValue => "UnknownValue",
  186    234   
        }
  187    235   
    }
  188    236   
    #[getter]
  189    237   
    pub fn value(&self) -> &str {
  190    238   
        self.as_str()
  191    239   
    }
  192    240   
    fn __repr__(&self) -> String {
  193    241   
        self.as_str().to_owned()
  194    242   
    }
  195    243   
    fn __str__(&self) -> String {
  196    244   
        self.as_str().to_owned()
  197    245   
    }
  198    246   
}
         247  +
/* ConstrainedTraitForEnumGenerator.kt:36 */
  199    248   
impl crate::constrained::Constrained for UnknownVariantCollidingEnum {
  200    249   
    type Unconstrained = ::std::string::String;
  201    250   
}
  202    251   
  203    252   
impl ::std::convert::From<::std::string::String>
  204    253   
    for crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>
  205    254   
{
  206    255   
    fn from(value: ::std::string::String) -> Self {
  207    256   
        Self::Unconstrained(value)
  208    257   
    }
  209    258   
}
  210    259   
         260  +
/* RustType.kt:516 */
  211    261   
#[::pyo3::pyclass]
         262  +
/* PythonServerStructureGenerator.kt:63 */
  212    263   
/// :param pv_member typing.Optional\[bool\]:
  213    264   
/// :rtype None:
         265  +
/* StructureGenerator.kt:197 */
  214    266   
#[allow(missing_docs)] // documentation missing in model
         267  +
/* RustType.kt:516 */
  215    268   
#[derive(
  216    269   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  217    270   
)]
  218         -
pub struct Vec {
         271  +
pub /* StructureGenerator.kt:201 */ struct Vec {
         272  +
    /* RustType.kt:516 */
  219    273   
    #[pyo3(get, set)]
         274  +
    /* PythonServerStructureGenerator.kt:80 */
  220    275   
    /// :type typing.Optional\[bool\]:
         276  +
    /* StructureGenerator.kt:231 */
  221    277   
    #[allow(missing_docs)] // documentation missing in model
  222    278   
    pub pv_member: ::std::option::Option<bool>,
         279  +
    /* StructureGenerator.kt:201 */
  223    280   
}
         281  +
/* StructureGenerator.kt:135 */
  224    282   
impl Vec {
         283  +
    /* StructureGenerator.kt:231 */
  225    284   
    #[allow(missing_docs)] // documentation missing in model
         285  +
                           /* StructureGenerator.kt:166 */
  226    286   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
         287  +
        /* StructureGenerator.kt:168 */
  227    288   
        self.pv_member
         289  +
        /* StructureGenerator.kt:166 */
  228    290   
    }
         291  +
    /* StructureGenerator.kt:135 */
  229    292   
}
         293  +
/* RustType.kt:516 */
  230    294   
#[allow(clippy::new_without_default)]
         295  +
/* RustType.kt:516 */
  231    296   
#[allow(clippy::too_many_arguments)]
         297  +
/* RustType.kt:516 */
  232    298   
#[::pyo3::pymethods]
         299  +
/* PythonServerStructureGenerator.kt:88 */
  233    300   
impl Vec {
  234    301   
    #[new]
  235    302   
    pub fn new(pv_member: ::std::option::Option<bool>) -> Self {
  236    303   
        Self { pv_member }
  237    304   
    }
  238    305   
    fn __repr__(&self) -> String {
  239    306   
        format!("{self:?}")
  240    307   
    }
  241    308   
    fn __str__(&self) -> String {
  242    309   
        format!("{self:?}")
  243    310   
    }
  244    311   
}
         312  +
/* PythonServerStructureGenerator.kt:111 */
  245    313   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Vec> {
  246    314   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  247    315   
        ob.extract::<Vec>().map(Box::new)
  248    316   
    }
  249    317   
}
  250    318   
  251    319   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Vec> {
  252    320   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  253    321   
        (*self).into_py(py)
  254    322   
    }
  255    323   
}
         324  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  256    325   
impl crate::constrained::Constrained for crate::model::Vec {
  257    326   
    type Unconstrained = crate::model::vec_internal::Builder;
  258    327   
}
         328  +
/* ServerCodegenVisitor.kt:370 */
  259    329   
impl Vec {
  260         -
    /// Creates a new builder-style object to manufacture [`Vec`](crate::model::Vec).
         330  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`Vec`](crate::model::Vec).
         331  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  261    332   
    pub fn builder() -> crate::model::vec::Builder {
         333  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  262    334   
        crate::model::vec::Builder::default()
         335  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  263    336   
    }
         337  +
    /* ServerCodegenVisitor.kt:370 */
  264    338   
}
  265         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         339  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  266    340   
pub mod validation_exception_field {
  267    341   
         342  +
    /* RustType.kt:516 */
  268    343   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  269         -
    /// Holds one variant for each of the ways the builder can fail.
  270         -
         344  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         345  +
    /* ServerBuilderConstraintViolations.kt:75 */
  271    346   
    #[allow(clippy::enum_variant_names)]
  272    347   
    pub enum ConstraintViolation {
  273         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         348  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`path` was not provided but it is required when building `ValidationExceptionField`.
         349  +
        /* ServerBuilderConstraintViolations.kt:143 */
  274    350   
        MissingPath,
  275         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         351  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationExceptionField`.
         352  +
        /* ServerBuilderConstraintViolations.kt:143 */
  276    353   
        MissingMessage,
         354  +
        /* ServerBuilderConstraintViolations.kt:75 */
  277    355   
    }
         356  +
    /* ServerBuilderConstraintViolations.kt:117 */
  278    357   
    impl ::std::fmt::Display for ConstraintViolation {
         358  +
        /* ServerBuilderConstraintViolations.kt:118 */
  279    359   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         360  +
            /* ServerBuilderConstraintViolations.kt:119 */
  280    361   
            match self {
  281         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  282         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  283         -
            }
         362  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         363  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         364  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         365  +
            /* ServerBuilderConstraintViolations.kt:118 */
  284    366   
        }
         367  +
        /* ServerBuilderConstraintViolations.kt:117 */
  285    368   
    }
         369  +
    /* ServerBuilderConstraintViolations.kt:84 */
  286    370   
    impl ::std::error::Error for ConstraintViolation {}
         371  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:254 */
  287    372   
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  288    373   
        type Error = ConstraintViolation;
  289    374   
  290    375   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  291    376   
            builder.build()
  292    377   
        }
  293    378   
    }
  294         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         379  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         380  +
    /* RustType.kt:516 */
  295    381   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         382  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  296    383   
    pub struct Builder {
         384  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  297    385   
        pub(crate) path: ::std::option::Option<::std::string::String>,
         386  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  298    387   
        pub(crate) message: ::std::option::Option<::std::string::String>,
         388  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  299    389   
    }
         390  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  300    391   
    impl Builder {
  301         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         392  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         393  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  302    394   
        pub fn path(mut self, input: ::std::string::String) -> Self {
  303         -
            self.path = Some(input);
         395  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         396  +
            self.path =
         397  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */Some(
         398  +
                    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         399  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */)
         400  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  304    401   
            self
         402  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  305    403   
        }
  306         -
        /// A detailed description of the validation failure.
         404  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */A detailed description of the validation failure.
         405  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  307    406   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  308         -
            self.message = Some(input);
         407  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         408  +
            self.message =
         409  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */Some(
         410  +
                    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         411  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */)
         412  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  309    413   
            self
         414  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  310    415   
        }
  311         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  312         -
        ///
         416  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         417  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:152 */
  313    418   
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
  314    419   
        ///
         420  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  315    421   
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  316    422   
            self.build_enforcing_required_and_enum_traits()
  317    423   
        }
         424  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  318    425   
        fn build_enforcing_required_and_enum_traits(
  319    426   
            self,
  320    427   
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  321         -
            Ok(crate::model::ValidationExceptionField {
  322         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  323         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  324         -
            })
         428  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
         429  +
            Ok(
         430  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         431  +
                crate::model::ValidationExceptionField {
         432  +
                    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
         433  +
                    path: self
         434  +
                        .path
         435  +
                        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:202 */
         436  +
                        .ok_or(ConstraintViolation::MissingPath)?,
         437  +
                    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
         438  +
                    message: self
         439  +
                        .message
         440  +
                        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:202 */
         441  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
         442  +
                    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         443  +
                }, /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
         444  +
            )
         445  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  325    446   
        }
         447  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  326    448   
    }
         449  +
         450  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  327    451   
}
  328         -
/// See [`Vec`](crate::model::Vec).
         452  +
/// /* ServerBuilderGenerator.kt:171 */See [`Vec`](crate::model::Vec).
  329    453   
pub(crate) mod vec_internal {
  330    454   
         455  +
    /* ServerBuilderGenerator.kt:461 */
  331    456   
    impl ::std::convert::From<Builder> for crate::model::Vec {
  332    457   
        fn from(builder: Builder) -> Self {
  333    458   
            builder.build()
  334    459   
        }
  335    460   
    }
  336         -
    /// A builder for [`Vec`](crate::model::Vec).
         461  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`Vec`](crate::model::Vec).
         462  +
    /* RustType.kt:516 */
  337    463   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         464  +
    /* ServerBuilderGenerator.kt:211 */
  338    465   
    pub(crate) struct Builder {
         466  +
        /* ServerBuilderGenerator.kt:308 */
  339    467   
        pub(crate) pv_member: ::std::option::Option<bool>,
         468  +
        /* ServerBuilderGenerator.kt:211 */
  340    469   
    }
         470  +
    /* ServerBuilderGenerator.kt:215 */
  341    471   
    impl Builder {
         472  +
        /* ServerBuilderGenerator.kt:426 */
  342    473   
        #[allow(missing_docs)] // documentation missing in model
         474  +
                               /* ServerBuilderGenerator.kt:428 */
  343    475   
        pub(crate) fn set_pv_member(
  344    476   
            mut self,
  345    477   
            input: Option<impl ::std::convert::Into<bool>>,
  346    478   
        ) -> Self {
         479  +
            /* ServerBuilderGenerator.kt:429 */
  347    480   
            self.pv_member = input.map(|v| v.into());
  348    481   
            self
         482  +
            /* ServerBuilderGenerator.kt:428 */
  349    483   
        }
  350         -
        /// Consumes the builder and constructs a [`Vec`](crate::model::Vec).
         484  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Vec`](crate::model::Vec).
         485  +
        /* ServerBuilderGenerator.kt:271 */
  351    486   
        pub fn build(self) -> crate::model::Vec {
  352    487   
            self.build_enforcing_all_constraints()
  353    488   
        }
         489  +
        /* ServerBuilderGenerator.kt:283 */
  354    490   
        fn build_enforcing_all_constraints(self) -> crate::model::Vec {
         491  +
            /* ServerBuilderGenerator.kt:542 */
  355    492   
            crate::model::Vec {
         493  +
                /* ServerBuilderGenerator.kt:546 */
  356    494   
                pv_member: self.pv_member,
         495  +
                /* ServerBuilderGenerator.kt:542 */
  357    496   
            }
         497  +
            /* ServerBuilderGenerator.kt:283 */
  358    498   
        }
         499  +
        /* ServerBuilderGenerator.kt:215 */
  359    500   
    }
         501  +
         502  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  360    503   
}
  361         -
/// See [`Vec`](crate::model::Vec).
         504  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`Vec`](crate::model::Vec).
  362    505   
pub mod vec {
  363    506   
         507  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  364    508   
    impl ::std::convert::From<Builder> for crate::model::Vec {
  365    509   
        fn from(builder: Builder) -> Self {
  366    510   
            builder.build()
  367    511   
        }
  368    512   
    }
  369         -
    /// A builder for [`Vec`](crate::model::Vec).
         513  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`Vec`](crate::model::Vec).
         514  +
    /* RustType.kt:516 */
  370    515   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         516  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  371    517   
    pub struct Builder {
         518  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  372    519   
        pub(crate) pv_member: ::std::option::Option<bool>,
         520  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  373    521   
    }
         522  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  374    523   
    impl Builder {
         524  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  375    525   
        #[allow(missing_docs)] // documentation missing in model
         526  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  376    527   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  377         -
            self.pv_member = input;
         528  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         529  +
            self.pv_member =
         530  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         531  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  378    532   
            self
         533  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  379    534   
        }
  380         -
        /// Consumes the builder and constructs a [`Vec`](crate::model::Vec).
         535  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`Vec`](crate::model::Vec).
         536  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  381    537   
        pub fn build(self) -> crate::model::Vec {
  382    538   
            self.build_enforcing_required_and_enum_traits()
  383    539   
        }
         540  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  384    541   
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Vec {
         542  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  385    543   
            crate::model::Vec {
         544  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  386    545   
                pv_member: self.pv_member,
         546  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  387    547   
            }
         548  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  388    549   
        }
         550  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  389    551   
    }
         552  +
         553  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  390    554   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
    2      3   
static CONTENT_TYPE_RPCECHO: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
    3      4   
    "application/x-amz-json-1.1"
    4      5   
        .parse::<::mime::Mime>()
    5      6   
        .expect("BUG: MIME parsing failed, content_type is not valid")
    6      7   
});
    7      8   
::pin_project_lite::pin_project! {
    8      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    9     10   
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
   10     11   
    pub struct RpcEchoInputFuture {
   11     12   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RpcEchoInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -40,41 +147,151 @@
   60     61   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
   61     62   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   62     63   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   63     64   
            },
   64     65   
        );
   65     66   
        RpcEchoInputFuture {
   66     67   
            inner: Box::pin(fut),
   67     68   
        }
   68     69   
    }
   69     70   
}
          71  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
   70     72   
impl
   71     73   
    ::aws_smithy_http_server::response::IntoResponse<
   72     74   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
   73     75   
    > for crate::output::RpcEchoOutput
   74     76   
{
   75     77   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   76     78   
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_response(self) {
   77     79   
            Ok(response) => response,
   78     80   
            Err(e) => {
   79     81   
                ::tracing::error!(error = %e, "failed to serialize response");
   80     82   
                ::aws_smithy_http_server::response::IntoResponse::<
   81     83   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
   82     84   
                >::into_response(
   83     85   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
   84     86   
                        e,
   85     87   
                    ),
   86     88   
                )
   87     89   
            }
   88     90   
        }
   89     91   
    }
   90     92   
}
          93  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
   91     94   
impl
   92     95   
    ::aws_smithy_http_server::response::IntoResponse<
   93     96   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
   94     97   
    > for crate::error::RPCEchoError
   95     98   
{
   96     99   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   97    100   
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_error(&self) {
   98    101   
            Ok(mut response) => {
   99    102   
                response.extensions_mut().insert(
  100    103   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  101    104   
                );
  102    105   
                response
  103    106   
            }
  104    107   
            Err(e) => {
  105    108   
                ::tracing::error!(error = %e, "failed to serialize response");
  106    109   
                ::aws_smithy_http_server::response::IntoResponse::<
  107    110   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  108    111   
                >::into_response(
  109    112   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  110    113   
                        e,
  111    114   
                    ),
  112    115   
                )
  113    116   
            }
  114    117   
        }
  115    118   
    }
  116    119   
}
  117    120   
         121  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  118    122   
static CONTENT_TYPE_MATCH: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  119    123   
    "application/x-amz-json-1.1"
  120    124   
        .parse::<::mime::Mime>()
  121    125   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  122    126   
});
  123    127   
::pin_project_lite::pin_project! {
  124    128   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  125    129   
    /// [`MatchInput`](crate::input::MatchInput) using modelled bindings.
  126    130   
    pub struct MatchInputFuture {
  127    131   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MatchInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -156,160 +263,270 @@
  176    180   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  177    181   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  178    182   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  179    183   
            },
  180    184   
        );
  181    185   
        MatchInputFuture {
  182    186   
            inner: Box::pin(fut),
  183    187   
        }
  184    188   
    }
  185    189   
}
         190  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  186    191   
impl
  187    192   
    ::aws_smithy_http_server::response::IntoResponse<
  188    193   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  189    194   
    > for crate::output::MatchOutput
  190    195   
{
  191    196   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  192    197   
        match crate::protocol_serde::shape_match::ser_match_http_response(self) {
  193    198   
            Ok(response) => response,
  194    199   
            Err(e) => {
  195    200   
                ::tracing::error!(error = %e, "failed to serialize response");
  196    201   
                ::aws_smithy_http_server::response::IntoResponse::<
  197    202   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  198    203   
                >::into_response(
  199    204   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  200    205   
                        e,
  201    206   
                    ),
  202    207   
                )
  203    208   
            }
  204    209   
        }
  205    210   
    }
  206    211   
}
         212  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  207    213   
impl
  208    214   
    ::aws_smithy_http_server::response::IntoResponse<
  209    215   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  210    216   
    > for crate::error::MatchError
  211    217   
{
  212    218   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  213    219   
        match crate::protocol_serde::shape_match::ser_match_http_error(&self) {
  214    220   
            Ok(mut response) => {
  215    221   
                response.extensions_mut().insert(
  216    222   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  217    223   
                );
  218    224   
                response
  219    225   
            }
  220    226   
            Err(e) => {
  221    227   
                ::tracing::error!(error = %e, "failed to serialize response");
  222    228   
                ::aws_smithy_http_server::response::IntoResponse::<
  223    229   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  224    230   
                >::into_response(
  225    231   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  226    232   
                        e,
  227    233   
                    ),
  228    234   
                )
  229    235   
            }
  230    236   
        }
  231    237   
    }
  232    238   
}
  233    239   
         240  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  234    241   
static CONTENT_TYPE_OPTION: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  235    242   
    "application/x-amz-json-1.1"
  236    243   
        .parse::<::mime::Mime>()
  237    244   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  238    245   
});
  239    246   
::pin_project_lite::pin_project! {
  240    247   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  241    248   
    /// [`OptionInput`](crate::input::OptionInput) using modelled bindings.
  242    249   
    pub struct OptionInputFuture {
  243    250   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OptionInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -272,279 +379,389 @@
  292    299   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  293    300   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  294    301   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  295    302   
            },
  296    303   
        );
  297    304   
        OptionInputFuture {
  298    305   
            inner: Box::pin(fut),
  299    306   
        }
  300    307   
    }
  301    308   
}
         309  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  302    310   
impl
  303    311   
    ::aws_smithy_http_server::response::IntoResponse<
  304    312   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  305    313   
    > for crate::output::OptionOutput
  306    314   
{
  307    315   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  308    316   
        match crate::protocol_serde::shape_option::ser_option_http_response(self) {
  309    317   
            Ok(response) => response,
  310    318   
            Err(e) => {
  311    319   
                ::tracing::error!(error = %e, "failed to serialize response");
  312    320   
                ::aws_smithy_http_server::response::IntoResponse::<
  313    321   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  314    322   
                >::into_response(
  315    323   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  316    324   
                        e,
  317    325   
                    ),
  318    326   
                )
  319    327   
            }
  320    328   
        }
  321    329   
    }
  322    330   
}
         331  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  323    332   
impl
  324    333   
    ::aws_smithy_http_server::response::IntoResponse<
  325    334   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  326    335   
    > for crate::error::OptionError
  327    336   
{
  328    337   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  329    338   
        match crate::protocol_serde::shape_option::ser_option_http_error(&self) {
  330    339   
            Ok(mut response) => {
  331    340   
                response.extensions_mut().insert(
  332    341   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  333    342   
                );
  334    343   
                response
  335    344   
            }
  336    345   
            Err(e) => {
  337    346   
                ::tracing::error!(error = %e, "failed to serialize response");
  338    347   
                ::aws_smithy_http_server::response::IntoResponse::<
  339    348   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  340    349   
                >::into_response(
  341    350   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  342    351   
                        e,
  343    352   
                    ),
  344    353   
                )
  345    354   
            }
  346    355   
        }
  347    356   
    }
  348    357   
}
  349    358   
         359  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  350    360   
static CONTENT_TYPE_RESULT: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  351    361   
    "application/x-amz-json-1.1"
  352    362   
        .parse::<::mime::Mime>()
  353    363   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  354    364   
});
  355    365   
::pin_project_lite::pin_project! {
  356    366   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  357    367   
    /// [`ResultInput`](crate::input::ResultInput) using modelled bindings.
  358    368   
    pub struct ResultInputFuture {
  359    369   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResultInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -388,398 +495,508 @@
  408    418   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  409    419   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  410    420   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  411    421   
            },
  412    422   
        );
  413    423   
        ResultInputFuture {
  414    424   
            inner: Box::pin(fut),
  415    425   
        }
  416    426   
    }
  417    427   
}
         428  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  418    429   
impl
  419    430   
    ::aws_smithy_http_server::response::IntoResponse<
  420    431   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  421    432   
    > for crate::output::ResultOutput
  422    433   
{
  423    434   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  424    435   
        match crate::protocol_serde::shape_result::ser_result_http_response(self) {
  425    436   
            Ok(response) => response,
  426    437   
            Err(e) => {
  427    438   
                ::tracing::error!(error = %e, "failed to serialize response");
  428    439   
                ::aws_smithy_http_server::response::IntoResponse::<
  429    440   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  430    441   
                >::into_response(
  431    442   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  432    443   
                        e,
  433    444   
                    ),
  434    445   
                )
  435    446   
            }
  436    447   
        }
  437    448   
    }
  438    449   
}
         450  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  439    451   
impl
  440    452   
    ::aws_smithy_http_server::response::IntoResponse<
  441    453   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  442    454   
    > for crate::error::ResultError
  443    455   
{
  444    456   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  445    457   
        match crate::protocol_serde::shape_result::ser_result_http_error(&self) {
  446    458   
            Ok(mut response) => {
  447    459   
                response.extensions_mut().insert(
  448    460   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  449    461   
                );
  450    462   
                response
  451    463   
            }
  452    464   
            Err(e) => {
  453    465   
                ::tracing::error!(error = %e, "failed to serialize response");
  454    466   
                ::aws_smithy_http_server::response::IntoResponse::<
  455    467   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  456    468   
                >::into_response(
  457    469   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  458    470   
                        e,
  459    471   
                    ),
  460    472   
                )
  461    473   
            }
  462    474   
        }
  463    475   
    }
  464    476   
}
  465    477   
         478  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  466    479   
static CONTENT_TYPE_ERRCOLLISIONS: std::sync::LazyLock<::mime::Mime> =
  467    480   
    std::sync::LazyLock::new(|| {
  468    481   
        "application/x-amz-json-1.1"
  469    482   
            .parse::<::mime::Mime>()
  470    483   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  471    484   
    });
  472    485   
::pin_project_lite::pin_project! {
  473    486   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  474    487   
    /// [`ErrCollisionsInput`](crate::input::ErrCollisionsInput) using modelled bindings.
  475    488   
    pub struct ErrCollisionsInputFuture {
@@ -505,518 +612,628 @@
  525    538   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  526    539   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  527    540   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  528    541   
            },
  529    542   
        );
  530    543   
        ErrCollisionsInputFuture {
  531    544   
            inner: Box::pin(fut),
  532    545   
        }
  533    546   
    }
  534    547   
}
         548  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  535    549   
impl
  536    550   
    ::aws_smithy_http_server::response::IntoResponse<
  537    551   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  538    552   
    > for crate::output::ErrCollisionsOutput
  539    553   
{
  540    554   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  541    555   
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_response(self) {
  542    556   
            Ok(response) => response,
  543    557   
            Err(e) => {
  544    558   
                ::tracing::error!(error = %e, "failed to serialize response");
  545    559   
                ::aws_smithy_http_server::response::IntoResponse::<
  546    560   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  547    561   
                >::into_response(
  548    562   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  549    563   
                        e,
  550    564   
                    ),
  551    565   
                )
  552    566   
            }
  553    567   
        }
  554    568   
    }
  555    569   
}
         570  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  556    571   
impl
  557    572   
    ::aws_smithy_http_server::response::IntoResponse<
  558    573   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  559    574   
    > for crate::error::ErrCollisionsError
  560    575   
{
  561    576   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  562    577   
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_error(&self) {
  563    578   
            Ok(mut response) => {
  564    579   
                response.extensions_mut().insert(
  565    580   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  566    581   
                );
  567    582   
                response
  568    583   
            }
  569    584   
            Err(e) => {
  570    585   
                ::tracing::error!(error = %e, "failed to serialize response");
  571    586   
                ::aws_smithy_http_server::response::IntoResponse::<
  572    587   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  573    588   
                >::into_response(
  574    589   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  575    590   
                        e,
  576    591   
                    ),
  577    592   
                )
  578    593   
            }
  579    594   
        }
  580    595   
    }
  581    596   
}
  582    597   
         598  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  583    599   
static CONTENT_TYPE_STRUCTURENAMEPUNNING: std::sync::LazyLock<::mime::Mime> =
  584    600   
    std::sync::LazyLock::new(|| {
  585    601   
        "application/x-amz-json-1.1"
  586    602   
            .parse::<::mime::Mime>()
  587    603   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  588    604   
    });
  589    605   
::pin_project_lite::pin_project! {
  590    606   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  591    607   
    /// [`StructureNamePunningInput`](crate::input::StructureNamePunningInput) using modelled bindings.
  592    608   
    pub struct StructureNamePunningInputFuture {
@@ -622,638 +715,734 @@
  642    658   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  643    659   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  644    660   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  645    661   
            },
  646    662   
        );
  647    663   
        StructureNamePunningInputFuture {
  648    664   
            inner: Box::pin(fut),
  649    665   
        }
  650    666   
    }
  651    667   
}
         668  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  652    669   
impl
  653    670   
    ::aws_smithy_http_server::response::IntoResponse<
  654    671   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  655    672   
    > for crate::output::StructureNamePunningOutput
  656    673   
{
  657    674   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  658    675   
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
  659    676   
                        Ok(response) => response,
  660    677   
                        Err(e) => {
  661    678   
                            ::tracing::error!(error = %e, "failed to serialize response");
  662    679   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  663    680   
                        }
  664    681   
                    }
  665    682   
    }
  666    683   
}
         684  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  667    685   
impl
  668    686   
    ::aws_smithy_http_server::response::IntoResponse<
  669    687   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  670    688   
    > for crate::error::StructureNamePunningError
  671    689   
{
  672    690   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  673    691   
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_error(&self) {
  674    692   
            Ok(mut response) => {
  675    693   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
  676    694   
                response
  677    695   
            },
  678    696   
            Err(e) => {
  679    697   
                ::tracing::error!(error = %e, "failed to serialize response");
  680    698   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  681    699   
            }
  682    700   
        }
  683    701   
    }
  684    702   
}
  685    703   
         704  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  686    705   
static CONTENT_TYPE_RESERVEDWORDSASMEMBERS: std::sync::LazyLock<::mime::Mime> =
  687    706   
    std::sync::LazyLock::new(|| {
  688    707   
        "application/x-amz-json-1.1"
  689    708   
            .parse::<::mime::Mime>()
  690    709   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  691    710   
    });
  692    711   
::pin_project_lite::pin_project! {
  693    712   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  694    713   
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
  695    714   
    pub struct ReservedWordsAsMembersInputFuture {
@@ -725,744 +787,808 @@
  745    764   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  746    765   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  747    766   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  748    767   
            },
  749    768   
        );
  750    769   
        ReservedWordsAsMembersInputFuture {
  751    770   
            inner: Box::pin(fut),
  752    771   
        }
  753    772   
    }
  754    773   
}
         774  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  755    775   
impl
  756    776   
    ::aws_smithy_http_server::response::IntoResponse<
  757    777   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  758    778   
    > for crate::output::ReservedWordsAsMembersOutput
  759    779   
{
  760    780   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  761    781   
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_response(self) {
  762    782   
                        Ok(response) => response,
  763    783   
                        Err(e) => {
  764    784   
                            ::tracing::error!(error = %e, "failed to serialize response");
  765    785   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  766    786   
                        }
  767    787   
                    }
  768    788   
    }
  769    789   
}
         790  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  770    791   
impl
  771    792   
    ::aws_smithy_http_server::response::IntoResponse<
  772    793   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  773    794   
    > for crate::error::ReservedWordsAsMembersError
  774    795   
{
  775    796   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  776    797   
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_error(&self) {
  777    798   
            Ok(mut response) => {
  778    799   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
  779    800   
                response

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

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

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

@@ -1,1 +452,653 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[::pyo3::pyclass]
           4  +
/* PythonServerStructureGenerator.kt:63 */
    3      5   
/// :rtype None:
           6  +
/* StructureGenerator.kt:197 */
    4      7   
#[allow(missing_docs)] // documentation missing in model
           8  +
/* RustType.kt:516 */
    5      9   
#[derive(
    6     10   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    7     11   
)]
    8         -
pub struct RpcEchoOutput {}
          12  +
pub /* StructureGenerator.kt:201 */ struct RpcEchoOutput {/* StructureGenerator.kt:201 */}
          13  +
/* RustType.kt:516 */
    9     14   
#[allow(clippy::new_without_default)]
          15  +
/* RustType.kt:516 */
   10     16   
#[allow(clippy::too_many_arguments)]
          17  +
/* RustType.kt:516 */
   11     18   
#[::pyo3::pymethods]
          19  +
/* PythonServerStructureGenerator.kt:88 */
   12     20   
impl RpcEchoOutput {
   13     21   
    #[new]
   14     22   
    pub fn new() -> Self {
   15     23   
        Self {}
   16     24   
    }
   17     25   
    fn __repr__(&self) -> String {
   18     26   
        format!("{self:?}")
   19     27   
    }
   20     28   
    fn __str__(&self) -> String {
   21     29   
        format!("{self:?}")
   22     30   
    }
   23     31   
}
          32  +
/* PythonServerStructureGenerator.kt:111 */
   24     33   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RpcEchoOutput> {
   25     34   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   26     35   
        ob.extract::<RpcEchoOutput>().map(Box::new)
   27     36   
    }
   28     37   
}
   29     38   
   30     39   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RpcEchoOutput> {
   31     40   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   32     41   
        (*self).into_py(py)
   33     42   
    }
   34     43   
}
          44  +
/* ServerCodegenVisitor.kt:370 */
   35     45   
impl RpcEchoOutput {
   36         -
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
          46  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
          47  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   37     48   
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
          49  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
   38     50   
        crate::output::rpc_echo_output::Builder::default()
          51  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   39     52   
    }
          53  +
    /* ServerCodegenVisitor.kt:370 */
   40     54   
}
   41     55   
          56  +
/* RustType.kt:516 */
   42     57   
#[::pyo3::pyclass]
          58  +
/* PythonServerStructureGenerator.kt:63 */
   43     59   
/// :rtype None:
          60  +
/* StructureGenerator.kt:197 */
   44     61   
#[allow(missing_docs)] // documentation missing in model
          62  +
/* RustType.kt:516 */
   45     63   
#[derive(
   46     64   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   47     65   
)]
   48         -
pub struct MatchOutput {}
          66  +
pub /* StructureGenerator.kt:201 */ struct MatchOutput {/* StructureGenerator.kt:201 */}
          67  +
/* RustType.kt:516 */
   49     68   
#[allow(clippy::new_without_default)]
          69  +
/* RustType.kt:516 */
   50     70   
#[allow(clippy::too_many_arguments)]
          71  +
/* RustType.kt:516 */
   51     72   
#[::pyo3::pymethods]
          73  +
/* PythonServerStructureGenerator.kt:88 */
   52     74   
impl MatchOutput {
   53     75   
    #[new]
   54     76   
    pub fn new() -> Self {
   55     77   
        Self {}
   56     78   
    }
   57     79   
    fn __repr__(&self) -> String {
   58     80   
        format!("{self:?}")
   59     81   
    }
   60     82   
    fn __str__(&self) -> String {
   61     83   
        format!("{self:?}")
   62     84   
    }
   63     85   
}
          86  +
/* PythonServerStructureGenerator.kt:111 */
   64     87   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<MatchOutput> {
   65     88   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   66     89   
        ob.extract::<MatchOutput>().map(Box::new)
   67     90   
    }
   68     91   
}
   69     92   
   70     93   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<MatchOutput> {
   71     94   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   72     95   
        (*self).into_py(py)
   73     96   
    }
   74     97   
}
          98  +
/* ServerCodegenVisitor.kt:370 */
   75     99   
impl MatchOutput {
   76         -
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
         100  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
         101  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   77    102   
    pub fn builder() -> crate::output::match_output::Builder {
         103  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
   78    104   
        crate::output::match_output::Builder::default()
         105  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   79    106   
    }
         107  +
    /* ServerCodegenVisitor.kt:370 */
   80    108   
}
   81    109   
         110  +
/* RustType.kt:516 */
   82    111   
#[::pyo3::pyclass]
         112  +
/* PythonServerStructureGenerator.kt:63 */
   83    113   
/// :rtype None:
         114  +
/* StructureGenerator.kt:197 */
   84    115   
#[allow(missing_docs)] // documentation missing in model
         116  +
/* RustType.kt:516 */
   85    117   
#[derive(
   86    118   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   87    119   
)]
   88         -
pub struct OptionOutput {}
         120  +
pub /* StructureGenerator.kt:201 */ struct OptionOutput {/* StructureGenerator.kt:201 */}
         121  +
/* RustType.kt:516 */
   89    122   
#[allow(clippy::new_without_default)]
         123  +
/* RustType.kt:516 */
   90    124   
#[allow(clippy::too_many_arguments)]
         125  +
/* RustType.kt:516 */
   91    126   
#[::pyo3::pymethods]
         127  +
/* PythonServerStructureGenerator.kt:88 */
   92    128   
impl OptionOutput {
   93    129   
    #[new]
   94    130   
    pub fn new() -> Self {
   95    131   
        Self {}
   96    132   
    }
   97    133   
    fn __repr__(&self) -> String {
   98    134   
        format!("{self:?}")
   99    135   
    }
  100    136   
    fn __str__(&self) -> String {
  101    137   
        format!("{self:?}")
  102    138   
    }
  103    139   
}
         140  +
/* PythonServerStructureGenerator.kt:111 */
  104    141   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<OptionOutput> {
  105    142   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  106    143   
        ob.extract::<OptionOutput>().map(Box::new)
  107    144   
    }
  108    145   
}
  109    146   
  110    147   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<OptionOutput> {
  111    148   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  112    149   
        (*self).into_py(py)
  113    150   
    }
  114    151   
}
         152  +
/* ServerCodegenVisitor.kt:370 */
  115    153   
impl OptionOutput {
  116         -
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
         154  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
         155  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  117    156   
    pub fn builder() -> crate::output::option_output::Builder {
         157  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  118    158   
        crate::output::option_output::Builder::default()
         159  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  119    160   
    }
         161  +
    /* ServerCodegenVisitor.kt:370 */
  120    162   
}
  121    163   
         164  +
/* RustType.kt:516 */
  122    165   
#[::pyo3::pyclass]
         166  +
/* PythonServerStructureGenerator.kt:63 */
  123    167   
/// :param pv_member typing.Optional\[bool\]:
  124    168   
/// :rtype None:
         169  +
/* StructureGenerator.kt:197 */
  125    170   
#[allow(missing_docs)] // documentation missing in model
         171  +
/* RustType.kt:516 */
  126    172   
#[derive(
  127    173   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  128    174   
)]
  129         -
pub struct ResultOutput {
         175  +
pub /* StructureGenerator.kt:201 */ struct ResultOutput {
         176  +
    /* RustType.kt:516 */
  130    177   
    #[pyo3(get, set)]
         178  +
    /* PythonServerStructureGenerator.kt:80 */
  131    179   
    /// :type typing.Optional\[bool\]:
         180  +
    /* StructureGenerator.kt:231 */
  132    181   
    #[allow(missing_docs)] // documentation missing in model
  133    182   
    pub pv_member: ::std::option::Option<bool>,
         183  +
    /* StructureGenerator.kt:201 */
  134    184   
}
         185  +
/* StructureGenerator.kt:135 */
  135    186   
impl ResultOutput {
         187  +
    /* StructureGenerator.kt:231 */
  136    188   
    #[allow(missing_docs)] // documentation missing in model
         189  +
                           /* StructureGenerator.kt:166 */
  137    190   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
         191  +
        /* StructureGenerator.kt:168 */
  138    192   
        self.pv_member
         193  +
        /* StructureGenerator.kt:166 */
  139    194   
    }
         195  +
    /* StructureGenerator.kt:135 */
  140    196   
}
         197  +
/* RustType.kt:516 */
  141    198   
#[allow(clippy::new_without_default)]
         199  +
/* RustType.kt:516 */
  142    200   
#[allow(clippy::too_many_arguments)]
         201  +
/* RustType.kt:516 */
  143    202   
#[::pyo3::pymethods]
         203  +
/* PythonServerStructureGenerator.kt:88 */
  144    204   
impl ResultOutput {
  145    205   
    #[new]
  146    206   
    pub fn new(pv_member: ::std::option::Option<bool>) -> Self {
  147    207   
        Self { pv_member }
  148    208   
    }
  149    209   
    fn __repr__(&self) -> String {
  150    210   
        format!("{self:?}")
  151    211   
    }
  152    212   
    fn __str__(&self) -> String {
  153    213   
        format!("{self:?}")
  154    214   
    }
  155    215   
}
         216  +
/* PythonServerStructureGenerator.kt:111 */
  156    217   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ResultOutput> {
  157    218   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  158    219   
        ob.extract::<ResultOutput>().map(Box::new)
  159    220   
    }
  160    221   
}
  161    222   
  162    223   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ResultOutput> {
  163    224   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  164    225   
        (*self).into_py(py)
  165    226   
    }
  166    227   
}
         228  +
/* ServerCodegenVisitor.kt:370 */
  167    229   
impl ResultOutput {
  168         -
    /// Creates a new builder-style object to manufacture [`ResultOutput`](crate::output::ResultOutput).
         230  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`ResultOutput`](crate::output::ResultOutput).
         231  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  169    232   
    pub fn builder() -> crate::output::result_output::Builder {
         233  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  170    234   
        crate::output::result_output::Builder::default()
         235  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  171    236   
    }
         237  +
    /* ServerCodegenVisitor.kt:370 */
  172    238   
}
  173    239   
         240  +
/* RustType.kt:516 */
  174    241   
#[::pyo3::pyclass]
         242  +
/* PythonServerStructureGenerator.kt:63 */
  175    243   
/// :rtype None:
         244  +
/* StructureGenerator.kt:197 */
  176    245   
#[allow(missing_docs)] // documentation missing in model
         246  +
/* RustType.kt:516 */
  177    247   
#[derive(
  178    248   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  179    249   
)]
  180         -
pub struct ErrCollisionsOutput {}
         250  +
pub /* StructureGenerator.kt:201 */ struct ErrCollisionsOutput {/* StructureGenerator.kt:201 */}
         251  +
/* RustType.kt:516 */
  181    252   
#[allow(clippy::new_without_default)]
         253  +
/* RustType.kt:516 */
  182    254   
#[allow(clippy::too_many_arguments)]
         255  +
/* RustType.kt:516 */
  183    256   
#[::pyo3::pymethods]
         257  +
/* PythonServerStructureGenerator.kt:88 */
  184    258   
impl ErrCollisionsOutput {
  185    259   
    #[new]
  186    260   
    pub fn new() -> Self {
  187    261   
        Self {}
  188    262   
    }
  189    263   
    fn __repr__(&self) -> String {
  190    264   
        format!("{self:?}")
  191    265   
    }
  192    266   
    fn __str__(&self) -> String {
  193    267   
        format!("{self:?}")
  194    268   
    }
  195    269   
}
         270  +
/* PythonServerStructureGenerator.kt:111 */
  196    271   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ErrCollisionsOutput> {
  197    272   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  198    273   
        ob.extract::<ErrCollisionsOutput>().map(Box::new)
  199    274   
    }
  200    275   
}
  201    276   
  202    277   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ErrCollisionsOutput> {
  203    278   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  204    279   
        (*self).into_py(py)
  205    280   
    }
  206    281   
}
         282  +
/* ServerCodegenVisitor.kt:370 */
  207    283   
impl ErrCollisionsOutput {
  208         -
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         284  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         285  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  209    286   
    pub fn builder() -> crate::output::err_collisions_output::Builder {
         287  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  210    288   
        crate::output::err_collisions_output::Builder::default()
         289  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  211    290   
    }
         291  +
    /* ServerCodegenVisitor.kt:370 */
  212    292   
}
  213    293   
         294  +
/* RustType.kt:516 */
  214    295   
#[::pyo3::pyclass]
         296  +
/* PythonServerStructureGenerator.kt:63 */
  215    297   
/// :rtype None:
         298  +
/* StructureGenerator.kt:197 */
  216    299   
#[allow(missing_docs)] // documentation missing in model
         300  +
/* RustType.kt:516 */
  217    301   
#[derive(
  218    302   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  219    303   
)]
  220         -
pub struct StructureNamePunningOutput {}
         304  +
pub /* StructureGenerator.kt:201 */ struct StructureNamePunningOutput {/* StructureGenerator.kt:201 */}
         305  +
/* RustType.kt:516 */
  221    306   
#[allow(clippy::new_without_default)]
         307  +
/* RustType.kt:516 */
  222    308   
#[allow(clippy::too_many_arguments)]
         309  +
/* RustType.kt:516 */
  223    310   
#[::pyo3::pymethods]
         311  +
/* PythonServerStructureGenerator.kt:88 */
  224    312   
impl StructureNamePunningOutput {
  225    313   
    #[new]
  226    314   
    pub fn new() -> Self {
  227    315   
        Self {}
  228    316   
    }
  229    317   
    fn __repr__(&self) -> String {
  230    318   
        format!("{self:?}")
  231    319   
    }
  232    320   
    fn __str__(&self) -> String {
  233    321   
        format!("{self:?}")
  234    322   
    }
  235    323   
}
         324  +
/* PythonServerStructureGenerator.kt:111 */
  236    325   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructureNamePunningOutput> {
  237    326   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  238    327   
        ob.extract::<StructureNamePunningOutput>().map(Box::new)
  239    328   
    }
  240    329   
}
  241    330   
  242    331   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructureNamePunningOutput> {
  243    332   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  244    333   
        (*self).into_py(py)
  245    334   
    }
  246    335   
}
         336  +
/* ServerCodegenVisitor.kt:370 */
  247    337   
impl StructureNamePunningOutput {
  248         -
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         338  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         339  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  249    340   
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
         341  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  250    342   
        crate::output::structure_name_punning_output::Builder::default()
         343  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  251    344   
    }
         345  +
    /* ServerCodegenVisitor.kt:370 */
  252    346   
}
  253    347   
         348  +
/* RustType.kt:516 */
  254    349   
#[::pyo3::pyclass]
         350  +
/* PythonServerStructureGenerator.kt:63 */
  255    351   
/// :rtype None:
         352  +
/* StructureGenerator.kt:197 */
  256    353   
#[allow(missing_docs)] // documentation missing in model
         354  +
/* RustType.kt:516 */
  257    355   
#[derive(
  258    356   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  259    357   
)]
  260         -
pub struct ReservedWordsAsMembersOutput {}
         358  +
pub /* StructureGenerator.kt:201 */ struct ReservedWordsAsMembersOutput {/* StructureGenerator.kt:201 */}
         359  +
/* RustType.kt:516 */
  261    360   
#[allow(clippy::new_without_default)]
         361  +
/* RustType.kt:516 */
  262    362   
#[allow(clippy::too_many_arguments)]
         363  +
/* RustType.kt:516 */
  263    364   
#[::pyo3::pymethods]
         365  +
/* PythonServerStructureGenerator.kt:88 */
  264    366   
impl ReservedWordsAsMembersOutput {
  265    367   
    #[new]
  266    368   
    pub fn new() -> Self {
  267    369   
        Self {}
  268    370   
    }
  269    371   
    fn __repr__(&self) -> String {
  270    372   
        format!("{self:?}")
  271    373   
    }
  272    374   
    fn __str__(&self) -> String {
  273    375   
        format!("{self:?}")
  274    376   
    }
  275    377   
}
         378  +
/* PythonServerStructureGenerator.kt:111 */
  276    379   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ReservedWordsAsMembersOutput> {
  277    380   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  278    381   
        ob.extract::<ReservedWordsAsMembersOutput>().map(Box::new)
  279    382   
    }
  280    383   
}
  281    384   
  282    385   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ReservedWordsAsMembersOutput> {
  283    386   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  284    387   
        (*self).into_py(py)
  285    388   
    }
  286    389   
}
         390  +
/* ServerCodegenVisitor.kt:370 */
  287    391   
impl ReservedWordsAsMembersOutput {
  288         -
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         392  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         393  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  289    394   
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
         395  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  290    396   
        crate::output::reserved_words_as_members_output::Builder::default()
         397  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  291    398   
    }
         399  +
    /* ServerCodegenVisitor.kt:370 */
  292    400   
}
  293         -
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         401  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  294    402   
pub mod rpc_echo_output {
  295    403   
         404  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  296    405   
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
  297    406   
        fn from(builder: Builder) -> Self {
  298    407   
            builder.build()
  299    408   
        }
  300    409   
    }
  301         -
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         410  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         411  +
    /* RustType.kt:516 */
  302    412   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  303         -
    pub struct Builder {}
         413  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
         414  +
    pub struct Builder {/* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */}
         415  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  304    416   
    impl Builder {
  305         -
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         417  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         418  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  306    419   
        pub fn build(self) -> crate::output::RpcEchoOutput {
  307    420   
            self.build_enforcing_required_and_enum_traits()
  308    421   
        }
         422  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  309    423   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::RpcEchoOutput {
  310         -
            crate::output::RpcEchoOutput {}
         424  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         425  +
            crate::output::RpcEchoOutput {
         426  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */}
         427  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  311    428   
        }
         429  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  312    430   
    }
         431  +
         432  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  313    433   
}
  314         -
/// See [`MatchOutput`](crate::output::MatchOutput).
         434  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`MatchOutput`](crate::output::MatchOutput).
  315    435   
pub mod match_output {
  316    436   
         437  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  317    438   
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
  318    439   
        fn from(builder: Builder) -> Self {
  319    440   
            builder.build()
  320    441   
        }
  321    442   
    }
  322         -
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
         443  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`MatchOutput`](crate::output::MatchOutput).
         444  +
    /* RustType.kt:516 */
  323    445   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  324         -
    pub struct Builder {}
         446  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
         447  +
    pub struct Builder {/* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */}
         448  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  325    449   
    impl Builder {
  326         -
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         450  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         451  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  327    452   
        pub fn build(self) -> crate::output::MatchOutput {
  328    453   
            self.build_enforcing_required_and_enum_traits()
  329    454   
        }
         455  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  330    456   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::MatchOutput {
  331         -
            crate::output::MatchOutput {}
         457  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         458  +
            crate::output::MatchOutput {
         459  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */}
         460  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  332    461   
        }
         462  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  333    463   
    }
         464  +
         465  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  334    466   
}
  335         -
/// See [`OptionOutput`](crate::output::OptionOutput).
         467  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`OptionOutput`](crate::output::OptionOutput).
  336    468   
pub mod option_output {
  337    469   
         470  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  338    471   
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
  339    472   
        fn from(builder: Builder) -> Self {
  340    473   
            builder.build()
  341    474   
        }
  342    475   
    }
  343         -
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
         476  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`OptionOutput`](crate::output::OptionOutput).
         477  +
    /* RustType.kt:516 */
  344    478   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  345         -
    pub struct Builder {}
         479  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
         480  +
    pub struct Builder {/* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */}
         481  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  346    482   
    impl Builder {
  347         -
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         483  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         484  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  348    485   
        pub fn build(self) -> crate::output::OptionOutput {
  349    486   
            self.build_enforcing_required_and_enum_traits()
  350    487   
        }
         488  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  351    489   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::OptionOutput {
  352         -
            crate::output::OptionOutput {}
         490  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         491  +
            crate::output::OptionOutput {
         492  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */}
         493  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  353    494   
        }
         495  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  354    496   
    }
         497  +
         498  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  355    499   
}
  356         -
/// See [`ResultOutput`](crate::output::ResultOutput).
         500  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`ResultOutput`](crate::output::ResultOutput).
  357    501   
pub mod result_output {
  358    502   
         503  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  359    504   
    impl ::std::convert::From<Builder> for crate::output::ResultOutput {
  360    505   
        fn from(builder: Builder) -> Self {
  361    506   
            builder.build()
  362    507   
        }
  363    508   
    }
  364         -
    /// A builder for [`ResultOutput`](crate::output::ResultOutput).
         509  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`ResultOutput`](crate::output::ResultOutput).
         510  +
    /* RustType.kt:516 */
  365    511   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         512  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  366    513   
    pub struct Builder {
         514  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  367    515   
        pub(crate) pv_member: ::std::option::Option<bool>,
         516  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  368    517   
    }
         518  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  369    519   
    impl Builder {
         520  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  370    521   
        #[allow(missing_docs)] // documentation missing in model
         522  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  371    523   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  372         -
            self.pv_member = input;
         524  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         525  +
            self.pv_member =
         526  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         527  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  373    528   
            self
         529  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  374    530   
        }
  375         -
        /// Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
         531  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
         532  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  376    533   
        pub fn build(self) -> crate::output::ResultOutput {
  377    534   
            self.build_enforcing_required_and_enum_traits()
  378    535   
        }
         536  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  379    537   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::ResultOutput {
         538  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  380    539   
            crate::output::ResultOutput {
         540  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  381    541   
                pv_member: self.pv_member,
         542  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  382    543   
            }
         544  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  383    545   
        }
         546  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  384    547   
    }
         548  +
         549  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  385    550   
}
  386         -
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         551  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  387    552   
pub mod err_collisions_output {
  388    553   
         554  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  389    555   
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
  390    556   
        fn from(builder: Builder) -> Self {
  391    557   
            builder.build()
  392    558   
        }
  393    559   
    }
  394         -
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         560  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         561  +
    /* RustType.kt:516 */
  395    562   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  396         -
    pub struct Builder {}
         563  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
         564  +
    pub struct Builder {/* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */}
         565  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  397    566   
    impl Builder {
  398         -
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         567  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         568  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  399    569   
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
  400    570   
            self.build_enforcing_required_and_enum_traits()
  401    571   
        }
         572  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  402    573   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::ErrCollisionsOutput {
  403         -
            crate::output::ErrCollisionsOutput {}
         574  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         575  +
            crate::output::ErrCollisionsOutput {
         576  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */}
         577  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  404    578   
        }
         579  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  405    580   
    }
         581  +
         582  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  406    583   
}
  407         -
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         584  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  408    585   
pub mod structure_name_punning_output {
  409    586   
         587  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  410    588   
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
  411    589   
        fn from(builder: Builder) -> Self {
  412    590   
            builder.build()
  413    591   
        }
  414    592   
    }
  415         -
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         593  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         594  +
    /* RustType.kt:516 */
  416    595   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  417         -
    pub struct Builder {}
         596  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
         597  +
    pub struct Builder {/* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */}
         598  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  418    599   
    impl Builder {
  419         -
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         600  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         601  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  420    602   
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
  421    603   
            self.build_enforcing_required_and_enum_traits()
  422    604   
        }
         605  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  423    606   
        fn build_enforcing_required_and_enum_traits(
  424    607   
            self,
  425    608   
        ) -> crate::output::StructureNamePunningOutput {
  426         -
            crate::output::StructureNamePunningOutput {}
         609  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         610  +
            crate::output::StructureNamePunningOutput {
         611  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */}
         612  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  427    613   
        }
         614  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  428    615   
    }
         616  +
         617  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  429    618   
}
  430         -
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         619  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  431    620   
pub mod reserved_words_as_members_output {
  432    621   
         622  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  433    623   
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
  434    624   
        fn from(builder: Builder) -> Self {
  435    625   
            builder.build()
  436    626   
        }
  437    627   
    }
  438         -
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         628  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         629  +
    /* RustType.kt:516 */
  439    630   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  440         -
    pub struct Builder {}
         631  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
         632  +
    pub struct Builder {/* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */}
         633  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  441    634   
    impl Builder {
  442         -
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         635  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         636  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  443    637   
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
  444    638   
            self.build_enforcing_required_and_enum_traits()
  445    639   
        }
         640  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  446    641   
        fn build_enforcing_required_and_enum_traits(
  447    642   
            self,
  448    643   
        ) -> crate::output::ReservedWordsAsMembersOutput {
  449         -
            crate::output::ReservedWordsAsMembersOutput {}
         644  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         645  +
            crate::output::ReservedWordsAsMembersOutput {
         646  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */}
         647  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  450    648   
        }
         649  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  451    650   
    }
         651  +
         652  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  452    653   
}

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

@@ -1,1 +38,39 @@
   12     12   
pub(crate) mod shape_rpc_echo;
   13     13   
   14     14   
pub(crate) mod shape_structure_name_punning;
   15     15   
   16     16   
pub(crate) mod shape_colliding_error;
   17     17   
   18     18   
pub(crate) mod shape_colliding_exception;
   19     19   
   20     20   
pub(crate) mod shape_internal_server_error;
   21     21   
          22  +
/* JsonParserGenerator.kt:227 */
   22     23   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   23     24   
    if data.is_empty() {
   24     25   
        b"{}"
   25     26   
    } else {
   26     27   
        data
   27     28   
    }
   28     29   
}
   29     30   
   30     31   
pub(crate) mod shape_option_output;
   31     32   

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

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

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

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

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

@@ -1,1 +126,181 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_err_collisions_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ErrCollisionsInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::err_collisions_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_err_collisions_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::ErrCollisionsOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/x-amz-json-1.1",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
   43         -
        let payload = "";
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          61  +
        let payload =
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   44     65   
        let content_length = payload.len();
   45     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     67   
            builder,
   47     68   
            ::http::header::CONTENT_LENGTH,
   48     69   
            content_length,
   49     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   50     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   51     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   52     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   53     78   
}
   54     79   
          80  +
/* RustType.kt:516 */
   55     81   
#[allow(clippy::unnecessary_wraps)]
          82  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   56     83   
pub fn ser_err_collisions_http_error(
   57     84   
    error: &crate::error::ErrCollisionsError,
   58     85   
) -> std::result::Result<
   59     86   
    ::aws_smithy_http_server::response::Response,
   60     87   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   61     88   
> {
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   62     90   
    Ok({
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   63     92   
        match error {
          93  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   64     94   
            crate::error::ErrCollisionsError::CollidingError(output) => {
          95  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   65     96   
                let payload =
   66     97   
                    crate::protocol_serde::shape_colliding_error::ser_colliding_error_error(
   67     98   
                        output,
   68     99   
                    )?;
         100  +
                /* RustType.kt:516 */
   69    101   
                #[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   70    103   
                let mut builder = ::http::Response::builder();
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   71    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72    106   
                    builder,
   73    107   
                    ::http::header::CONTENT_TYPE,
   74    108   
                    "application/x-amz-json-1.1",
   75    109   
                );
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   76    111   
                let content_length = payload.len();
   77    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78    113   
                    builder,
   79    114   
                    ::http::header::CONTENT_LENGTH,
   80    115   
                    content_length,
   81    116   
                );
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   82    118   
                builder
   83    119   
                    .status(400)
   84    120   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   85    122   
            }
         123  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   86    124   
            crate::error::ErrCollisionsError::CollidingException(output) => {
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   87    126   
                let payload = crate::protocol_serde::shape_colliding_exception::ser_colliding_exception_error(output)?;
         127  +
                /* RustType.kt:516 */
   88    128   
                #[allow(unused_mut)]
         129  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   89    130   
                let mut builder = ::http::Response::builder();
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   90    132   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    133   
                    builder,
   92    134   
                    ::http::header::CONTENT_TYPE,
   93    135   
                    "application/x-amz-json-1.1",
   94    136   
                );
         137  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   95    138   
                let content_length = payload.len();
   96    139   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    140   
                    builder,
   98    141   
                    ::http::header::CONTENT_LENGTH,
   99    142   
                    content_length,
  100    143   
                );
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  101    145   
                builder
  102    146   
                    .status(400)
  103    147   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         148  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  104    149   
            }
         150  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  105    151   
            crate::error::ErrCollisionsError::InternalServerError(output) => {
         152  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  106    153   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         154  +
                /* RustType.kt:516 */
  107    155   
                #[allow(unused_mut)]
         156  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  108    157   
                let mut builder = ::http::Response::builder();
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  109    159   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  110    160   
                    builder,
  111    161   
                    ::http::header::CONTENT_TYPE,
  112    162   
                    "application/x-amz-json-1.1",
  113    163   
                );
         164  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  114    165   
                let content_length = payload.len();
  115    166   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    167   
                    builder,
  117    168   
                    ::http::header::CONTENT_LENGTH,
  118    169   
                    content_length,
  119    170   
                );
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  120    172   
                builder
  121    173   
                    .status(500)
  122    174   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         175  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         176  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  123    177   
        }
  124         -
        }
         178  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  125    179   
    })
         180  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  126    181   
}

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

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

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

@@ -1,1 +225,339 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_match_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::MatchInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::match_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_match::de_match(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()?
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_match_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::MatchOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
   51         -
        let payload = "";
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          73  +
        let payload =
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   52     77   
        let content_length = payload.len();
   53     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     79   
            builder,
   55     80   
            ::http::header::CONTENT_LENGTH,
   56     81   
            content_length,
   57     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   58     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   59     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   60     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   61     90   
}
   62     91   
          92  +
/* RustType.kt:516 */
   63     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   64     95   
pub fn ser_match_http_error(
   65     96   
    error: &crate::error::MatchError,
   66     97   
) -> std::result::Result<
   67     98   
    ::aws_smithy_http_server::response::Response,
   68     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   70    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   71    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   72    106   
            crate::error::MatchError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   73    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   74    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   75    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    115   
                    builder,
   78    116   
                    ::http::header::CONTENT_TYPE,
   79    117   
                    "application/x-amz-json-1.1",
   80    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    120   
                let content_length = payload.len();
   82    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    122   
                    builder,
   84    123   
                    ::http::header::CONTENT_LENGTH,
   85    124   
                    content_length,
   86    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    127   
                builder
   88    128   
                    .status(400)
   89    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   90    131   
            }
         132  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   91    133   
            crate::error::MatchError::InternalServerError(output) => {
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   92    135   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         136  +
                /* RustType.kt:516 */
   93    137   
                #[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   94    139   
                let mut builder = ::http::Response::builder();
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   95    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    142   
                    builder,
   97    143   
                    ::http::header::CONTENT_TYPE,
   98    144   
                    "application/x-amz-json-1.1",
   99    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  100    147   
                let content_length = payload.len();
  101    148   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    149   
                    builder,
  103    150   
                    ::http::header::CONTENT_LENGTH,
  104    151   
                    content_length,
  105    152   
                );
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  106    154   
                builder
  107    155   
                    .status(500)
  108    156   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         158  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  109    159   
        }
  110         -
        }
         160  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  111    161   
    })
         162  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  112    163   
}
  113    164   
         165  +
/* JsonParserGenerator.kt:148 */
  114    166   
pub(crate) fn de_match(
  115    167   
    value: &[u8],
  116    168   
    mut builder: crate::input::match_input_internal::Builder,
  117    169   
) -> ::std::result::Result<
  118    170   
    crate::input::match_input_internal::Builder,
  119    171   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  120    172   
> {
         173  +
    /* JsonParserGenerator.kt:153 */
  121    174   
    let mut tokens_owned =
  122    175   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  123    176   
            .peekable();
  124    177   
    let tokens = &mut tokens_owned;
  125    178   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         179  +
    /* JsonParserGenerator.kt:684 */
  126    180   
    loop {
         181  +
        /* JsonParserGenerator.kt:685 */
  127    182   
        match tokens.next().transpose()? {
         183  +
            /* JsonParserGenerator.kt:686 */
  128    184   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  129    185   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         186  +
                /* JsonParserGenerator.kt:260 */
  130    187   
                match key.to_unescaped()?.as_ref() {
         188  +
                    /* JsonParserGenerator.kt:262 */
  131    189   
                    "as" => {
         190  +
                        /* JsonParserGenerator.kt:272 */
  132    191   
                        builder = builder.set_as(
         192  +
                            /* JsonParserGenerator.kt:365 */
  133    193   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  134    194   
                                tokens.next(),
  135    195   
                            )?
  136    196   
                            .map(i32::try_from)
  137         -
                            .transpose()?,
         197  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  138    198   
                        );
         199  +
                        /* JsonParserGenerator.kt:262 */
  139    200   
                    }
         201  +
                    /* JsonParserGenerator.kt:262 */
  140    202   
                    "async" => {
         203  +
                        /* JsonParserGenerator.kt:272 */
  141    204   
                        builder = builder.set_async(
         205  +
                            /* JsonParserGenerator.kt:298 */
  142    206   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  143    207   
                                tokens.next(),
  144         -
                            )?,
         208  +
                            )?, /* JsonParserGenerator.kt:272 */
  145    209   
                        );
         210  +
                        /* JsonParserGenerator.kt:262 */
  146    211   
                    }
         212  +
                    /* JsonParserGenerator.kt:262 */
  147    213   
                    "enum" => {
         214  +
                        /* JsonParserGenerator.kt:272 */
  148    215   
                        builder = builder.set_enum(
         216  +
                            /* JsonParserGenerator.kt:354 */
  149    217   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  150    218   
                                tokens.next(),
  151    219   
                            )?
  152         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  153         -
                            .transpose()?,
         220  +
                            .map(|s|
         221  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         222  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         223  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         224  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  154    225   
                        );
         226  +
                        /* JsonParserGenerator.kt:262 */
  155    227   
                    }
         228  +
                    /* JsonParserGenerator.kt:262 */
  156    229   
                    "self" => {
         230  +
                        /* JsonParserGenerator.kt:272 */
  157    231   
                        builder = builder.set_self(
         232  +
                            /* JsonParserGenerator.kt:298 */
  158    233   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  159    234   
                                tokens.next(),
  160         -
                            )?,
         235  +
                            )?, /* JsonParserGenerator.kt:272 */
  161    236   
                        );
         237  +
                        /* JsonParserGenerator.kt:262 */
  162    238   
                    }
         239  +
                    /* JsonParserGenerator.kt:262 */
  163    240   
                    "crate" => {
         241  +
                        /* JsonParserGenerator.kt:272 */
  164    242   
                        builder = builder.set_crate(
         243  +
                            /* JsonParserGenerator.kt:298 */
  165    244   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  166    245   
                                tokens.next(),
  167         -
                            )?,
         246  +
                            )?, /* JsonParserGenerator.kt:272 */
  168    247   
                        );
         248  +
                        /* JsonParserGenerator.kt:262 */
  169    249   
                    }
         250  +
                    /* JsonParserGenerator.kt:262 */
  170    251   
                    "super" => {
         252  +
                        /* JsonParserGenerator.kt:272 */
  171    253   
                        builder = builder.set_super(
         254  +
                            /* JsonParserGenerator.kt:298 */
  172    255   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  173    256   
                                tokens.next(),
  174         -
                            )?,
         257  +
                            )?, /* JsonParserGenerator.kt:272 */
  175    258   
                        );
         259  +
                        /* JsonParserGenerator.kt:262 */
  176    260   
                    }
         261  +
                    /* JsonParserGenerator.kt:262 */
  177    262   
                    "build" => {
         263  +
                        /* JsonParserGenerator.kt:272 */
  178    264   
                        builder = builder.set_build(
         265  +
                            /* JsonParserGenerator.kt:354 */
  179    266   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  180    267   
                                tokens.next(),
  181    268   
                            )?
  182         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  183         -
                            .transpose()?,
         269  +
                            .map(|s|
         270  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         271  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         272  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         273  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  184    274   
                        );
         275  +
                        /* JsonParserGenerator.kt:262 */
  185    276   
                    }
         277  +
                    /* JsonParserGenerator.kt:262 */
  186    278   
                    "default" => {
         279  +
                        /* JsonParserGenerator.kt:272 */
  187    280   
                        builder = builder.set_default(
         281  +
                            /* JsonParserGenerator.kt:354 */
  188    282   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  189    283   
                                tokens.next(),
  190    284   
                            )?
  191         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  192         -
                            .transpose()?,
         285  +
                            .map(|s|
         286  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         287  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         288  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         289  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  193    290   
                        );
         291  +
                        /* JsonParserGenerator.kt:262 */
  194    292   
                    }
         293  +
                    /* JsonParserGenerator.kt:262 */
  195    294   
                    "send" => {
         295  +
                        /* JsonParserGenerator.kt:272 */
  196    296   
                        builder = builder.set_send(
         297  +
                            /* JsonParserGenerator.kt:354 */
  197    298   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  198    299   
                                tokens.next(),
  199    300   
                            )?
  200         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  201         -
                            .transpose()?,
         301  +
                            .map(|s|
         302  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         303  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         304  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         305  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  202    306   
                        );
         307  +
                        /* JsonParserGenerator.kt:262 */
  203    308   
                    }
  204         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         309  +
                    /* JsonParserGenerator.kt:290 */
         310  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  205    311   
                }
         312  +
                /* JsonParserGenerator.kt:686 */
  206    313   
            }
         314  +
            /* JsonParserGenerator.kt:695 */
  207    315   
            other => {
  208    316   
                return Err(
  209    317   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  210    318   
                        "expected object key or end object, found: {:?}",
  211    319   
                        other
  212    320   
                    )),
  213    321   
                )
         322  +
            } /* JsonParserGenerator.kt:685 */
  214    323   
        }
         324  +
        /* JsonParserGenerator.kt:684 */
  215    325   
    }
  216         -
    }
         326  +
    /* JsonParserGenerator.kt:250 */
  217    327   
    if tokens.next().is_some() {
         328  +
        /* JsonParserGenerator.kt:251 */
  218    329   
        return Err(
  219    330   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  220    331   
                "found more JSON tokens after completing parsing",
  221    332   
            ),
  222    333   
        );
         334  +
        /* JsonParserGenerator.kt:250 */
  223    335   
    }
         336  +
    /* JsonParserGenerator.kt:163 */
  224    337   
    Ok(builder)
         338  +
    /* JsonParserGenerator.kt:148 */
  225    339   
}

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

@@ -1,1 +141,202 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_option_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::OptionInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::option_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_option::de_option(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_option_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::OptionOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_option_output::ser_option_output_output_output(&output)?;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_option_output::ser_option_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   53     77   
        let content_length = payload.len();
   54     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     79   
            builder,
   56     80   
            ::http::header::CONTENT_LENGTH,
   57     81   
            content_length,
   58     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   59     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   60     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   61     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   62     90   
}
   63     91   
          92  +
/* RustType.kt:516 */
   64     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   65     95   
pub fn ser_option_http_error(
   66     96   
    error: &crate::error::OptionError,
   67     97   
) -> std::result::Result<
   68     98   
    ::aws_smithy_http_server::response::Response,
   69     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   70    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   71    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   72    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   73    106   
            crate::error::OptionError::InternalServerError(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   74    108   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         109  +
                /* RustType.kt:516 */
   75    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   76    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   77    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78    115   
                    builder,
   79    116   
                    ::http::header::CONTENT_TYPE,
   80    117   
                    "application/x-amz-json-1.1",
   81    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   82    120   
                let content_length = payload.len();
   83    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    122   
                    builder,
   85    123   
                    ::http::header::CONTENT_LENGTH,
   86    124   
                    content_length,
   87    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   88    127   
                builder
   89    128   
                    .status(500)
   90    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         131  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   91    132   
        }
   92         -
        }
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   93    134   
    })
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   94    136   
}
   95    137   
         138  +
/* JsonParserGenerator.kt:148 */
   96    139   
pub(crate) fn de_option(
   97    140   
    value: &[u8],
   98    141   
    mut builder: crate::input::option_input_internal::Builder,
   99    142   
) -> ::std::result::Result<
  100    143   
    crate::input::option_input_internal::Builder,
  101    144   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  102    145   
> {
         146  +
    /* JsonParserGenerator.kt:153 */
  103    147   
    let mut tokens_owned =
  104    148   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  105    149   
            .peekable();
  106    150   
    let tokens = &mut tokens_owned;
  107    151   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         152  +
    /* JsonParserGenerator.kt:684 */
  108    153   
    loop {
         154  +
        /* JsonParserGenerator.kt:685 */
  109    155   
        match tokens.next().transpose()? {
         156  +
            /* JsonParserGenerator.kt:686 */
  110    157   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  111    158   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         159  +
                /* JsonParserGenerator.kt:260 */
  112    160   
                match key.to_unescaped()?.as_ref() {
         161  +
                    /* JsonParserGenerator.kt:262 */
  113    162   
                    "pv_member" => {
         163  +
                        /* JsonParserGenerator.kt:272 */
  114    164   
                        builder = builder.set_pv_member(
         165  +
                            /* JsonParserGenerator.kt:298 */
  115    166   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  116    167   
                                tokens.next(),
  117         -
                            )?,
         168  +
                            )?, /* JsonParserGenerator.kt:272 */
  118    169   
                        );
         170  +
                        /* JsonParserGenerator.kt:262 */
  119    171   
                    }
  120         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         172  +
                    /* JsonParserGenerator.kt:290 */
         173  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  121    174   
                }
         175  +
                /* JsonParserGenerator.kt:686 */
  122    176   
            }
         177  +
            /* JsonParserGenerator.kt:695 */
  123    178   
            other => {
  124    179   
                return Err(
  125    180   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  126    181   
                        "expected object key or end object, found: {:?}",
  127    182   
                        other
  128    183   
                    )),
  129    184   
                )
         185  +
            } /* JsonParserGenerator.kt:685 */
  130    186   
        }
         187  +
        /* JsonParserGenerator.kt:684 */
  131    188   
    }
  132         -
    }
         189  +
    /* JsonParserGenerator.kt:250 */
  133    190   
    if tokens.next().is_some() {
         191  +
        /* JsonParserGenerator.kt:251 */
  134    192   
        return Err(
  135    193   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  136    194   
                "found more JSON tokens after completing parsing",
  137    195   
            ),
  138    196   
        );
         197  +
        /* JsonParserGenerator.kt:250 */
  139    198   
    }
         199  +
    /* JsonParserGenerator.kt:163 */
  140    200   
    Ok(builder)
         201  +
    /* JsonParserGenerator.kt:148 */
  141    202   
}

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

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

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

@@ -1,1 +225,339 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_reserved_words_as_members_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ReservedWordsAsMembersInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::reserved_words_as_members_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()?
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_reserved_words_as_members_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::ReservedWordsAsMembersOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
   51         -
        let payload = "";
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          73  +
        let payload =
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   52     77   
        let content_length = payload.len();
   53     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     79   
            builder,
   55     80   
            ::http::header::CONTENT_LENGTH,
   56     81   
            content_length,
   57     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   58     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   59     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   60     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   61     90   
}
   62     91   
          92  +
/* RustType.kt:516 */
   63     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   64     95   
pub fn ser_reserved_words_as_members_http_error(
   65     96   
    error: &crate::error::ReservedWordsAsMembersError,
   66     97   
) -> std::result::Result<
   67     98   
    ::aws_smithy_http_server::response::Response,
   68     99   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   70    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   71    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   72    106   
            crate::error::ReservedWordsAsMembersError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   73    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   74    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   75    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    115   
                    builder,
   78    116   
                    ::http::header::CONTENT_TYPE,
   79    117   
                    "application/x-amz-json-1.1",
   80    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    120   
                let content_length = payload.len();
   82    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    122   
                    builder,
   84    123   
                    ::http::header::CONTENT_LENGTH,
   85    124   
                    content_length,
   86    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    127   
                builder
   88    128   
                    .status(400)
   89    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   90    131   
            }
         132  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   91    133   
            crate::error::ReservedWordsAsMembersError::InternalServerError(output) => {
         134  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   92    135   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         136  +
                /* RustType.kt:516 */
   93    137   
                #[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   94    139   
                let mut builder = ::http::Response::builder();
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   95    141   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    142   
                    builder,
   97    143   
                    ::http::header::CONTENT_TYPE,
   98    144   
                    "application/x-amz-json-1.1",
   99    145   
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  100    147   
                let content_length = payload.len();
  101    148   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    149   
                    builder,
  103    150   
                    ::http::header::CONTENT_LENGTH,
  104    151   
                    content_length,
  105    152   
                );
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  106    154   
                builder
  107    155   
                    .status(500)
  108    156   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         158  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  109    159   
        }
  110         -
        }
         160  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  111    161   
    })
         162  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  112    163   
}
  113    164   
         165  +
/* JsonParserGenerator.kt:148 */
  114    166   
pub(crate) fn de_reserved_words_as_members(
  115    167   
    value: &[u8],
  116    168   
    mut builder: crate::input::reserved_words_as_members_input_internal::Builder,
  117    169   
) -> ::std::result::Result<
  118    170   
    crate::input::reserved_words_as_members_input_internal::Builder,
  119    171   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  120    172   
> {
         173  +
    /* JsonParserGenerator.kt:153 */
  121    174   
    let mut tokens_owned =
  122    175   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  123    176   
            .peekable();
  124    177   
    let tokens = &mut tokens_owned;
  125    178   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         179  +
    /* JsonParserGenerator.kt:684 */
  126    180   
    loop {
         181  +
        /* JsonParserGenerator.kt:685 */
  127    182   
        match tokens.next().transpose()? {
         183  +
            /* JsonParserGenerator.kt:686 */
  128    184   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  129    185   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         186  +
                /* JsonParserGenerator.kt:260 */
  130    187   
                match key.to_unescaped()?.as_ref() {
         188  +
                    /* JsonParserGenerator.kt:262 */
  131    189   
                    "as" => {
         190  +
                        /* JsonParserGenerator.kt:272 */
  132    191   
                        builder = builder.set_as(
         192  +
                            /* JsonParserGenerator.kt:365 */
  133    193   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
  134    194   
                                tokens.next(),
  135    195   
                            )?
  136    196   
                            .map(i32::try_from)
  137         -
                            .transpose()?,
         197  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  138    198   
                        );
         199  +
                        /* JsonParserGenerator.kt:262 */
  139    200   
                    }
         201  +
                    /* JsonParserGenerator.kt:262 */
  140    202   
                    "async" => {
         203  +
                        /* JsonParserGenerator.kt:272 */
  141    204   
                        builder = builder.set_async(
         205  +
                            /* JsonParserGenerator.kt:298 */
  142    206   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  143    207   
                                tokens.next(),
  144         -
                            )?,
         208  +
                            )?, /* JsonParserGenerator.kt:272 */
  145    209   
                        );
         210  +
                        /* JsonParserGenerator.kt:262 */
  146    211   
                    }
         212  +
                    /* JsonParserGenerator.kt:262 */
  147    213   
                    "enum" => {
         214  +
                        /* JsonParserGenerator.kt:272 */
  148    215   
                        builder = builder.set_enum(
         216  +
                            /* JsonParserGenerator.kt:354 */
  149    217   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  150    218   
                                tokens.next(),
  151    219   
                            )?
  152         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  153         -
                            .transpose()?,
         220  +
                            .map(|s|
         221  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         222  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         223  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         224  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  154    225   
                        );
         226  +
                        /* JsonParserGenerator.kt:262 */
  155    227   
                    }
         228  +
                    /* JsonParserGenerator.kt:262 */
  156    229   
                    "self" => {
         230  +
                        /* JsonParserGenerator.kt:272 */
  157    231   
                        builder = builder.set_self(
         232  +
                            /* JsonParserGenerator.kt:298 */
  158    233   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  159    234   
                                tokens.next(),
  160         -
                            )?,
         235  +
                            )?, /* JsonParserGenerator.kt:272 */
  161    236   
                        );
         237  +
                        /* JsonParserGenerator.kt:262 */
  162    238   
                    }
         239  +
                    /* JsonParserGenerator.kt:262 */
  163    240   
                    "crate" => {
         241  +
                        /* JsonParserGenerator.kt:272 */
  164    242   
                        builder = builder.set_crate(
         243  +
                            /* JsonParserGenerator.kt:298 */
  165    244   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  166    245   
                                tokens.next(),
  167         -
                            )?,
         246  +
                            )?, /* JsonParserGenerator.kt:272 */
  168    247   
                        );
         248  +
                        /* JsonParserGenerator.kt:262 */
  169    249   
                    }
         250  +
                    /* JsonParserGenerator.kt:262 */
  170    251   
                    "super" => {
         252  +
                        /* JsonParserGenerator.kt:272 */
  171    253   
                        builder = builder.set_super(
         254  +
                            /* JsonParserGenerator.kt:298 */
  172    255   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
  173    256   
                                tokens.next(),
  174         -
                            )?,
         257  +
                            )?, /* JsonParserGenerator.kt:272 */
  175    258   
                        );
         259  +
                        /* JsonParserGenerator.kt:262 */
  176    260   
                    }
         261  +
                    /* JsonParserGenerator.kt:262 */
  177    262   
                    "build" => {
         263  +
                        /* JsonParserGenerator.kt:272 */
  178    264   
                        builder = builder.set_build(
         265  +
                            /* JsonParserGenerator.kt:354 */
  179    266   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  180    267   
                                tokens.next(),
  181    268   
                            )?
  182         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  183         -
                            .transpose()?,
         269  +
                            .map(|s|
         270  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         271  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         272  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         273  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  184    274   
                        );
         275  +
                        /* JsonParserGenerator.kt:262 */
  185    276   
                    }
         277  +
                    /* JsonParserGenerator.kt:262 */
  186    278   
                    "default" => {
         279  +
                        /* JsonParserGenerator.kt:272 */
  187    280   
                        builder = builder.set_default(
         281  +
                            /* JsonParserGenerator.kt:354 */
  188    282   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  189    283   
                                tokens.next(),
  190    284   
                            )?
  191         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  192         -
                            .transpose()?,
         285  +
                            .map(|s|
         286  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         287  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         288  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         289  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  193    290   
                        );
         291  +
                        /* JsonParserGenerator.kt:262 */
  194    292   
                    }
         293  +
                    /* JsonParserGenerator.kt:262 */
  195    294   
                    "send" => {
         295  +
                        /* JsonParserGenerator.kt:272 */
  196    296   
                        builder = builder.set_send(
         297  +
                            /* JsonParserGenerator.kt:354 */
  197    298   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  198    299   
                                tokens.next(),
  199    300   
                            )?
  200         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  201         -
                            .transpose()?,
         301  +
                            .map(|s|
         302  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         303  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         304  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         305  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  202    306   
                        );
         307  +
                        /* JsonParserGenerator.kt:262 */
  203    308   
                    }
  204         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         309  +
                    /* JsonParserGenerator.kt:290 */
         310  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  205    311   
                }
         312  +
                /* JsonParserGenerator.kt:686 */
  206    313   
            }
         314  +
            /* JsonParserGenerator.kt:695 */
  207    315   
            other => {
  208    316   
                return Err(
  209    317   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  210    318   
                        "expected object key or end object, found: {:?}",
  211    319   
                        other
  212    320   
                    )),
  213    321   
                )
         322  +
            } /* JsonParserGenerator.kt:685 */
  214    323   
        }
         324  +
        /* JsonParserGenerator.kt:684 */
  215    325   
    }
  216         -
    }
         326  +
    /* JsonParserGenerator.kt:250 */
  217    327   
    if tokens.next().is_some() {
         328  +
        /* JsonParserGenerator.kt:251 */
  218    329   
        return Err(
  219    330   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  220    331   
                "found more JSON tokens after completing parsing",
  221    332   
            ),
  222    333   
        );
         334  +
        /* JsonParserGenerator.kt:250 */
  223    335   
    }
         336  +
    /* JsonParserGenerator.kt:163 */
  224    337   
    Ok(builder)
         338  +
    /* JsonParserGenerator.kt:148 */
  225    339   
}