Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +570,933 @@
    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 result typing.Optional\[naming_test_structs.model.Result\]:
    4      6   
/// :param result_list typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
    5      7   
/// :param option typing.Optional\[naming_test_structs.model.Option\]:
    6      8   
/// :param option_list typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
    7      9   
/// :param some_union typing.Optional\[naming_test_structs.model.SomeUnion\]:
    8     10   
/// :rtype None:
          11  +
/* StructureGenerator.kt:197 */
    9     12   
#[allow(missing_docs)] // documentation missing in model
          13  +
/* RustType.kt:516 */
   10     14   
#[derive(
   11     15   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   12     16   
)]
   13         -
pub struct SomethingElse {
          17  +
pub /* StructureGenerator.kt:201 */ struct SomethingElse {
          18  +
    /* RustType.kt:516 */
   14     19   
    #[pyo3(get, set)]
          20  +
    /* PythonServerStructureGenerator.kt:80 */
   15     21   
    /// :type typing.Optional\[naming_test_structs.model.Result\]:
          22  +
    /* StructureGenerator.kt:231 */
   16     23   
    #[allow(missing_docs)] // documentation missing in model
   17     24   
    pub result: ::std::option::Option<crate::model::Result>,
          25  +
    /* RustType.kt:516 */
   18     26   
    #[pyo3(get, set)]
          27  +
    /* PythonServerStructureGenerator.kt:80 */
   19     28   
    /// :type typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
          29  +
    /* StructureGenerator.kt:231 */
   20     30   
    #[allow(missing_docs)] // documentation missing in model
   21     31   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          32  +
    /* RustType.kt:516 */
   22     33   
    #[pyo3(get, set)]
          34  +
    /* PythonServerStructureGenerator.kt:80 */
   23     35   
    /// :type typing.Optional\[naming_test_structs.model.Option\]:
          36  +
    /* StructureGenerator.kt:231 */
   24     37   
    #[allow(missing_docs)] // documentation missing in model
   25     38   
    pub option: ::std::option::Option<crate::model::Option>,
          39  +
    /* RustType.kt:516 */
   26     40   
    #[pyo3(get, set)]
          41  +
    /* PythonServerStructureGenerator.kt:80 */
   27     42   
    /// :type typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
          43  +
    /* StructureGenerator.kt:231 */
   28     44   
    #[allow(missing_docs)] // documentation missing in model
   29     45   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          46  +
    /* RustType.kt:516 */
   30     47   
    #[pyo3(get, set)]
          48  +
    /* PythonServerStructureGenerator.kt:80 */
   31     49   
    /// :type typing.Optional\[naming_test_structs.model.SomeUnion\]:
          50  +
    /* StructureGenerator.kt:231 */
   32     51   
    #[allow(missing_docs)] // documentation missing in model
   33     52   
    pub some_union: ::std::option::Option<crate::model::SomeUnion>,
          53  +
    /* StructureGenerator.kt:201 */
   34     54   
}
          55  +
/* StructureGenerator.kt:135 */
   35     56   
impl SomethingElse {
          57  +
    /* StructureGenerator.kt:231 */
   36     58   
    #[allow(missing_docs)] // documentation missing in model
          59  +
                           /* StructureGenerator.kt:166 */
   37     60   
    pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
          61  +
        /* StructureGenerator.kt:170 */
   38     62   
        self.result.as_ref()
          63  +
        /* StructureGenerator.kt:166 */
   39     64   
    }
          65  +
    /* StructureGenerator.kt:231 */
   40     66   
    #[allow(missing_docs)] // documentation missing in model
          67  +
                           /* StructureGenerator.kt:166 */
   41     68   
    pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          69  +
        /* StructureGenerator.kt:169 */
   42     70   
        self.result_list.as_deref()
          71  +
        /* StructureGenerator.kt:166 */
   43     72   
    }
          73  +
    /* StructureGenerator.kt:231 */
   44     74   
    #[allow(missing_docs)] // documentation missing in model
          75  +
                           /* StructureGenerator.kt:166 */
   45     76   
    pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
          77  +
        /* StructureGenerator.kt:170 */
   46     78   
        self.option.as_ref()
          79  +
        /* StructureGenerator.kt:166 */
   47     80   
    }
          81  +
    /* StructureGenerator.kt:231 */
   48     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* StructureGenerator.kt:166 */
   49     84   
    pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          85  +
        /* StructureGenerator.kt:169 */
   50     86   
        self.option_list.as_deref()
          87  +
        /* StructureGenerator.kt:166 */
   51     88   
    }
          89  +
    /* StructureGenerator.kt:231 */
   52     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* StructureGenerator.kt:166 */
   53     92   
    pub fn some_union(&self) -> ::std::option::Option<&crate::model::SomeUnion> {
          93  +
        /* StructureGenerator.kt:170 */
   54     94   
        self.some_union.as_ref()
          95  +
        /* StructureGenerator.kt:166 */
   55     96   
    }
          97  +
    /* StructureGenerator.kt:135 */
   56     98   
}
          99  +
/* RustType.kt:516 */
   57    100   
#[allow(clippy::new_without_default)]
         101  +
/* RustType.kt:516 */
   58    102   
#[allow(clippy::too_many_arguments)]
         103  +
/* RustType.kt:516 */
   59    104   
#[::pyo3::pymethods]
         105  +
/* PythonServerStructureGenerator.kt:88 */
   60    106   
impl SomethingElse {
   61    107   
    #[new]
   62    108   
    pub fn new(
   63    109   
        result: ::std::option::Option<crate::model::Result>,
   64    110   
        result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   65    111   
        option: ::std::option::Option<crate::model::Option>,
   66    112   
        option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   67    113   
        some_union: ::std::option::Option<crate::model::SomeUnion>,
   68    114   
    ) -> Self {
   69    115   
        Self {
   70    116   
            result,
   71    117   
            result_list,
   72    118   
            option,
   73    119   
            option_list,
   74    120   
            some_union,
   75    121   
        }
   76    122   
    }
   77    123   
    fn __repr__(&self) -> String {
   78    124   
        format!("{self:?}")
   79    125   
    }
   80    126   
    fn __str__(&self) -> String {
   81    127   
        format!("{self:?}")
   82    128   
    }
   83    129   
}
         130  +
/* PythonServerStructureGenerator.kt:111 */
   84    131   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<SomethingElse> {
   85    132   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   86    133   
        ob.extract::<SomethingElse>().map(Box::new)
   87    134   
    }
   88    135   
}
   89    136   
   90    137   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<SomethingElse> {
   91    138   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   92    139   
        (*self).into_py(py)
   93    140   
    }
   94    141   
}
         142  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   95    143   
impl crate::constrained::Constrained for crate::model::SomethingElse {
   96    144   
    type Unconstrained = crate::model::something_else_internal::Builder;
   97    145   
}
         146  +
/* ServerCodegenVisitor.kt:370 */
   98    147   
impl SomethingElse {
   99         -
    /// Creates a new builder-style object to manufacture [`SomethingElse`](crate::model::SomethingElse).
         148  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`SomethingElse`](crate::model::SomethingElse).
         149  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  100    150   
    pub fn builder() -> crate::model::something_else::Builder {
         151  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  101    152   
        crate::model::something_else::Builder::default()
         153  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  102    154   
    }
         155  +
    /* ServerCodegenVisitor.kt:370 */
  103    156   
}
  104    157   
         158  +
/* UnionGenerator.kt:67 */
  105    159   
#[allow(missing_docs)] // documentation missing in model
         160  +
/* RustType.kt:516 */
  106    161   
#[derive(
  107    162   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  108    163   
)]
  109         -
pub enum SomeUnion {
         164  +
pub /* UnionGenerator.kt:85 */ enum SomeUnion {
         165  +
    /* UnionGenerator.kt:90 */
  110    166   
    #[allow(missing_docs)] // documentation missing in model
         167  +
    /* UnionGenerator.kt:190 */
  111    168   
    Option(crate::model::Option),
         169  +
    /* UnionGenerator.kt:90 */
  112    170   
    #[allow(missing_docs)] // documentation missing in model
         171  +
    /* UnionGenerator.kt:190 */
  113    172   
    Result(crate::model::Result),
         173  +
    /* UnionGenerator.kt:85 */
  114    174   
}
         175  +
/* UnionGenerator.kt:111 */
  115    176   
impl SomeUnion {
         177  +
    /* UnionGenerator.kt:217 */
  116    178   
    /// Tries to convert the enum instance into [`Option`](crate::model::SomeUnion::Option), extracting the inner [`Option`](crate::model::Option).
         179  +
    /* UnionGenerator.kt:222 */
  117    180   
    /// Returns `Err(&Self)` if it can't be converted.
         181  +
    /* UnionGenerator.kt:223 */
  118    182   
    pub fn as_option(&self) -> ::std::result::Result<&crate::model::Option, &Self> {
         183  +
        /* UnionGenerator.kt:227 */
  119    184   
        if let SomeUnion::Option(val) = &self {
  120    185   
            ::std::result::Result::Ok(val)
  121    186   
        } else {
  122    187   
            ::std::result::Result::Err(self)
  123    188   
        }
         189  +
        /* UnionGenerator.kt:223 */
  124    190   
    }
         191  +
    /* UnionGenerator.kt:121 */
  125    192   
    /// Returns true if this is a [`Option`](crate::model::SomeUnion::Option).
         193  +
    /* UnionGenerator.kt:122 */
  126    194   
    pub fn is_option(&self) -> bool {
         195  +
        /* UnionGenerator.kt:123 */
  127    196   
        self.as_option().is_ok()
         197  +
        /* UnionGenerator.kt:122 */
  128    198   
    }
         199  +
    /* UnionGenerator.kt:217 */
  129    200   
    /// Tries to convert the enum instance into [`Result`](crate::model::SomeUnion::Result), extracting the inner [`Result`](crate::model::Result).
         201  +
    /* UnionGenerator.kt:222 */
  130    202   
    /// Returns `Err(&Self)` if it can't be converted.
         203  +
    /* UnionGenerator.kt:223 */
  131    204   
    pub fn as_result(&self) -> ::std::result::Result<&crate::model::Result, &Self> {
         205  +
        /* UnionGenerator.kt:227 */
  132    206   
        if let SomeUnion::Result(val) = &self {
  133    207   
            ::std::result::Result::Ok(val)
  134    208   
        } else {
  135    209   
            ::std::result::Result::Err(self)
  136    210   
        }
         211  +
        /* UnionGenerator.kt:223 */
  137    212   
    }
         213  +
    /* UnionGenerator.kt:121 */
  138    214   
    /// Returns true if this is a [`Result`](crate::model::SomeUnion::Result).
         215  +
    /* UnionGenerator.kt:122 */
  139    216   
    pub fn is_result(&self) -> bool {
         217  +
        /* UnionGenerator.kt:123 */
  140    218   
        self.as_result().is_ok()
         219  +
        /* UnionGenerator.kt:122 */
  141    220   
    }
         221  +
    /* UnionGenerator.kt:111 */
  142    222   
}
         223  +
/* PythonServerUnionGenerator.kt:58 */
  143    224   
#[pyo3::pyclass(name = "SomeUnion")]
         225  +
/* RustType.kt:516 */
  144    226   
#[derive(
  145    227   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  146    228   
)]
  147         -
pub struct PyUnionMarkerSomeUnion(pub SomeUnion);
         229  +
pub /* PythonServerUnionGenerator.kt:61 */ struct PyUnionMarkerSomeUnion(pub SomeUnion);
         230  +
/* RustType.kt:516 */
  148    231   
#[::pyo3::pymethods]
         232  +
/* PythonServerUnionGenerator.kt:66 */
  149    233   
impl PyUnionMarkerSomeUnion {
         234  +
    /* RustType.kt:516 */
  150    235   
    #[staticmethod]
         236  +
    /* PythonServerUnionGenerator.kt:134 */
  151    237   
    /// Creates a new union instance of [`Option`](crate::model::SomeUnion::Option)
         238  +
    /* PythonServerUnionGenerator.kt:138 */
  152    239   
    /// :param data naming_test_structs.model.Option:
         240  +
    /* PythonServerUnionGenerator.kt:139 */
  153    241   
    /// :rtype SomeUnion:
         242  +
    /* PythonServerUnionGenerator.kt:140 */
  154    243   
    pub fn option(data: crate::model::Option) -> Self {
         244  +
        /* PythonServerUnionGenerator.kt:141 */
  155    245   
        Self(SomeUnion::Option(data))
         246  +
        /* PythonServerUnionGenerator.kt:140 */
  156    247   
    }
         248  +
    /* PythonServerUnionGenerator.kt:176 */
  157    249   
    /// Tries to convert the enum instance into [`Option`](crate::model::SomeUnion::Option), extracting the inner [`Option`](crate::model::Option).
         250  +
    /* PythonServerUnionGenerator.kt:181 */
  158    251   
    /// :rtype naming_test_structs.model.Option:
         252  +
    /* PythonServerUnionGenerator.kt:182 */
  159    253   
    pub fn as_option(&self) -> ::pyo3::PyResult<crate::model::Option> {
         254  +
        /* PythonServerUnionGenerator.kt:190 */
  160    255   
        match self.0.as_option() {
  161    256   
            Ok(variant) => Ok(variant.clone()),
  162    257   
            Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
  163    258   
                r"SomeUnion variant is not of type naming_test_structs.model.Option",
  164    259   
            )),
  165    260   
        }
         261  +
        /* PythonServerUnionGenerator.kt:182 */
  166    262   
    }
         263  +
    /* PythonServerUnionGenerator.kt:76 */
  167    264   
    /// Returns true if this is a [`Option`](crate::model::SomeUnion::Option).
         265  +
    /* PythonServerUnionGenerator.kt:77 */
  168    266   
    /// :rtype bool:
         267  +
    /* PythonServerUnionGenerator.kt:78 */
  169    268   
    pub fn is_option(&self) -> bool {
         269  +
        /* PythonServerUnionGenerator.kt:79 */
  170    270   
        self.0.is_option()
         271  +
        /* PythonServerUnionGenerator.kt:78 */
  171    272   
    }
         273  +
    /* RustType.kt:516 */
  172    274   
    #[staticmethod]
         275  +
    /* PythonServerUnionGenerator.kt:134 */
  173    276   
    /// Creates a new union instance of [`Result`](crate::model::SomeUnion::Result)
         277  +
    /* PythonServerUnionGenerator.kt:138 */
  174    278   
    /// :param data naming_test_structs.model.Result:
         279  +
    /* PythonServerUnionGenerator.kt:139 */
  175    280   
    /// :rtype SomeUnion:
         281  +
    /* PythonServerUnionGenerator.kt:140 */
  176    282   
    pub fn result(data: crate::model::Result) -> Self {
         283  +
        /* PythonServerUnionGenerator.kt:141 */
  177    284   
        Self(SomeUnion::Result(data))
         285  +
        /* PythonServerUnionGenerator.kt:140 */
  178    286   
    }
         287  +
    /* PythonServerUnionGenerator.kt:176 */
  179    288   
    /// Tries to convert the enum instance into [`Result`](crate::model::SomeUnion::Result), extracting the inner [`Result`](crate::model::Result).
         289  +
    /* PythonServerUnionGenerator.kt:181 */
  180    290   
    /// :rtype naming_test_structs.model.Result:
         291  +
    /* PythonServerUnionGenerator.kt:182 */
  181    292   
    pub fn as_result(&self) -> ::pyo3::PyResult<crate::model::Result> {
         293  +
        /* PythonServerUnionGenerator.kt:190 */
  182    294   
        match self.0.as_result() {
  183    295   
            Ok(variant) => Ok(variant.clone()),
  184    296   
            Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
  185    297   
                r"SomeUnion variant is not of type naming_test_structs.model.Result",
  186    298   
            )),
  187    299   
        }
         300  +
        /* PythonServerUnionGenerator.kt:182 */
  188    301   
    }
         302  +
    /* PythonServerUnionGenerator.kt:76 */
  189    303   
    /// Returns true if this is a [`Result`](crate::model::SomeUnion::Result).
         304  +
    /* PythonServerUnionGenerator.kt:77 */
  190    305   
    /// :rtype bool:
         306  +
    /* PythonServerUnionGenerator.kt:78 */
  191    307   
    pub fn is_result(&self) -> bool {
         308  +
        /* PythonServerUnionGenerator.kt:79 */
  192    309   
        self.0.is_result()
         310  +
        /* PythonServerUnionGenerator.kt:78 */
  193    311   
    }
         312  +
    /* PythonServerUnionGenerator.kt:66 */
  194    313   
}
         314  +
/* PythonServerUnionGenerator.kt:93 */
  195    315   
impl ::pyo3::IntoPy<::pyo3::PyObject> for SomeUnion {
         316  +
    /* PythonServerUnionGenerator.kt:94 */
  196    317   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
         318  +
        /* PythonServerUnionGenerator.kt:95 */
  197    319   
        PyUnionMarkerSomeUnion(self).into_py(py)
         320  +
        /* PythonServerUnionGenerator.kt:94 */
  198    321   
    }
         322  +
    /* PythonServerUnionGenerator.kt:93 */
  199    323   
}
         324  +
/* PythonServerUnionGenerator.kt:98 */
  200    325   
impl<'source> ::pyo3::FromPyObject<'source> for SomeUnion {
         326  +
    /* PythonServerUnionGenerator.kt:99 */
  201    327   
    fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
         328  +
        /* PythonServerUnionGenerator.kt:100 */
  202    329   
        let data: PyUnionMarkerSomeUnion = obj.extract()?;
  203    330   
        Ok(data.0)
         331  +
        /* PythonServerUnionGenerator.kt:99 */
  204    332   
    }
         333  +
    /* PythonServerUnionGenerator.kt:98 */
  205    334   
}
  206    335   
         336  +
/* RustType.kt:516 */
  207    337   
#[::pyo3::pyclass]
         338  +
/* PythonServerStructureGenerator.kt:63 */
  208    339   
/// :param value typing.Optional\[str\]:
  209    340   
/// :rtype None:
         341  +
/* StructureGenerator.kt:197 */
  210    342   
#[allow(missing_docs)] // documentation missing in model
         343  +
/* RustType.kt:516 */
  211    344   
#[derive(
  212    345   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  213    346   
)]
  214         -
pub struct Option {
         347  +
pub /* StructureGenerator.kt:201 */ struct Option {
         348  +
    /* RustType.kt:516 */
  215    349   
    #[pyo3(get, set)]
         350  +
    /* PythonServerStructureGenerator.kt:80 */
  216    351   
    /// :type typing.Optional\[str\]:
         352  +
    /* StructureGenerator.kt:231 */
  217    353   
    #[allow(missing_docs)] // documentation missing in model
  218    354   
    pub value: ::std::option::Option<::std::string::String>,
         355  +
    /* StructureGenerator.kt:201 */
  219    356   
}
         357  +
/* StructureGenerator.kt:135 */
  220    358   
impl Option {
         359  +
    /* StructureGenerator.kt:231 */
  221    360   
    #[allow(missing_docs)] // documentation missing in model
         361  +
                           /* StructureGenerator.kt:166 */
  222    362   
    pub fn value(&self) -> ::std::option::Option<&str> {
         363  +
        /* StructureGenerator.kt:169 */
  223    364   
        self.value.as_deref()
         365  +
        /* StructureGenerator.kt:166 */
  224    366   
    }
         367  +
    /* StructureGenerator.kt:135 */
  225    368   
}
         369  +
/* RustType.kt:516 */
  226    370   
#[allow(clippy::new_without_default)]
         371  +
/* RustType.kt:516 */
  227    372   
#[allow(clippy::too_many_arguments)]
         373  +
/* RustType.kt:516 */
  228    374   
#[::pyo3::pymethods]
         375  +
/* PythonServerStructureGenerator.kt:88 */
  229    376   
impl Option {
  230    377   
    #[new]
  231    378   
    pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
  232    379   
        Self { value }
  233    380   
    }
  234    381   
    fn __repr__(&self) -> String {
  235    382   
        format!("{self:?}")
  236    383   
    }
  237    384   
    fn __str__(&self) -> String {
  238    385   
        format!("{self:?}")
  239    386   
    }
  240    387   
}
         388  +
/* PythonServerStructureGenerator.kt:111 */
  241    389   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Option> {
  242    390   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  243    391   
        ob.extract::<Option>().map(Box::new)
  244    392   
    }
  245    393   
}
  246    394   
  247    395   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Option> {
  248    396   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  249    397   
        (*self).into_py(py)
  250    398   
    }
  251    399   
}
         400  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  252    401   
impl crate::constrained::Constrained for crate::model::Option {
  253    402   
    type Unconstrained = crate::model::option_internal::Builder;
  254    403   
}
         404  +
/* ServerCodegenVisitor.kt:370 */
  255    405   
impl Option {
  256         -
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
         406  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
         407  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  257    408   
    pub fn builder() -> crate::model::option::Builder {
         409  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  258    410   
        crate::model::option::Builder::default()
         411  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  259    412   
    }
         413  +
    /* ServerCodegenVisitor.kt:370 */
  260    414   
}
  261    415   
         416  +
/* RustType.kt:516 */
  262    417   
#[::pyo3::pyclass]
         418  +
/* PythonServerStructureGenerator.kt:63 */
  263    419   
/// :param value typing.Optional\[str\]:
  264    420   
/// :rtype None:
         421  +
/* StructureGenerator.kt:197 */
  265    422   
#[allow(missing_docs)] // documentation missing in model
         423  +
/* RustType.kt:516 */
  266    424   
#[derive(
  267    425   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  268    426   
)]
  269         -
pub struct Result {
         427  +
pub /* StructureGenerator.kt:201 */ struct Result {
         428  +
    /* RustType.kt:516 */
  270    429   
    #[pyo3(get, set)]
         430  +
    /* PythonServerStructureGenerator.kt:80 */
  271    431   
    /// :type typing.Optional\[str\]:
         432  +
    /* StructureGenerator.kt:231 */
  272    433   
    #[allow(missing_docs)] // documentation missing in model
  273    434   
    pub value: ::std::option::Option<::std::string::String>,
         435  +
    /* StructureGenerator.kt:201 */
  274    436   
}
         437  +
/* StructureGenerator.kt:135 */
  275    438   
impl Result {
         439  +
    /* StructureGenerator.kt:231 */
  276    440   
    #[allow(missing_docs)] // documentation missing in model
         441  +
                           /* StructureGenerator.kt:166 */
  277    442   
    pub fn value(&self) -> ::std::option::Option<&str> {
         443  +
        /* StructureGenerator.kt:169 */
  278    444   
        self.value.as_deref()
         445  +
        /* StructureGenerator.kt:166 */
  279    446   
    }
         447  +
    /* StructureGenerator.kt:135 */
  280    448   
}
         449  +
/* RustType.kt:516 */
  281    450   
#[allow(clippy::new_without_default)]
         451  +
/* RustType.kt:516 */
  282    452   
#[allow(clippy::too_many_arguments)]
         453  +
/* RustType.kt:516 */
  283    454   
#[::pyo3::pymethods]
         455  +
/* PythonServerStructureGenerator.kt:88 */
  284    456   
impl Result {
  285    457   
    #[new]
  286    458   
    pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
  287    459   
        Self { value }
  288    460   
    }
  289    461   
    fn __repr__(&self) -> String {
  290    462   
        format!("{self:?}")
  291    463   
    }
  292    464   
    fn __str__(&self) -> String {
  293    465   
        format!("{self:?}")
  294    466   
    }
  295    467   
}
         468  +
/* PythonServerStructureGenerator.kt:111 */
  296    469   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Result> {
  297    470   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
  298    471   
        ob.extract::<Result>().map(Box::new)
  299    472   
    }
  300    473   
}
  301    474   
  302    475   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Result> {
  303    476   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
  304    477   
        (*self).into_py(py)
  305    478   
    }
  306    479   
}
         480  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  307    481   
impl crate::constrained::Constrained for crate::model::Result {
  308    482   
    type Unconstrained = crate::model::result_internal::Builder;
  309    483   
}
         484  +
/* ServerCodegenVisitor.kt:370 */
  310    485   
impl Result {
  311         -
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
         486  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
         487  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  312    488   
    pub fn builder() -> crate::model::result::Builder {
         489  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
  313    490   
        crate::model::result::Builder::default()
         491  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
  314    492   
    }
         493  +
    /* ServerCodegenVisitor.kt:370 */
  315    494   
}
  316         -
/// See [`SomethingElse`](crate::model::SomethingElse).
         495  +
/// /* ServerBuilderGenerator.kt:171 */See [`SomethingElse`](crate::model::SomethingElse).
  317    496   
pub(crate) mod something_else_internal {
  318    497   
         498  +
    /* ServerBuilderGenerator.kt:461 */
  319    499   
    impl ::std::convert::From<Builder> for crate::model::SomethingElse {
  320    500   
        fn from(builder: Builder) -> Self {
  321    501   
            builder.build()
  322    502   
        }
  323    503   
    }
  324         -
    /// A builder for [`SomethingElse`](crate::model::SomethingElse).
         504  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`SomethingElse`](crate::model::SomethingElse).
         505  +
    /* RustType.kt:516 */
  325    506   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         507  +
    /* ServerBuilderGenerator.kt:211 */
  326    508   
    pub(crate) struct Builder {
         509  +
        /* ServerBuilderGenerator.kt:308 */
  327    510   
        pub(crate) result: ::std::option::Option<crate::model::Result>,
         511  +
        /* ServerBuilderGenerator.kt:308 */
  328    512   
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         513  +
        /* ServerBuilderGenerator.kt:308 */
  329    514   
        pub(crate) option: ::std::option::Option<crate::model::Option>,
         515  +
        /* ServerBuilderGenerator.kt:308 */
  330    516   
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         517  +
        /* ServerBuilderGenerator.kt:308 */
  331    518   
        pub(crate) some_union: ::std::option::Option<crate::model::SomeUnion>,
         519  +
        /* ServerBuilderGenerator.kt:211 */
  332    520   
    }
         521  +
    /* ServerBuilderGenerator.kt:215 */
  333    522   
    impl Builder {
         523  +
        /* ServerBuilderGenerator.kt:426 */
  334    524   
        #[allow(missing_docs)] // documentation missing in model
         525  +
                               /* ServerBuilderGenerator.kt:428 */
  335    526   
        pub(crate) fn set_result(
  336    527   
            mut self,
  337    528   
            input: Option<impl ::std::convert::Into<crate::model::Result>>,
  338    529   
        ) -> Self {
         530  +
            /* ServerBuilderGenerator.kt:429 */
  339    531   
            self.result = input.map(|v| v.into());
  340    532   
            self
         533  +
            /* ServerBuilderGenerator.kt:428 */
  341    534   
        }
         535  +
        /* ServerBuilderGenerator.kt:426 */
  342    536   
        #[allow(missing_docs)] // documentation missing in model
         537  +
                               /* ServerBuilderGenerator.kt:428 */
  343    538   
        pub(crate) fn set_result_list(
  344    539   
            mut self,
  345    540   
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
  346    541   
        ) -> Self {
         542  +
            /* ServerBuilderGenerator.kt:429 */
  347    543   
            self.result_list = input.map(|v| v.into());
  348    544   
            self
         545  +
            /* ServerBuilderGenerator.kt:428 */
  349    546   
        }
         547  +
        /* ServerBuilderGenerator.kt:426 */
  350    548   
        #[allow(missing_docs)] // documentation missing in model
         549  +
                               /* ServerBuilderGenerator.kt:428 */
  351    550   
        pub(crate) fn set_option(
  352    551   
            mut self,
  353    552   
            input: Option<impl ::std::convert::Into<crate::model::Option>>,
  354    553   
        ) -> Self {
         554  +
            /* ServerBuilderGenerator.kt:429 */
  355    555   
            self.option = input.map(|v| v.into());
  356    556   
            self
         557  +
            /* ServerBuilderGenerator.kt:428 */
  357    558   
        }
         559  +
        /* ServerBuilderGenerator.kt:426 */
  358    560   
        #[allow(missing_docs)] // documentation missing in model
         561  +
                               /* ServerBuilderGenerator.kt:428 */
  359    562   
        pub(crate) fn set_option_list(
  360    563   
            mut self,
  361    564   
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
  362    565   
        ) -> Self {
         566  +
            /* ServerBuilderGenerator.kt:429 */
  363    567   
            self.option_list = input.map(|v| v.into());
  364    568   
            self
         569  +
            /* ServerBuilderGenerator.kt:428 */
  365    570   
        }
         571  +
        /* ServerBuilderGenerator.kt:426 */
  366    572   
        #[allow(missing_docs)] // documentation missing in model
         573  +
                               /* ServerBuilderGenerator.kt:428 */
  367    574   
        pub(crate) fn set_some_union(
  368    575   
            mut self,
  369    576   
            input: Option<impl ::std::convert::Into<crate::model::SomeUnion>>,
  370    577   
        ) -> Self {
         578  +
            /* ServerBuilderGenerator.kt:429 */
  371    579   
            self.some_union = input.map(|v| v.into());
  372    580   
            self
         581  +
            /* ServerBuilderGenerator.kt:428 */
  373    582   
        }
  374         -
        /// Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
         583  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
         584  +
        /* ServerBuilderGenerator.kt:271 */
  375    585   
        pub fn build(self) -> crate::model::SomethingElse {
  376    586   
            self.build_enforcing_all_constraints()
  377    587   
        }
         588  +
        /* ServerBuilderGenerator.kt:283 */
  378    589   
        fn build_enforcing_all_constraints(self) -> crate::model::SomethingElse {
         590  +
            /* ServerBuilderGenerator.kt:542 */
  379    591   
            crate::model::SomethingElse {
         592  +
                /* ServerBuilderGenerator.kt:546 */
  380    593   
                result: self.result,
         594  +
                /* ServerBuilderGenerator.kt:546 */
  381    595   
                result_list: self.result_list,
         596  +
                /* ServerBuilderGenerator.kt:546 */
  382    597   
                option: self.option,
         598  +
                /* ServerBuilderGenerator.kt:546 */
  383    599   
                option_list: self.option_list,
         600  +
                /* ServerBuilderGenerator.kt:546 */
  384    601   
                some_union: self.some_union,
         602  +
                /* ServerBuilderGenerator.kt:542 */
  385    603   
            }
         604  +
            /* ServerBuilderGenerator.kt:283 */
  386    605   
        }
         606  +
        /* ServerBuilderGenerator.kt:215 */
  387    607   
    }
         608  +
         609  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  388    610   
}
  389         -
/// See [`SomethingElse`](crate::model::SomethingElse).
         611  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`SomethingElse`](crate::model::SomethingElse).
  390    612   
pub mod something_else {
  391    613   
         614  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  392    615   
    impl ::std::convert::From<Builder> for crate::model::SomethingElse {
  393    616   
        fn from(builder: Builder) -> Self {
  394    617   
            builder.build()
  395    618   
        }
  396    619   
    }
  397         -
    /// A builder for [`SomethingElse`](crate::model::SomethingElse).
         620  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`SomethingElse`](crate::model::SomethingElse).
         621  +
    /* RustType.kt:516 */
  398    622   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         623  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  399    624   
    pub struct Builder {
         625  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  400    626   
        pub(crate) result: ::std::option::Option<crate::model::Result>,
         627  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  401    628   
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         629  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  402    630   
        pub(crate) option: ::std::option::Option<crate::model::Option>,
         631  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  403    632   
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         633  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  404    634   
        pub(crate) some_union: ::std::option::Option<crate::model::SomeUnion>,
         635  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  405    636   
    }
         637  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  406    638   
    impl Builder {
         639  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  407    640   
        #[allow(missing_docs)] // documentation missing in model
         641  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  408    642   
        pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
  409         -
            self.result = input;
         643  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         644  +
            self.result =
         645  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         646  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  410    647   
            self
         648  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  411    649   
        }
         650  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  412    651   
        #[allow(missing_docs)] // documentation missing in model
         652  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  413    653   
        pub fn result_list(
  414    654   
            mut self,
  415    655   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  416    656   
        ) -> Self {
  417         -
            self.result_list = input;
         657  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         658  +
            self.result_list =
         659  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         660  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  418    661   
            self
         662  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  419    663   
        }
         664  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  420    665   
        #[allow(missing_docs)] // documentation missing in model
         666  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  421    667   
        pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
  422         -
            self.option = input;
         668  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         669  +
            self.option =
         670  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         671  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  423    672   
            self
         673  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  424    674   
        }
         675  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  425    676   
        #[allow(missing_docs)] // documentation missing in model
         677  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  426    678   
        pub fn option_list(
  427    679   
            mut self,
  428    680   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  429    681   
        ) -> Self {
  430         -
            self.option_list = input;
         682  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         683  +
            self.option_list =
         684  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         685  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  431    686   
            self
         687  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  432    688   
        }
         689  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  433    690   
        #[allow(missing_docs)] // documentation missing in model
         691  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  434    692   
        pub fn some_union(mut self, input: ::std::option::Option<crate::model::SomeUnion>) -> Self {
  435         -
            self.some_union = input;
         693  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         694  +
            self.some_union =
         695  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         696  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  436    697   
            self
         698  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  437    699   
        }
  438         -
        /// Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
         700  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
         701  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  439    702   
        pub fn build(self) -> crate::model::SomethingElse {
  440    703   
            self.build_enforcing_required_and_enum_traits()
  441    704   
        }
         705  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  442    706   
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::SomethingElse {
         707  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  443    708   
            crate::model::SomethingElse {
         709  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  444    710   
                result: self.result,
         711  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  445    712   
                result_list: self.result_list,
         713  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  446    714   
                option: self.option,
         715  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  447    716   
                option_list: self.option_list,
         717  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  448    718   
                some_union: self.some_union,
         719  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  449    720   
            }
         721  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  450    722   
        }
         723  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  451    724   
    }
         725  +
         726  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  452    727   
}
  453         -
/// See [`Option`](crate::model::Option).
         728  +
/// /* ServerBuilderGenerator.kt:171 */See [`Option`](crate::model::Option).
  454    729   
pub(crate) mod option_internal {
  455    730   
         731  +
    /* ServerBuilderGenerator.kt:461 */
  456    732   
    impl ::std::convert::From<Builder> for crate::model::Option {
  457    733   
        fn from(builder: Builder) -> Self {
  458    734   
            builder.build()
  459    735   
        }
  460    736   
    }
  461         -
    /// A builder for [`Option`](crate::model::Option).
         737  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`Option`](crate::model::Option).
         738  +
    /* RustType.kt:516 */
  462    739   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         740  +
    /* ServerBuilderGenerator.kt:211 */
  463    741   
    pub(crate) struct Builder {
         742  +
        /* ServerBuilderGenerator.kt:308 */
  464    743   
        pub(crate) value: ::std::option::Option<::std::string::String>,
         744  +
        /* ServerBuilderGenerator.kt:211 */
  465    745   
    }
         746  +
    /* ServerBuilderGenerator.kt:215 */
  466    747   
    impl Builder {
         748  +
        /* ServerBuilderGenerator.kt:426 */
  467    749   
        #[allow(missing_docs)] // documentation missing in model
         750  +
                               /* ServerBuilderGenerator.kt:428 */
  468    751   
        pub(crate) fn set_value(
  469    752   
            mut self,
  470    753   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  471    754   
        ) -> Self {
         755  +
            /* ServerBuilderGenerator.kt:429 */
  472    756   
            self.value = input.map(|v| v.into());
  473    757   
            self
         758  +
            /* ServerBuilderGenerator.kt:428 */
  474    759   
        }
  475         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         760  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Option`](crate::model::Option).
         761  +
        /* ServerBuilderGenerator.kt:271 */
  476    762   
        pub fn build(self) -> crate::model::Option {
  477    763   
            self.build_enforcing_all_constraints()
  478    764   
        }
         765  +
        /* ServerBuilderGenerator.kt:283 */
  479    766   
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
  480         -
            crate::model::Option { value: self.value }
         767  +
            /* ServerBuilderGenerator.kt:542 */
         768  +
            crate::model::Option {
         769  +
                /* ServerBuilderGenerator.kt:546 */
         770  +
                value: self.value,
         771  +
                /* ServerBuilderGenerator.kt:542 */
         772  +
            }
         773  +
            /* ServerBuilderGenerator.kt:283 */
  481    774   
        }
         775  +
        /* ServerBuilderGenerator.kt:215 */
  482    776   
    }
         777  +
         778  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  483    779   
}
  484         -
/// See [`Option`](crate::model::Option).
         780  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`Option`](crate::model::Option).
  485    781   
pub mod option {
  486    782   
         783  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  487    784   
    impl ::std::convert::From<Builder> for crate::model::Option {
  488    785   
        fn from(builder: Builder) -> Self {
  489    786   
            builder.build()
  490    787   
        }
  491    788   
    }
  492         -
    /// A builder for [`Option`](crate::model::Option).
         789  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`Option`](crate::model::Option).
         790  +
    /* RustType.kt:516 */
  493    791   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         792  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  494    793   
    pub struct Builder {
         794  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  495    795   
        pub(crate) value: ::std::option::Option<::std::string::String>,
         796  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  496    797   
    }
         798  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  497    799   
    impl Builder {
         800  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  498    801   
        #[allow(missing_docs)] // documentation missing in model
         802  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  499    803   
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  500         -
            self.value = input;
         804  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         805  +
            self.value =
         806  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         807  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  501    808   
            self
         809  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  502    810   
        }
  503         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         811  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`Option`](crate::model::Option).
         812  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  504    813   
        pub fn build(self) -> crate::model::Option {
  505    814   
            self.build_enforcing_required_and_enum_traits()
  506    815   
        }
         816  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  507    817   
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Option {
  508         -
            crate::model::Option { value: self.value }
         818  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         819  +
            crate::model::Option {
         820  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
         821  +
                value: self.value,
         822  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         823  +
            }
         824  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  509    825   
        }
         826  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  510    827   
    }
         828  +
         829  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  511    830   
}
  512         -
/// See [`Result`](crate::model::Result).
         831  +
/// /* ServerBuilderGenerator.kt:171 */See [`Result`](crate::model::Result).
  513    832   
pub(crate) mod result_internal {
  514    833   
         834  +
    /* ServerBuilderGenerator.kt:461 */
  515    835   
    impl ::std::convert::From<Builder> for crate::model::Result {
  516    836   
        fn from(builder: Builder) -> Self {
  517    837   
            builder.build()
  518    838   
        }
  519    839   
    }
  520         -
    /// A builder for [`Result`](crate::model::Result).
         840  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`Result`](crate::model::Result).
         841  +
    /* RustType.kt:516 */
  521    842   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         843  +
    /* ServerBuilderGenerator.kt:211 */
  522    844   
    pub(crate) struct Builder {
         845  +
        /* ServerBuilderGenerator.kt:308 */
  523    846   
        pub(crate) value: ::std::option::Option<::std::string::String>,
         847  +
        /* ServerBuilderGenerator.kt:211 */
  524    848   
    }
         849  +
    /* ServerBuilderGenerator.kt:215 */
  525    850   
    impl Builder {
         851  +
        /* ServerBuilderGenerator.kt:426 */
  526    852   
        #[allow(missing_docs)] // documentation missing in model
         853  +
                               /* ServerBuilderGenerator.kt:428 */
  527    854   
        pub(crate) fn set_value(
  528    855   
            mut self,
  529    856   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  530    857   
        ) -> Self {
         858  +
            /* ServerBuilderGenerator.kt:429 */
  531    859   
            self.value = input.map(|v| v.into());
  532    860   
            self
         861  +
            /* ServerBuilderGenerator.kt:428 */
  533    862   
        }
  534         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         863  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Result`](crate::model::Result).
         864  +
        /* ServerBuilderGenerator.kt:271 */
  535    865   
        pub fn build(self) -> crate::model::Result {
  536    866   
            self.build_enforcing_all_constraints()
  537    867   
        }
         868  +
        /* ServerBuilderGenerator.kt:283 */
  538    869   
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
  539         -
            crate::model::Result { value: self.value }
         870  +
            /* ServerBuilderGenerator.kt:542 */
         871  +
            crate::model::Result {
         872  +
                /* ServerBuilderGenerator.kt:546 */
         873  +
                value: self.value,
         874  +
                /* ServerBuilderGenerator.kt:542 */
         875  +
            }
         876  +
            /* ServerBuilderGenerator.kt:283 */
  540    877   
        }
         878  +
        /* ServerBuilderGenerator.kt:215 */
  541    879   
    }
         880  +
         881  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  542    882   
}
  543         -
/// See [`Result`](crate::model::Result).
         883  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`Result`](crate::model::Result).
  544    884   
pub mod result {
  545    885   
         886  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  546    887   
    impl ::std::convert::From<Builder> for crate::model::Result {
  547    888   
        fn from(builder: Builder) -> Self {
  548    889   
            builder.build()
  549    890   
        }
  550    891   
    }
  551         -
    /// A builder for [`Result`](crate::model::Result).
         892  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`Result`](crate::model::Result).
         893  +
    /* RustType.kt:516 */
  552    894   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         895  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  553    896   
    pub struct Builder {
         897  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  554    898   
        pub(crate) value: ::std::option::Option<::std::string::String>,
         899  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  555    900   
    }
         901  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  556    902   
    impl Builder {
         903  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  557    904   
        #[allow(missing_docs)] // documentation missing in model
         905  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  558    906   
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  559         -
            self.value = input;
         907  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         908  +
            self.value =
         909  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         910  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  560    911   
            self
         912  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  561    913   
        }
  562         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         914  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`Result`](crate::model::Result).
         915  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  563    916   
        pub fn build(self) -> crate::model::Result {
  564    917   
            self.build_enforcing_required_and_enum_traits()
  565    918   
        }
         919  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  566    920   
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::Result {
  567         -
            crate::model::Result { value: self.value }
         921  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         922  +
            crate::model::Result {
         923  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
         924  +
                value: self.value,
         925  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
         926  +
            }
         927  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  568    928   
        }
         929  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  569    930   
    }
         931  +
         932  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  570    933   
}

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/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_STRUCTS: 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   
    /// [`StructsInput`](crate::input::StructsInput) using modelled bindings.
   10     11   
    pub struct StructsInputFuture {
   11     12   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StructsInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -40,41 +116,119 @@
   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   
        StructsInputFuture {
   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::StructsOutput
   74     76   
{
   75     77   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   76     78   
        match crate::protocol_serde::shape_structs::ser_structs_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::StructsError
   95     98   
{
   96     99   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   97    100   
        match crate::protocol_serde::shape_structs::ser_structs_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()),

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

@@ -1,1 +0,32 @@
    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 Structs;
    4      6   
    5      7   
impl ::aws_smithy_http_server::operation::OperationShape for Structs {
    6      8   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7      9   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
    8     10   
            "naming_obs_structs#Structs",
    9     11   
            "naming_obs_structs",
   10     12   
            "Structs",
   11     13   
        );
   12     14   
   13     15   
    type Input = crate::input::StructsInput;
   14     16   
    type Output = crate::output::StructsOutput;
   15     17   
    type Error = crate::error::StructsError;
   16     18   
}
   17     19   
   18     20   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Structs {
   19     21   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   20     22   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   21     23   
   22     24   
    fn request_fmt() -> Self::RequestFmt {
   23     25   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   24     26   
    }
   25     27   
   26     28   
    fn response_fmt() -> Self::ResponseFmt {
   27     29   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   28     30   
    }
   29     31   
}
          32  +
/* ServerOperationGenerator.kt:88 */

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

@@ -1,1 +167,272 @@
    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 result typing.Optional\[naming_test_structs.model.Result\]:
    4      6   
/// :param result_list typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
    5      7   
/// :param option typing.Optional\[naming_test_structs.model.Option\]:
    6      8   
/// :param option_list typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
    7      9   
/// :param something_else typing.Optional\[naming_test_structs.model.SomethingElse\]:
    8     10   
/// :rtype None:
          11  +
/* StructureGenerator.kt:197 */
    9     12   
#[allow(missing_docs)] // documentation missing in model
          13  +
/* RustType.kt:516 */
   10     14   
#[derive(
   11     15   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   12     16   
)]
   13         -
pub struct StructsOutput {
          17  +
pub /* StructureGenerator.kt:201 */ struct StructsOutput {
          18  +
    /* RustType.kt:516 */
   14     19   
    #[pyo3(get, set)]
          20  +
    /* PythonServerStructureGenerator.kt:80 */
   15     21   
    /// :type typing.Optional\[naming_test_structs.model.Result\]:
          22  +
    /* StructureGenerator.kt:231 */
   16     23   
    #[allow(missing_docs)] // documentation missing in model
   17     24   
    pub result: ::std::option::Option<crate::model::Result>,
          25  +
    /* RustType.kt:516 */
   18     26   
    #[pyo3(get, set)]
          27  +
    /* PythonServerStructureGenerator.kt:80 */
   19     28   
    /// :type typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
          29  +
    /* StructureGenerator.kt:231 */
   20     30   
    #[allow(missing_docs)] // documentation missing in model
   21     31   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          32  +
    /* RustType.kt:516 */
   22     33   
    #[pyo3(get, set)]
          34  +
    /* PythonServerStructureGenerator.kt:80 */
   23     35   
    /// :type typing.Optional\[naming_test_structs.model.Option\]:
          36  +
    /* StructureGenerator.kt:231 */
   24     37   
    #[allow(missing_docs)] // documentation missing in model
   25     38   
    pub option: ::std::option::Option<crate::model::Option>,
          39  +
    /* RustType.kt:516 */
   26     40   
    #[pyo3(get, set)]
          41  +
    /* PythonServerStructureGenerator.kt:80 */
   27     42   
    /// :type typing.Optional\[typing.List\[naming_test_structs.model.Result\]\]:
          43  +
    /* StructureGenerator.kt:231 */
   28     44   
    #[allow(missing_docs)] // documentation missing in model
   29     45   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          46  +
    /* RustType.kt:516 */
   30     47   
    #[pyo3(get, set)]
          48  +
    /* PythonServerStructureGenerator.kt:80 */
   31     49   
    /// :type typing.Optional\[naming_test_structs.model.SomethingElse\]:
          50  +
    /* StructureGenerator.kt:231 */
   32     51   
    #[allow(missing_docs)] // documentation missing in model
   33     52   
    pub something_else: ::std::option::Option<crate::model::SomethingElse>,
          53  +
    /* StructureGenerator.kt:201 */
   34     54   
}
          55  +
/* StructureGenerator.kt:135 */
   35     56   
impl StructsOutput {
          57  +
    /* StructureGenerator.kt:231 */
   36     58   
    #[allow(missing_docs)] // documentation missing in model
          59  +
                           /* StructureGenerator.kt:166 */
   37     60   
    pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
          61  +
        /* StructureGenerator.kt:170 */
   38     62   
        self.result.as_ref()
          63  +
        /* StructureGenerator.kt:166 */
   39     64   
    }
          65  +
    /* StructureGenerator.kt:231 */
   40     66   
    #[allow(missing_docs)] // documentation missing in model
          67  +
                           /* StructureGenerator.kt:166 */
   41     68   
    pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          69  +
        /* StructureGenerator.kt:169 */
   42     70   
        self.result_list.as_deref()
          71  +
        /* StructureGenerator.kt:166 */
   43     72   
    }
          73  +
    /* StructureGenerator.kt:231 */
   44     74   
    #[allow(missing_docs)] // documentation missing in model
          75  +
                           /* StructureGenerator.kt:166 */
   45     76   
    pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
          77  +
        /* StructureGenerator.kt:170 */
   46     78   
        self.option.as_ref()
          79  +
        /* StructureGenerator.kt:166 */
   47     80   
    }
          81  +
    /* StructureGenerator.kt:231 */
   48     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* StructureGenerator.kt:166 */
   49     84   
    pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          85  +
        /* StructureGenerator.kt:169 */
   50     86   
        self.option_list.as_deref()
          87  +
        /* StructureGenerator.kt:166 */
   51     88   
    }
          89  +
    /* StructureGenerator.kt:231 */
   52     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* StructureGenerator.kt:166 */
   53     92   
    pub fn something_else(&self) -> ::std::option::Option<&crate::model::SomethingElse> {
          93  +
        /* StructureGenerator.kt:170 */
   54     94   
        self.something_else.as_ref()
          95  +
        /* StructureGenerator.kt:166 */
   55     96   
    }
          97  +
    /* StructureGenerator.kt:135 */
   56     98   
}
          99  +
/* RustType.kt:516 */
   57    100   
#[allow(clippy::new_without_default)]
         101  +
/* RustType.kt:516 */
   58    102   
#[allow(clippy::too_many_arguments)]
         103  +
/* RustType.kt:516 */
   59    104   
#[::pyo3::pymethods]
         105  +
/* PythonServerStructureGenerator.kt:88 */
   60    106   
impl StructsOutput {
   61    107   
    #[new]
   62    108   
    pub fn new(
   63    109   
        result: ::std::option::Option<crate::model::Result>,
   64    110   
        result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   65    111   
        option: ::std::option::Option<crate::model::Option>,
   66    112   
        option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   67    113   
        something_else: ::std::option::Option<crate::model::SomethingElse>,
   68    114   
    ) -> Self {
   69    115   
        Self {
   70    116   
            result,
   71    117   
            result_list,
   72    118   
            option,
   73    119   
            option_list,
   74    120   
            something_else,
   75    121   
        }
   76    122   
    }
   77    123   
    fn __repr__(&self) -> String {
   78    124   
        format!("{self:?}")
   79    125   
    }
   80    126   
    fn __str__(&self) -> String {
   81    127   
        format!("{self:?}")
   82    128   
    }
   83    129   
}
         130  +
/* PythonServerStructureGenerator.kt:111 */
   84    131   
impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructsOutput> {
   85    132   
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
   86    133   
        ob.extract::<StructsOutput>().map(Box::new)
   87    134   
    }
   88    135   
}
   89    136   
   90    137   
impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructsOutput> {
   91    138   
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
   92    139   
        (*self).into_py(py)
   93    140   
    }
   94    141   
}
         142  +
/* ServerCodegenVisitor.kt:370 */
   95    143   
impl StructsOutput {
   96         -
    /// Creates a new builder-style object to manufacture [`StructsOutput`](crate::output::StructsOutput).
         144  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`StructsOutput`](crate::output::StructsOutput).
         145  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   97    146   
    pub fn builder() -> crate::output::structs_output::Builder {
         147  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
   98    148   
        crate::output::structs_output::Builder::default()
         149  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
   99    150   
    }
         151  +
    /* ServerCodegenVisitor.kt:370 */
  100    152   
}
  101         -
/// See [`StructsOutput`](crate::output::StructsOutput).
         153  +
/// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`StructsOutput`](crate::output::StructsOutput).
  102    154   
pub mod structs_output {
  103    155   
         156  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
  104    157   
    impl ::std::convert::From<Builder> for crate::output::StructsOutput {
  105    158   
        fn from(builder: Builder) -> Self {
  106    159   
            builder.build()
  107    160   
        }
  108    161   
    }
  109         -
    /// A builder for [`StructsOutput`](crate::output::StructsOutput).
         162  +
    /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`StructsOutput`](crate::output::StructsOutput).
         163  +
    /* RustType.kt:516 */
  110    164   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         165  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  111    166   
    pub struct Builder {
         167  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  112    168   
        pub(crate) result: ::std::option::Option<crate::model::Result>,
         169  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  113    170   
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         171  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  114    172   
        pub(crate) option: ::std::option::Option<crate::model::Option>,
         173  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  115    174   
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         175  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
  116    176   
        pub(crate) something_else: ::std::option::Option<crate::model::SomethingElse>,
         177  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
  117    178   
    }
         179  +
    /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  118    180   
    impl Builder {
         181  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  119    182   
        #[allow(missing_docs)] // documentation missing in model
         183  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  120    184   
        pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
  121         -
            self.result = input;
         185  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         186  +
            self.result =
         187  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         188  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  122    189   
            self
         190  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  123    191   
        }
         192  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  124    193   
        #[allow(missing_docs)] // documentation missing in model
         194  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  125    195   
        pub fn result_list(
  126    196   
            mut self,
  127    197   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  128    198   
        ) -> Self {
  129         -
            self.result_list = input;
         199  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         200  +
            self.result_list =
         201  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         202  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  130    203   
            self
         204  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  131    205   
        }
         206  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  132    207   
        #[allow(missing_docs)] // documentation missing in model
         208  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  133    209   
        pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
  134         -
            self.option = input;
         210  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         211  +
            self.option =
         212  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         213  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  135    214   
            self
         215  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  136    216   
        }
         217  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  137    218   
        #[allow(missing_docs)] // documentation missing in model
         219  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  138    220   
        pub fn option_list(
  139    221   
            mut self,
  140    222   
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
  141    223   
        ) -> Self {
  142         -
            self.option_list = input;
         224  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         225  +
            self.option_list =
         226  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         227  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  143    228   
            self
         229  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  144    230   
        }
         231  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
  145    232   
        #[allow(missing_docs)] // documentation missing in model
         233  +
                               /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  146    234   
        pub fn something_else(
  147    235   
            mut self,
  148    236   
            input: ::std::option::Option<crate::model::SomethingElse>,
  149    237   
        ) -> Self {
  150         -
            self.something_else = input;
         238  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
         239  +
            self.something_else =
         240  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
         241  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
  151    242   
            self
         243  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
  152    244   
        }
  153         -
        /// Consumes the builder and constructs a [`StructsOutput`](crate::output::StructsOutput).
         245  +
        /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`StructsOutput`](crate::output::StructsOutput).
         246  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
  154    247   
        pub fn build(self) -> crate::output::StructsOutput {
  155    248   
            self.build_enforcing_required_and_enum_traits()
  156    249   
        }
         250  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  157    251   
        fn build_enforcing_required_and_enum_traits(self) -> crate::output::StructsOutput {
         252  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  158    253   
            crate::output::StructsOutput {
         254  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  159    255   
                result: self.result,
         256  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  160    257   
                result_list: self.result_list,
         258  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  161    259   
                option: self.option,
         260  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  162    261   
                option_list: self.option_list,
         262  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
  163    263   
                something_else: self.something_else,
         264  +
                /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
  164    265   
            }
         266  +
            /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
  165    267   
        }
         268  +
        /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
  166    269   
    }
         270  +
         271  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  167    272   
}

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

@@ -1,1 +26,27 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) mod shape_structs;
    3      3   
    4      4   
pub(crate) mod shape_internal_server_error;
    5      5   
           6  +
/* JsonParserGenerator.kt:227 */
    6      7   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
    7      8   
    if data.is_empty() {
    8      9   
        b"{}"
    9     10   
    } else {
   10     11   
        data
   11     12   
    }
   12     13   
}
   13     14   
   14     15   
pub(crate) mod shape_structs_output;
   15     16   

tmp-codegen-diff/codegen-server-test-python/naming_test_structs/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_structs/rust-server-codegen-python/src/protocol_serde/shape_option.rs

@@ -1,1 +65,95 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_option<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::Option>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::option_internal::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "value" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_value(
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                                    .transpose()?,
   33         -
                                );
          39  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                        /* JsonParserGenerator.kt:339 */)
          43  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                                /* JsonParserGenerator.kt:272 */);
          45  +
                                /* JsonParserGenerator.kt:262 */
   34     46   
                            }
   35         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   36     49   
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
   37     51   
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
   38     53   
                    other => {
   39     54   
                        return Err(
   40     55   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     56   
                                format!("expected object key or end object, found: {:?}", other),
   42     57   
                            ),
   43     58   
                        )
   44         -
                    }
          59  +
                    } /* JsonParserGenerator.kt:685 */
   45     60   
                }
          61  +
                /* JsonParserGenerator.kt:684 */
   46     62   
            }
          63  +
            /* JsonParserGenerator.kt:540 */
   47     64   
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
   48     66   
        }
   49         -
        _ => Err(
   50         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
                "expected start object or null",
   52         -
            ),
   53         -
        ),
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
          71  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          72  +
                    "expected start object or null",
          73  +
                ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   54     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   55     79   
}
   56     80   
          81  +
/* JsonSerializerGenerator.kt:358 */
   57     82   
pub fn ser_option(
   58     83   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   59     84   
    input: &crate::model::Option,
   60     85   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          86  +
    /* JsonSerializerGenerator.kt:382 */
   61     87   
    if let Some(var_1) = &input.value {
          88  +
        /* JsonSerializerGenerator.kt:423 */
   62     89   
        object.key("value").string(var_1.as_str());
          90  +
        /* JsonSerializerGenerator.kt:382 */
   63     91   
    }
          92  +
    /* JsonSerializerGenerator.kt:372 */
   64     93   
    Ok(())
          94  +
    /* JsonSerializerGenerator.kt:358 */
   65     95   
}

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

@@ -1,1 +48,74 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_option_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<crate::model::Result>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = crate::protocol_serde::shape_result::de_result(tokens)?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   28     42   
                        if let Some(value) = value {
   29     43   
                            items.push(value);
   30         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   31     47   
                            return Err(
   32     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     49   
                                    "dense list cannot contain null values",
   34     50   
                                ),
   35     51   
                            );
   36     52   
                        }
   37         -
                    }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   38     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   39     57   
            }
          58  +
            /* JsonParserGenerator.kt:446 */
   40     59   
            Ok(Some(items))
          60  +
            /* JsonParserGenerator.kt:713 */
   41     61   
        }
   42         -
        _ => Err(
   43         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
                "expected start array or null",
   45         -
            ),
   46         -
        ),
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
          66  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          67  +
                    "expected start array or null",
          68  +
                ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   47     72   
    }
          73  +
    /* JsonParserGenerator.kt:398 */
   48     74   
}

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

@@ -1,1 +65,95 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_result<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::Result>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::result_internal::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "value" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_value(
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                                    .transpose()?,
   33         -
                                );
          39  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                        /* JsonParserGenerator.kt:339 */)
          43  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                                /* JsonParserGenerator.kt:272 */);
          45  +
                                /* JsonParserGenerator.kt:262 */
   34     46   
                            }
   35         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   36     49   
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
   37     51   
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
   38     53   
                    other => {
   39     54   
                        return Err(
   40     55   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     56   
                                format!("expected object key or end object, found: {:?}", other),
   42     57   
                            ),
   43     58   
                        )
   44         -
                    }
          59  +
                    } /* JsonParserGenerator.kt:685 */
   45     60   
                }
          61  +
                /* JsonParserGenerator.kt:684 */
   46     62   
            }
          63  +
            /* JsonParserGenerator.kt:540 */
   47     64   
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
   48     66   
        }
   49         -
        _ => Err(
   50         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
                "expected start object or null",
   52         -
            ),
   53         -
        ),
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
          71  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          72  +
                    "expected start object or null",
          73  +
                ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   54     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   55     79   
}
   56     80   
          81  +
/* JsonSerializerGenerator.kt:358 */
   57     82   
pub fn ser_result(
   58     83   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   59     84   
    input: &crate::model::Result,
   60     85   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          86  +
    /* JsonSerializerGenerator.kt:382 */
   61     87   
    if let Some(var_1) = &input.value {
          88  +
        /* JsonSerializerGenerator.kt:423 */
   62     89   
        object.key("value").string(var_1.as_str());
          90  +
        /* JsonSerializerGenerator.kt:382 */
   63     91   
    }
          92  +
    /* JsonSerializerGenerator.kt:372 */
   64     93   
    Ok(())
          94  +
    /* JsonSerializerGenerator.kt:358 */
   65     95   
}

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

@@ -1,1 +48,74 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_result_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<crate::model::Result>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = crate::protocol_serde::shape_result::de_result(tokens)?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   28     42   
                        if let Some(value) = value {
   29     43   
                            items.push(value);
   30         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   31     47   
                            return Err(
   32     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     49   
                                    "dense list cannot contain null values",
   34     50   
                                ),
   35     51   
                            );
   36     52   
                        }
   37         -
                    }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   38     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   39     57   
            }
          58  +
            /* JsonParserGenerator.kt:446 */
   40     59   
            Ok(Some(items))
          60  +
            /* JsonParserGenerator.kt:713 */
   41     61   
        }
   42         -
        _ => Err(
   43         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
                "expected start array or null",
   45         -
            ),
   46         -
        ),
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
          66  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          67  +
                    "expected start array or null",
          68  +
                ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   47     72   
    }
          73  +
    /* JsonParserGenerator.kt:398 */
   48     74   
}

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

@@ -1,1 +106,162 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_some_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::SomeUnion>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19     23   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   24     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   25     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   26     34   
                        )) = tokens.peek()
   27     35   
                        {
   28     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   29     37   
                            continue;
   30     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   31     40   
                        let key = key.to_unescaped()?;
   32     41   
                        if key == "__type" {
   33     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   34     43   
                            continue;
   35     44   
                        }
   36     45   
                        if variant.is_some() {
   37     46   
                            return Err(
   38     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     48   
                                    "encountered mixed variants in union",
   40     49   
                                ),
   41     50   
                            );
   42     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   43     53   
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
   44     55   
                            "Result" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
   45     57   
                                Some(crate::model::SomeUnion::Result(
   46         -
                                    crate::protocol_serde::shape_result::de_result(tokens)?
   47         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Result' cannot be null"))?
   48         -
                                ))
          58  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          59  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Result' cannot be null"))?
          60  +
                                /* JsonParserGenerator.kt:611 */))
          61  +
                                /* JsonParserGenerator.kt:601 */
   49     62   
                            }
          63  +
                            /* JsonParserGenerator.kt:601 */
   50     64   
                            "Option" => {
          65  +
                                /* JsonParserGenerator.kt:611 */
   51     66   
                                Some(crate::model::SomeUnion::Option(
   52         -
                                    crate::protocol_serde::shape_option::de_option(tokens)?
   53         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Option' cannot be null"))?
   54         -
                                ))
          67  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_option::de_option(tokens)?
          68  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Option' cannot be null"))?
          69  +
                                /* JsonParserGenerator.kt:611 */))
          70  +
                                /* JsonParserGenerator.kt:601 */
   55     71   
                            }
   56         -
                            variant => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("unexpected union variant: {}", variant)))
          72  +
                            /* JsonParserGenerator.kt:634 */
          73  +
                            variant => {
          74  +
                                return Err(
          75  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          76  +
                                        format!("unexpected union variant: {}", variant),
          77  +
                                    ),
          78  +
                                )
          79  +
                            } /* JsonParserGenerator.kt:598 */
   57     80   
                        };
          81  +
                        /* JsonParserGenerator.kt:686 */
   58     82   
                    }
          83  +
                    /* JsonParserGenerator.kt:695 */
   59     84   
                    other => {
   60     85   
                        return Err(
   61     86   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   62     87   
                                format!("expected object key or end object, found: {:?}", other),
   63     88   
                            ),
   64     89   
                        )
   65         -
                    }
          90  +
                    } /* JsonParserGenerator.kt:685 */
   66     91   
                }
          92  +
                /* JsonParserGenerator.kt:684 */
   67     93   
            }
          94  +
            /* JsonParserGenerator.kt:568 */
   68     95   
        }
          96  +
        /* JsonParserGenerator.kt:642 */
   69     97   
        _ => {
   70     98   
            return Err(
   71     99   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   72    100   
                    "expected start object or null",
   73    101   
                ),
   74    102   
            )
   75         -
        }
         103  +
        } /* JsonParserGenerator.kt:567 */
   76    104   
    }
         105  +
    /* JsonParserGenerator.kt:649 */
   77    106   
    if variant.is_none() {
   78    107   
        return Err(
   79    108   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   80    109   
                "Union did not contain a valid variant.",
   81    110   
            ),
   82    111   
        );
   83    112   
    }
         113  +
    /* JsonParserGenerator.kt:657 */
   84    114   
    Ok(variant)
         115  +
    /* JsonParserGenerator.kt:551 */
   85    116   
}
   86    117   
         118  +
/* JsonSerializerGenerator.kt:547 */
   87    119   
pub fn ser_some_union(
   88    120   
    object_14: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   89    121   
    input: &crate::model::SomeUnion,
   90    122   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         123  +
    /* JsonSerializerGenerator.kt:556 */
   91    124   
    match input {
         125  +
        /* JsonSerializerGenerator.kt:564 */
   92    126   
        crate::model::SomeUnion::Result(inner) => {
   93         -
            #[allow(unused_mut)]
   94         -
            let mut object_1 = object_14.key("Result").start_object();
   95         -
            crate::protocol_serde::shape_result::ser_result(&mut object_1, inner)?;
   96         -
            object_1.finish();
         127  +
            /* SerializerUtil.kt:42 */
         128  +
            {
         129  +
                /* JsonSerializerGenerator.kt:495 */
         130  +
                #[allow(unused_mut)]
         131  +
                /* JsonSerializerGenerator.kt:496 */
         132  +
                let mut object_1 = object_14.key("Result").start_object();
         133  +
                /* JsonSerializerGenerator.kt:375 */
         134  +
                crate::protocol_serde::shape_result::ser_result(&mut object_1, inner)?;
         135  +
                /* JsonSerializerGenerator.kt:515 */
         136  +
                object_1.finish();
         137  +
                /* SerializerUtil.kt:42 */
         138  +
            }
         139  +
            /* JsonSerializerGenerator.kt:564 */
   97    140   
        }
         141  +
        /* JsonSerializerGenerator.kt:564 */
   98    142   
        crate::model::SomeUnion::Option(inner) => {
   99         -
            #[allow(unused_mut)]
  100         -
            let mut object_2 = object_14.key("Option").start_object();
  101         -
            crate::protocol_serde::shape_option::ser_option(&mut object_2, inner)?;
  102         -
            object_2.finish();
         143  +
            /* SerializerUtil.kt:42 */
         144  +
            {
         145  +
                /* JsonSerializerGenerator.kt:495 */
         146  +
                #[allow(unused_mut)]
         147  +
                /* JsonSerializerGenerator.kt:496 */
         148  +
                let mut object_2 = object_14.key("Option").start_object();
         149  +
                /* JsonSerializerGenerator.kt:375 */
         150  +
                crate::protocol_serde::shape_option::ser_option(&mut object_2, inner)?;
         151  +
                /* JsonSerializerGenerator.kt:515 */
         152  +
                object_2.finish();
         153  +
                /* SerializerUtil.kt:42 */
         154  +
            }
         155  +
            /* JsonSerializerGenerator.kt:564 */
  103    156   
        }
         157  +
        /* JsonSerializerGenerator.kt:556 */
  104    158   
    }
         159  +
    /* JsonSerializerGenerator.kt:576 */
  105    160   
    Ok(())
         161  +
    /* JsonSerializerGenerator.kt:547 */
  106    162   
}

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

@@ -1,1 +121,211 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_something_else<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::SomethingElse>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::something_else_internal::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key
   25         -
                        .to_unescaped()?
   26         -
                        .as_ref()
   27         -
                    {
   28         -
                        "result" => {
   29         -
                            builder = builder.set_result(
   30         -
                                crate::protocol_serde::shape_result::de_result(tokens)?,
   31         -
                            );
          32  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
          34  +
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
          36  +
                            "result" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
          38  +
                                builder = builder.set_result(
          39  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          40  +
                                /* JsonParserGenerator.kt:272 */);
          41  +
                                /* JsonParserGenerator.kt:262 */
          42  +
                            }
          43  +
                            /* JsonParserGenerator.kt:262 */
          44  +
                            "resultList" => {
          45  +
                                /* JsonParserGenerator.kt:272 */
          46  +
                                builder = builder.set_result_list(
          47  +
                                    /* JsonParserGenerator.kt:451 */
          48  +
                                    crate::protocol_serde::shape_result_list::de_result_list(
          49  +
                                        tokens,
          50  +
                                    )?, /* JsonParserGenerator.kt:272 */
          51  +
                                );
          52  +
                                /* JsonParserGenerator.kt:262 */
          53  +
                            }
          54  +
                            /* JsonParserGenerator.kt:262 */
          55  +
                            "option" => {
          56  +
                                /* JsonParserGenerator.kt:272 */
          57  +
                                builder = builder.set_option(
          58  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_option::de_option(tokens)?
          59  +
                                /* JsonParserGenerator.kt:272 */);
          60  +
                                /* JsonParserGenerator.kt:262 */
          61  +
                            }
          62  +
                            /* JsonParserGenerator.kt:262 */
          63  +
                            "optionList" => {
          64  +
                                /* JsonParserGenerator.kt:272 */
          65  +
                                builder = builder.set_option_list(
          66  +
                                    /* JsonParserGenerator.kt:451 */
          67  +
                                    crate::protocol_serde::shape_option_list::de_option_list(
          68  +
                                        tokens,
          69  +
                                    )?, /* JsonParserGenerator.kt:272 */
          70  +
                                );
          71  +
                                /* JsonParserGenerator.kt:262 */
          72  +
                            }
          73  +
                            /* JsonParserGenerator.kt:262 */
          74  +
                            "someUnion" => {
          75  +
                                /* JsonParserGenerator.kt:272 */
          76  +
                                builder =
          77  +
                                    builder.set_some_union(
          78  +
                                        /* JsonParserGenerator.kt:660 */
          79  +
                                        crate::protocol_serde::shape_some_union::de_some_union(
          80  +
                                            tokens,
          81  +
                                        )?, /* JsonParserGenerator.kt:272 */
          82  +
                                    );
          83  +
                                /* JsonParserGenerator.kt:262 */
          84  +
                            }
          85  +
                            /* JsonParserGenerator.kt:290 */
          86  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   32     87   
                        }
   33         -
                        "resultList" => {
   34         -
                            builder = builder.set_result_list(
   35         -
                                crate::protocol_serde::shape_result_list::de_result_list(tokens)?,
   36         -
                            );
   37         -
                        }
   38         -
                        "option" => {
   39         -
                            builder = builder.set_option(
   40         -
                                crate::protocol_serde::shape_option::de_option(tokens)?,
   41         -
                            );
   42         -
                        }
   43         -
                        "optionList" => {
   44         -
                            builder = builder.set_option_list(
   45         -
                                crate::protocol_serde::shape_option_list::de_option_list(tokens)?,
   46         -
                            );
   47         -
                        }
   48         -
                        "someUnion" => {
   49         -
                            builder = builder.set_some_union(
   50         -
                                crate::protocol_serde::shape_some_union::de_some_union(tokens)?,
   51         -
                            );
   52         -
                        }
   53         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   54         -
                    },
          88  +
                        /* JsonParserGenerator.kt:686 */
          89  +
                    }
          90  +
                    /* JsonParserGenerator.kt:695 */
   55     91   
                    other => {
   56     92   
                        return Err(
   57     93   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   58     94   
                                format!("expected object key or end object, found: {:?}", other),
   59     95   
                            ),
   60     96   
                        )
   61         -
                    }
          97  +
                    } /* JsonParserGenerator.kt:685 */
   62     98   
                }
          99  +
                /* JsonParserGenerator.kt:684 */
   63    100   
            }
         101  +
            /* JsonParserGenerator.kt:540 */
   64    102   
            Ok(Some(builder.build()))
         103  +
            /* JsonParserGenerator.kt:713 */
   65    104   
        }
   66         -
        _ => Err(
   67         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   68         -
                "expected start object or null",
   69         -
            ),
   70         -
        ),
         105  +
        /* JsonParserGenerator.kt:722 */
         106  +
        _ => {
         107  +
            /* JsonParserGenerator.kt:723 */
         108  +
            Err(
         109  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         110  +
                    "expected start object or null",
         111  +
                ),
         112  +
            )
         113  +
            /* JsonParserGenerator.kt:722 */
         114  +
        } /* JsonParserGenerator.kt:712 */
   71    115   
    }
         116  +
    /* JsonParserGenerator.kt:516 */
   72    117   
}
   73    118   
         119  +
/* JsonSerializerGenerator.kt:358 */
   74    120   
pub fn ser_something_else(
   75    121   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   76    122   
    input: &crate::model::SomethingElse,
   77    123   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         124  +
    /* JsonSerializerGenerator.kt:382 */
   78    125   
    if let Some(var_1) = &input.result {
         126  +
        /* JsonSerializerGenerator.kt:495 */
   79    127   
        #[allow(unused_mut)]
         128  +
        /* JsonSerializerGenerator.kt:496 */
   80    129   
        let mut object_2 = object.key("result").start_object();
         130  +
        /* JsonSerializerGenerator.kt:375 */
   81    131   
        crate::protocol_serde::shape_result::ser_result(&mut object_2, var_1)?;
         132  +
        /* JsonSerializerGenerator.kt:515 */
   82    133   
        object_2.finish();
         134  +
        /* JsonSerializerGenerator.kt:382 */
   83    135   
    }
         136  +
    /* JsonSerializerGenerator.kt:382 */
   84    137   
    if let Some(var_3) = &input.result_list {
         138  +
        /* JsonSerializerGenerator.kt:484 */
   85    139   
        let mut array_4 = object.key("resultList").start_array();
         140  +
        /* JsonSerializerGenerator.kt:524 */
   86    141   
        for item_5 in var_3 {
         142  +
            /* SerializerUtil.kt:42 */
   87    143   
            {
         144  +
                /* JsonSerializerGenerator.kt:495 */
   88    145   
                #[allow(unused_mut)]
         146  +
                /* JsonSerializerGenerator.kt:496 */
   89    147   
                let mut object_6 = array_4.value().start_object();
         148  +
                /* JsonSerializerGenerator.kt:375 */
   90    149   
                crate::protocol_serde::shape_result::ser_result(&mut object_6, item_5)?;
         150  +
                /* JsonSerializerGenerator.kt:515 */
   91    151   
                object_6.finish();
         152  +
                /* SerializerUtil.kt:42 */
   92    153   
            }
         154  +
            /* JsonSerializerGenerator.kt:524 */
   93    155   
        }
         156  +
        /* JsonSerializerGenerator.kt:486 */
   94    157   
        array_4.finish();
         158  +
        /* JsonSerializerGenerator.kt:382 */
   95    159   
    }
         160  +
    /* JsonSerializerGenerator.kt:382 */
   96    161   
    if let Some(var_7) = &input.option {
         162  +
        /* JsonSerializerGenerator.kt:495 */
   97    163   
        #[allow(unused_mut)]
         164  +
        /* JsonSerializerGenerator.kt:496 */
   98    165   
        let mut object_8 = object.key("option").start_object();
         166  +
        /* JsonSerializerGenerator.kt:375 */
   99    167   
        crate::protocol_serde::shape_option::ser_option(&mut object_8, var_7)?;
         168  +
        /* JsonSerializerGenerator.kt:515 */
  100    169   
        object_8.finish();
         170  +
        /* JsonSerializerGenerator.kt:382 */
  101    171   
    }
         172  +
    /* JsonSerializerGenerator.kt:382 */
  102    173   
    if let Some(var_9) = &input.option_list {
         174  +
        /* JsonSerializerGenerator.kt:484 */
  103    175   
        let mut array_10 = object.key("optionList").start_array();
         176  +
        /* JsonSerializerGenerator.kt:524 */
  104    177   
        for item_11 in var_9 {
         178  +
            /* SerializerUtil.kt:42 */
  105    179   
            {
         180  +
                /* JsonSerializerGenerator.kt:495 */
  106    181   
                #[allow(unused_mut)]
         182  +
                /* JsonSerializerGenerator.kt:496 */
  107    183   
                let mut object_12 = array_10.value().start_object();
         184  +
                /* JsonSerializerGenerator.kt:375 */
  108    185   
                crate::protocol_serde::shape_result::ser_result(&mut object_12, item_11)?;
         186  +
                /* JsonSerializerGenerator.kt:515 */
  109    187   
                object_12.finish();
         188  +
                /* SerializerUtil.kt:42 */
  110    189   
            }
         190  +
            /* JsonSerializerGenerator.kt:524 */
  111    191   
        }
         192  +
        /* JsonSerializerGenerator.kt:486 */
  112    193   
        array_10.finish();
         194  +
        /* JsonSerializerGenerator.kt:382 */
  113    195   
    }
         196  +
    /* JsonSerializerGenerator.kt:382 */
  114    197   
    if let Some(var_13) = &input.some_union {
         198  +
        /* JsonSerializerGenerator.kt:495 */
  115    199   
        #[allow(unused_mut)]
         200  +
        /* JsonSerializerGenerator.kt:496 */
  116    201   
        let mut object_14 = object.key("someUnion").start_object();
         202  +
        /* JsonSerializerGenerator.kt:579 */
  117    203   
        crate::protocol_serde::shape_some_union::ser_some_union(&mut object_14, var_13)?;
         204  +
        /* JsonSerializerGenerator.kt:515 */
  118    205   
        object_14.finish();
         206  +
        /* JsonSerializerGenerator.kt:382 */
  119    207   
    }
         208  +
    /* JsonSerializerGenerator.kt:372 */
  120    209   
    Ok(())
         210  +
    /* JsonSerializerGenerator.kt:358 */
  121    211   
}