Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation.rs

@@ -1,1 +4,4 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Types for the `Structs` operation.
           2  +
/* CodegenDelegator.kt:51 */
           3  +
/// /* CodegenDelegator.kt:51 */Types for the `Structs` operation.
    4      4   
pub mod structs;

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `Structs`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct Structs;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl Structs {
    7         -
    /// Creates a new `Structs`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `Structs`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::structs::StructsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::structs::StructsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::structs::StructsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -59,68 +334,405 @@
   79     88   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   80     89   
            }
   81     90   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   82     91   
                config_override,
   83     92   
                client_config.config.clone(),
   84     93   
                &client_config.runtime_components,
   85     94   
            ));
   86     95   
        }
   87     96   
        runtime_plugins
   88     97   
    }
          98  +
    /* OperationGenerator.kt:85 */
   89     99   
}
         100  +
/* OperationRuntimePluginGenerator.kt:55 */
   90    101   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Structs {
   91    102   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   92    103   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Structs");
   93    104   
   94    105   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   95    106   
            StructsRequestSerializer,
   96    107   
        ));
   97    108   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   98    109   
            StructsResponseDeserializer,
   99    110   
        ));
  100    111   
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  102    113   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  106    117   
            "Structs",
  107    118   
            "NamingObstacleCourseStructs",
  108    119   
        ));
  109    120   
  110    121   
        ::std::option::Option::Some(cfg.freeze())
  111    122   
    }
  112    123   
  113    124   
    fn runtime_components(
  114    125   
        &self,
  115    126   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  116    127   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  117    128   
        #[allow(unused_mut)]
  118    129   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("Structs")
  119    130   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  120    131   
            .with_interceptor(StructsEndpointParamsInterceptor)
  121    132   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  122    133   
                crate::operation::structs::StructsError,
  123    134   
            >::new())
  124    135   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  125    136   
                crate::operation::structs::StructsError,
  126    137   
            >::new());
  127    138   
  128    139   
        ::std::borrow::Cow::Owned(rcb)
  129    140   
    }
  130    141   
}
  131    142   
         143  +
/* ResponseDeserializerGenerator.kt:64 */
  132    144   
#[derive(Debug)]
  133    145   
struct StructsResponseDeserializer;
  134    146   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StructsResponseDeserializer {
  135    147   
    fn deserialize_nonstreaming(
  136    148   
        &self,
  137    149   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  138    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  139    151   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  140    152   
        let headers = response.headers();
  141    153   
        let body = response.body().bytes().expect("body loaded");
  142    154   
        #[allow(unused_mut)]
  143    155   
        let mut force_error = false;
  144    156   
  145    157   
        let parse_result = if !success && status != 200 || force_error {
  146    158   
            crate::protocol_serde::shape_structs::de_structs_http_error(status, headers, body)
  147    159   
        } else {
  148    160   
            crate::protocol_serde::shape_structs::de_structs_http_response(status, headers, body)
  149    161   
        };
  150    162   
        crate::protocol_serde::type_erase_result(parse_result)
  151    163   
    }
  152    164   
}
         165  +
/* RequestSerializerGenerator.kt:67 */
  153    166   
#[derive(Debug)]
  154    167   
struct StructsRequestSerializer;
  155    168   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StructsRequestSerializer {
  156    169   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  157    170   
    fn serialize_input(
  158    171   
        &self,
  159    172   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  160    173   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  161    174   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  162    175   
        let input = input.downcast::<crate::operation::structs::StructsInput>().expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::structs::StructsInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::structs::StructsInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "NamingObstacleCourseStructs.Structs",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_structs::ser_structs_input(&input)?);
  195    208   
        if let Some(content_length) = body.content_length() {
  196    209   
            let content_length = content_length.to_string();
  197    210   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  198    211   
        }
  199    212   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  200    213   
    }
  201    214   
}
         215  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  202    216   
#[derive(Debug)]
  203    217   
struct StructsEndpointParamsInterceptor;
  204    218   
  205    219   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StructsEndpointParamsInterceptor {
  206    220   
    fn name(&self) -> &'static str {
  207    221   
        "StructsEndpointParamsInterceptor"
  208    222   
    }
  209    223   
  210    224   
    fn read_before_execution(
  211    225   
        &self,
  212    226   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  213    227   
            '_,
  214    228   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  217    231   
        >,
  218    232   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  219    233   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  220    234   
        let _input = context
  221    235   
            .input()
  222    236   
            .downcast_ref::<StructsInput>()
  223    237   
            .ok_or("failed to downcast to StructsInput")?;
  224    238   
  225    239   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  226    240   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  227    241   
        })?;
  228    242   
        cfg.interceptor_state()
  229    243   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  230    244   
        ::std::result::Result::Ok(())
  231    245   
    }
  232    246   
}
  233    247   
  234    248   
// The get_* functions below are generated from JMESPath expressions in the
  235    249   
// operationContextParams trait. They target the operation's input shape.
  236    250   
         251  +
/* OperationErrorGenerator.kt:79 */
  237    252   
/// Error type for the `StructsError` operation.
         253  +
/* RustType.kt:516 */
  238    254   
#[non_exhaustive]
         255  +
/* RustType.kt:516 */
  239    256   
#[derive(::std::fmt::Debug)]
  240         -
pub enum StructsError {
         257  +
pub /* OperationErrorGenerator.kt:81 */ enum StructsError {
         258  +
    /* OperationErrorGenerator.kt:88 */
  241    259   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  242    260   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  243    261   
    variable wildcard pattern and check `.code()`:
  244    262   
     \
  245    263   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  246    264   
     \
  247    265   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StructsError) for what information is available for the error.")]
  248    266   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         267  +
    /* OperationErrorGenerator.kt:81 */
  249    268   
}
         269  +
/* OperationErrorGenerator.kt:218 */
  250    270   
impl StructsError {
         271  +
    /* OperationErrorGenerator.kt:219 */
  251    272   
    /// Creates the `StructsError::Unhandled` variant from any error type.
  252    273   
    pub fn unhandled(
  253    274   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  254    275   
    ) -> Self {
  255    276   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  256    277   
            source: err.into(),
  257    278   
            meta: ::std::default::Default::default(),
  258    279   
        })
  259    280   
    }
  260    281   
  261    282   
    /// Creates the `StructsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  262    283   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  263    284   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  264    285   
            source: err.clone().into(),
  265    286   
            meta: err,
  266    287   
        })
  267    288   
    }
  268         -
    ///
         289  +
    /// /* OperationErrorGenerator.kt:236 */
  269    290   
    /// Returns error metadata, which includes the error code, message,
  270    291   
    /// request ID, and potentially additional information.
  271    292   
    ///
         293  +
    /* OperationErrorGenerator.kt:242 */
  272    294   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         295  +
        /* OperationErrorGenerator.kt:243 */
  273    296   
        match self {
  274         -
            Self::Unhandled(e) => &e.meta,
         297  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         298  +
            /* OperationErrorGenerator.kt:243 */
  275    299   
        }
         300  +
        /* OperationErrorGenerator.kt:242 */
  276    301   
    }
         302  +
    /* OperationErrorGenerator.kt:218 */
  277    303   
}
         304  +
/* OperationErrorGenerator.kt:269 */
  278    305   
impl ::std::error::Error for StructsError {
         306  +
    /* OperationErrorGenerator.kt:270 */
  279    307   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         308  +
        /* OperationErrorGenerator.kt:318 */
  280    309   
        match self {
  281         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         310  +
            /* OperationErrorGenerator.kt:326 */
         311  +
            Self::Unhandled(_inner) => {
         312  +
                /* OperationErrorGenerator.kt:279 */
         313  +
                ::std::option::Option::Some(&*_inner.source)
         314  +
                /* OperationErrorGenerator.kt:326 */
         315  +
            } /* OperationErrorGenerator.kt:318 */
  282    316   
        }
         317  +
        /* OperationErrorGenerator.kt:270 */
  283    318   
    }
         319  +
    /* OperationErrorGenerator.kt:269 */
  284    320   
}
         321  +
/* OperationErrorGenerator.kt:133 */
  285    322   
impl ::std::fmt::Display for StructsError {
         323  +
    /* OperationErrorGenerator.kt:134 */
  286    324   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         325  +
        /* OperationErrorGenerator.kt:318 */
  287    326   
        match self {
         327  +
            /* OperationErrorGenerator.kt:326 */
  288    328   
            Self::Unhandled(_inner) => {
         329  +
                /* OperationErrorGenerator.kt:139 */
  289    330   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  290    331   
                    write!(f, "unhandled error ({code})")
  291    332   
                } else {
  292    333   
                    f.write_str("unhandled error")
  293    334   
                }
  294         -
            }
         335  +
                /* OperationErrorGenerator.kt:326 */
         336  +
            } /* OperationErrorGenerator.kt:318 */
  295    337   
        }
         338  +
        /* OperationErrorGenerator.kt:134 */
  296    339   
    }
         340  +
    /* OperationErrorGenerator.kt:133 */
  297    341   
}
         342  +
/* OperationErrorGenerator.kt:182 */
  298    343   
impl ::aws_smithy_types::retry::ProvideErrorKind for StructsError {
         344  +
    /* OperationErrorGenerator.kt:186 */
  299    345   
    fn code(&self) -> ::std::option::Option<&str> {
         346  +
        /* OperationErrorGenerator.kt:187 */
  300    347   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         348  +
        /* OperationErrorGenerator.kt:186 */
  301    349   
    }
         350  +
    /* OperationErrorGenerator.kt:190 */
  302    351   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         352  +
        /* OperationErrorGenerator.kt:197 */
  303    353   
        ::std::option::Option::None
         354  +
        /* OperationErrorGenerator.kt:190 */
  304    355   
    }
         356  +
    /* OperationErrorGenerator.kt:182 */
  305    357   
}
         358  +
/* OperationErrorGenerator.kt:163 */
  306    359   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StructsError {
         360  +
    /* OperationErrorGenerator.kt:164 */
  307    361   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         362  +
        /* OperationErrorGenerator.kt:318 */
  308    363   
        match self {
  309         -
            Self::Unhandled(_inner) => &_inner.meta,
         364  +
            /* OperationErrorGenerator.kt:326 */
         365  +
            Self::Unhandled(_inner) => {
         366  +
                /* OperationErrorGenerator.kt:168 */
         367  +
                &_inner.meta
         368  +
                /* OperationErrorGenerator.kt:326 */
         369  +
            } /* OperationErrorGenerator.kt:318 */
  310    370   
        }
         371  +
        /* OperationErrorGenerator.kt:164 */
  311    372   
    }
         373  +
    /* OperationErrorGenerator.kt:163 */
  312    374   
}
         375  +
/* OperationErrorGenerator.kt:109 */
  313    376   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StructsError {
         377  +
    /* OperationErrorGenerator.kt:110 */
  314    378   
    fn create_unhandled_error(
  315    379   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  316    380   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  317    381   
    ) -> Self {
         382  +
        /* OperationErrorGenerator.kt:121 */
  318    383   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  319    384   
            source,
  320    385   
            meta: meta.unwrap_or_default(),
  321    386   
        })
         387  +
        /* OperationErrorGenerator.kt:110 */
  322    388   
    }
         389  +
    /* OperationErrorGenerator.kt:109 */
  323    390   
}
  324    391   
         392  +
/* CodegenDelegator.kt:255 */
  325    393   
pub use crate::operation::structs::_structs_output::StructsOutput;
  326    394   
         395  +
/* CodegenDelegator.kt:255 */
  327    396   
pub use crate::operation::structs::_structs_input::StructsInput;
  328    397   
         398  +
/* RustModule.kt:172 */
  329    399   
mod _structs_input;
  330    400   
         401  +
/* RustModule.kt:172 */
  331    402   
mod _structs_output;
  332    403   
  333         -
/// Builders
         404  +
/// /* CodegenDelegator.kt:51 */Builders
  334    405   
pub mod builders;

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs/_structs_input.rs

@@ -1,1 +151,276 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct StructsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StructsInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub result: ::std::option::Option<crate::types::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub option: ::std::option::Option<crate::types::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
   13     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
   15     23   
    pub something_else: ::std::option::Option<crate::types::SomethingElse>,
          24  +
    /* StructureGenerator.kt:201 */
   16     25   
}
          26  +
/* StructureGenerator.kt:135 */
   17     27   
impl StructsInput {
          28  +
    /* StructureGenerator.kt:231 */
   18     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   19     31   
    pub fn result(&self) -> ::std::option::Option<&crate::types::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   20     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   21     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   22     37   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.result_list.is_none()`.
          38  +
    /// /* StructureGenerator.kt:162 */
          39  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.result_list.is_none()`.
          40  +
    /* StructureGenerator.kt:166 */
   25     41   
    pub fn result_list(&self) -> &[crate::types::Result] {
   26         -
        self.result_list.as_deref().unwrap_or_default()
          42  +
        /* StructureGenerator.kt:169 */
          43  +
        self.result_list
          44  +
            .as_deref()
          45  +
            /* StructureGenerator.kt:175 */
          46  +
            .unwrap_or_default()
          47  +
        /* StructureGenerator.kt:166 */
   27     48   
    }
          49  +
    /* StructureGenerator.kt:231 */
   28     50   
    #[allow(missing_docs)] // documentation missing in model
          51  +
                           /* StructureGenerator.kt:166 */
   29     52   
    pub fn option(&self) -> ::std::option::Option<&crate::types::Option> {
          53  +
        /* StructureGenerator.kt:170 */
   30     54   
        self.option.as_ref()
          55  +
        /* StructureGenerator.kt:166 */
   31     56   
    }
          57  +
    /* StructureGenerator.kt:231 */
   32     58   
    #[allow(missing_docs)] // documentation missing in model
   33         -
    ///
   34         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_list.is_none()`.
          59  +
    /// /* StructureGenerator.kt:162 */
          60  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_list.is_none()`.
          61  +
    /* StructureGenerator.kt:166 */
   35     62   
    pub fn option_list(&self) -> &[crate::types::Result] {
   36         -
        self.option_list.as_deref().unwrap_or_default()
          63  +
        /* StructureGenerator.kt:169 */
          64  +
        self.option_list
          65  +
            .as_deref()
          66  +
            /* StructureGenerator.kt:175 */
          67  +
            .unwrap_or_default()
          68  +
        /* StructureGenerator.kt:166 */
   37     69   
    }
          70  +
    /* StructureGenerator.kt:231 */
   38     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* StructureGenerator.kt:166 */
   39     73   
    pub fn something_else(&self) -> ::std::option::Option<&crate::types::SomethingElse> {
          74  +
        /* StructureGenerator.kt:170 */
   40     75   
        self.something_else.as_ref()
          76  +
        /* StructureGenerator.kt:166 */
   41     77   
    }
          78  +
    /* StructureGenerator.kt:135 */
   42     79   
}
          80  +
/* ClientCodegenVisitor.kt:237 */
   43     81   
impl StructsInput {
   44         -
    /// Creates a new builder-style object to manufacture [`StructsInput`](crate::operation::structs::StructsInput).
          82  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StructsInput`](crate::operation::structs::StructsInput).
          83  +
    /* BuilderGenerator.kt:175 */
   45     84   
    pub fn builder() -> crate::operation::structs::builders::StructsInputBuilder {
          85  +
        /* BuilderGenerator.kt:176 */
   46     86   
        crate::operation::structs::builders::StructsInputBuilder::default()
          87  +
        /* BuilderGenerator.kt:175 */
   47     88   
    }
          89  +
    /* ClientCodegenVisitor.kt:237 */
   48     90   
}
   49     91   
   50         -
/// A builder for [`StructsInput`](crate::operation::structs::StructsInput).
          92  +
/// /* BuilderGenerator.kt:342 */A builder for [`StructsInput`](crate::operation::structs::StructsInput).
          93  +
/* RustType.kt:516 */
   51     94   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          95  +
/* RustType.kt:516 */
   52     96   
#[non_exhaustive]
          97  +
/* BuilderGenerator.kt:345 */
   53     98   
pub struct StructsInputBuilder {
   54         -
    pub(crate) result: ::std::option::Option<crate::types::Result>,
   55         -
    pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
   56         -
    pub(crate) option: ::std::option::Option<crate::types::Option>,
   57         -
    pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          99  +
    /* BuilderGenerator.kt:275 */ pub(crate) result: ::std::option::Option<crate::types::Result>,
         100  +
    /* BuilderGenerator.kt:275 */ pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         101  +
    /* BuilderGenerator.kt:275 */ pub(crate) option: ::std::option::Option<crate::types::Option>,
         102  +
    /* BuilderGenerator.kt:275 */ pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         103  +
    /* BuilderGenerator.kt:275 */
   58    104   
    pub(crate) something_else: ::std::option::Option<crate::types::SomethingElse>,
         105  +
    /* BuilderGenerator.kt:345 */
   59    106   
}
         107  +
/* BuilderGenerator.kt:355 */
   60    108   
impl StructsInputBuilder {
         109  +
    /* BuilderGenerator.kt:286 */
   61    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:291 */
   62    112   
    pub fn result(mut self, input: crate::types::Result) -> Self {
         113  +
        /* BuilderGenerator.kt:292 */
   63    114   
        self.result = ::std::option::Option::Some(input);
         115  +
        /* BuilderGenerator.kt:293 */
   64    116   
        self
         117  +
        /* BuilderGenerator.kt:291 */
   65    118   
    }
         119  +
    /* BuilderGenerator.kt:312 */
   66    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* BuilderGenerator.kt:314 */
   67    122   
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::Result>) -> Self {
         123  +
        /* BuilderGenerator.kt:315 */
   68    124   
        self.result = input;
   69    125   
        self
         126  +
        /* BuilderGenerator.kt:314 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:334 */
   71    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* BuilderGenerator.kt:336 */
   72    131   
    pub fn get_result(&self) -> &::std::option::Option<crate::types::Result> {
         132  +
        /* BuilderGenerator.kt:337 */
   73    133   
        &self.result
         134  +
        /* BuilderGenerator.kt:336 */
   74    135   
    }
   75         -
    /// Appends an item to `result_list`.
         136  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `result_list`.
         137  +
    /* BuilderGenerator.kt:411 */
   76    138   
    ///
   77         -
    /// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         139  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         140  +
    /* BuilderGenerator.kt:413 */
   78    141   
    ///
         142  +
    /* BuilderGenerator.kt:418 */
   79    143   
    pub fn result_list(mut self, input: crate::types::Result) -> Self {
         144  +
        /* BuilderGenerator.kt:419 */
   80    145   
        let mut v = self.result_list.unwrap_or_default();
   81    146   
        v.push(input);
   82    147   
        self.result_list = ::std::option::Option::Some(v);
   83    148   
        self
         149  +
        /* BuilderGenerator.kt:418 */
   84    150   
    }
         151  +
    /* BuilderGenerator.kt:312 */
   85    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* BuilderGenerator.kt:314 */
   86    154   
    pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         155  +
        /* BuilderGenerator.kt:315 */
   87    156   
        self.result_list = input;
   88    157   
        self
         158  +
        /* BuilderGenerator.kt:314 */
   89    159   
    }
         160  +
    /* BuilderGenerator.kt:334 */
   90    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* BuilderGenerator.kt:336 */
   91    163   
    pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         164  +
        /* BuilderGenerator.kt:337 */
   92    165   
        &self.result_list
         166  +
        /* BuilderGenerator.kt:336 */
   93    167   
    }
         168  +
    /* BuilderGenerator.kt:286 */
   94    169   
    #[allow(missing_docs)] // documentation missing in model
         170  +
                           /* BuilderGenerator.kt:291 */
   95    171   
    pub fn option(mut self, input: crate::types::Option) -> Self {
         172  +
        /* BuilderGenerator.kt:292 */
   96    173   
        self.option = ::std::option::Option::Some(input);
         174  +
        /* BuilderGenerator.kt:293 */
   97    175   
        self
         176  +
        /* BuilderGenerator.kt:291 */
   98    177   
    }
         178  +
    /* BuilderGenerator.kt:312 */
   99    179   
    #[allow(missing_docs)] // documentation missing in model
         180  +
                           /* BuilderGenerator.kt:314 */
  100    181   
    pub fn set_option(mut self, input: ::std::option::Option<crate::types::Option>) -> Self {
         182  +
        /* BuilderGenerator.kt:315 */
  101    183   
        self.option = input;
  102    184   
        self
         185  +
        /* BuilderGenerator.kt:314 */
  103    186   
    }
         187  +
    /* BuilderGenerator.kt:334 */
  104    188   
    #[allow(missing_docs)] // documentation missing in model
         189  +
                           /* BuilderGenerator.kt:336 */
  105    190   
    pub fn get_option(&self) -> &::std::option::Option<crate::types::Option> {
         191  +
        /* BuilderGenerator.kt:337 */
  106    192   
        &self.option
         193  +
        /* BuilderGenerator.kt:336 */
  107    194   
    }
  108         -
    /// Appends an item to `option_list`.
         195  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `option_list`.
         196  +
    /* BuilderGenerator.kt:411 */
  109    197   
    ///
  110         -
    /// To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         198  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         199  +
    /* BuilderGenerator.kt:413 */
  111    200   
    ///
         201  +
    /* BuilderGenerator.kt:418 */
  112    202   
    pub fn option_list(mut self, input: crate::types::Result) -> Self {
         203  +
        /* BuilderGenerator.kt:419 */
  113    204   
        let mut v = self.option_list.unwrap_or_default();
  114    205   
        v.push(input);
  115    206   
        self.option_list = ::std::option::Option::Some(v);
  116    207   
        self
         208  +
        /* BuilderGenerator.kt:418 */
  117    209   
    }
         210  +
    /* BuilderGenerator.kt:312 */
  118    211   
    #[allow(missing_docs)] // documentation missing in model
         212  +
                           /* BuilderGenerator.kt:314 */
  119    213   
    pub fn set_option_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         214  +
        /* BuilderGenerator.kt:315 */
  120    215   
        self.option_list = input;
  121    216   
        self
         217  +
        /* BuilderGenerator.kt:314 */
  122    218   
    }
         219  +
    /* BuilderGenerator.kt:334 */
  123    220   
    #[allow(missing_docs)] // documentation missing in model
         221  +
                           /* BuilderGenerator.kt:336 */
  124    222   
    pub fn get_option_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         223  +
        /* BuilderGenerator.kt:337 */
  125    224   
        &self.option_list
         225  +
        /* BuilderGenerator.kt:336 */
  126    226   
    }
         227  +
    /* BuilderGenerator.kt:286 */
  127    228   
    #[allow(missing_docs)] // documentation missing in model
         229  +
                           /* BuilderGenerator.kt:291 */
  128    230   
    pub fn something_else(mut self, input: crate::types::SomethingElse) -> Self {
         231  +
        /* BuilderGenerator.kt:292 */
  129    232   
        self.something_else = ::std::option::Option::Some(input);
         233  +
        /* BuilderGenerator.kt:293 */
  130    234   
        self
         235  +
        /* BuilderGenerator.kt:291 */
  131    236   
    }
         237  +
    /* BuilderGenerator.kt:312 */
  132    238   
    #[allow(missing_docs)] // documentation missing in model
         239  +
                           /* BuilderGenerator.kt:314 */
  133    240   
    pub fn set_something_else(mut self, input: ::std::option::Option<crate::types::SomethingElse>) -> Self {
         241  +
        /* BuilderGenerator.kt:315 */
  134    242   
        self.something_else = input;
  135    243   
        self
         244  +
        /* BuilderGenerator.kt:314 */
  136    245   
    }
         246  +
    /* BuilderGenerator.kt:334 */
  137    247   
    #[allow(missing_docs)] // documentation missing in model
         248  +
                           /* BuilderGenerator.kt:336 */
  138    249   
    pub fn get_something_else(&self) -> &::std::option::Option<crate::types::SomethingElse> {
         250  +
        /* BuilderGenerator.kt:337 */
  139    251   
        &self.something_else
         252  +
        /* BuilderGenerator.kt:336 */
  140    253   
    }
  141         -
    /// Consumes the builder and constructs a [`StructsInput`](crate::operation::structs::StructsInput).
         254  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StructsInput`](crate::operation::structs::StructsInput).
         255  +
    /* BuilderGenerator.kt:253 */
  142    256   
    pub fn build(self) -> ::std::result::Result<crate::operation::structs::StructsInput, ::aws_smithy_types::error::operation::BuildError> {
  143         -
        ::std::result::Result::Ok(crate::operation::structs::StructsInput {
  144         -
            result: self.result,
  145         -
            result_list: self.result_list,
  146         -
            option: self.option,
  147         -
            option_list: self.option_list,
  148         -
            something_else: self.something_else,
  149         -
        })
         257  +
        /* BuilderGenerator.kt:254 */
         258  +
        ::std::result::Result::Ok(
         259  +
            /* BuilderGenerator.kt:477 */
         260  +
            crate::operation::structs::StructsInput {
         261  +
                /* BuilderGenerator.kt:481 */ result: self.result,
         262  +
                /* BuilderGenerator.kt:481 */
         263  +
                result_list: self.result_list,
         264  +
                /* BuilderGenerator.kt:481 */
         265  +
                option: self.option,
         266  +
                /* BuilderGenerator.kt:481 */
         267  +
                option_list: self.option_list,
         268  +
                /* BuilderGenerator.kt:481 */
         269  +
                something_else: self.something_else,
         270  +
                /* BuilderGenerator.kt:477 */
         271  +
            }, /* BuilderGenerator.kt:254 */
         272  +
        )
         273  +
        /* BuilderGenerator.kt:253 */
  150    274   
    }
         275  +
    /* BuilderGenerator.kt:355 */
  151    276   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs/_structs_output.rs

@@ -1,1 +151,273 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct StructsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StructsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub result: ::std::option::Option<crate::types::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub option: ::std::option::Option<crate::types::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
   13     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
   15     23   
    pub something_else: ::std::option::Option<crate::types::SomethingElse>,
          24  +
    /* StructureGenerator.kt:201 */
   16     25   
}
          26  +
/* StructureGenerator.kt:135 */
   17     27   
impl StructsOutput {
          28  +
    /* StructureGenerator.kt:231 */
   18     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   19     31   
    pub fn result(&self) -> ::std::option::Option<&crate::types::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   20     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   21     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   22     37   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.result_list.is_none()`.
          38  +
    /// /* StructureGenerator.kt:162 */
          39  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.result_list.is_none()`.
          40  +
    /* StructureGenerator.kt:166 */
   25     41   
    pub fn result_list(&self) -> &[crate::types::Result] {
   26         -
        self.result_list.as_deref().unwrap_or_default()
          42  +
        /* StructureGenerator.kt:169 */
          43  +
        self.result_list
          44  +
            .as_deref()
          45  +
            /* StructureGenerator.kt:175 */
          46  +
            .unwrap_or_default()
          47  +
        /* StructureGenerator.kt:166 */
   27     48   
    }
          49  +
    /* StructureGenerator.kt:231 */
   28     50   
    #[allow(missing_docs)] // documentation missing in model
          51  +
                           /* StructureGenerator.kt:166 */
   29     52   
    pub fn option(&self) -> ::std::option::Option<&crate::types::Option> {
          53  +
        /* StructureGenerator.kt:170 */
   30     54   
        self.option.as_ref()
          55  +
        /* StructureGenerator.kt:166 */
   31     56   
    }
          57  +
    /* StructureGenerator.kt:231 */
   32     58   
    #[allow(missing_docs)] // documentation missing in model
   33         -
    ///
   34         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_list.is_none()`.
          59  +
    /// /* StructureGenerator.kt:162 */
          60  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_list.is_none()`.
          61  +
    /* StructureGenerator.kt:166 */
   35     62   
    pub fn option_list(&self) -> &[crate::types::Result] {
   36         -
        self.option_list.as_deref().unwrap_or_default()
          63  +
        /* StructureGenerator.kt:169 */
          64  +
        self.option_list
          65  +
            .as_deref()
          66  +
            /* StructureGenerator.kt:175 */
          67  +
            .unwrap_or_default()
          68  +
        /* StructureGenerator.kt:166 */
   37     69   
    }
          70  +
    /* StructureGenerator.kt:231 */
   38     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* StructureGenerator.kt:166 */
   39     73   
    pub fn something_else(&self) -> ::std::option::Option<&crate::types::SomethingElse> {
          74  +
        /* StructureGenerator.kt:170 */
   40     75   
        self.something_else.as_ref()
          76  +
        /* StructureGenerator.kt:166 */
   41     77   
    }
          78  +
    /* StructureGenerator.kt:135 */
   42     79   
}
          80  +
/* ClientCodegenVisitor.kt:237 */
   43     81   
impl StructsOutput {
   44         -
    /// Creates a new builder-style object to manufacture [`StructsOutput`](crate::operation::structs::StructsOutput).
          82  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StructsOutput`](crate::operation::structs::StructsOutput).
          83  +
    /* BuilderGenerator.kt:175 */
   45     84   
    pub fn builder() -> crate::operation::structs::builders::StructsOutputBuilder {
          85  +
        /* BuilderGenerator.kt:176 */
   46     86   
        crate::operation::structs::builders::StructsOutputBuilder::default()
          87  +
        /* BuilderGenerator.kt:175 */
   47     88   
    }
          89  +
    /* ClientCodegenVisitor.kt:237 */
   48     90   
}
   49     91   
   50         -
/// A builder for [`StructsOutput`](crate::operation::structs::StructsOutput).
          92  +
/// /* BuilderGenerator.kt:342 */A builder for [`StructsOutput`](crate::operation::structs::StructsOutput).
          93  +
/* RustType.kt:516 */
   51     94   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          95  +
/* RustType.kt:516 */
   52     96   
#[non_exhaustive]
          97  +
/* BuilderGenerator.kt:345 */
   53     98   
pub struct StructsOutputBuilder {
   54         -
    pub(crate) result: ::std::option::Option<crate::types::Result>,
   55         -
    pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
   56         -
    pub(crate) option: ::std::option::Option<crate::types::Option>,
   57         -
    pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          99  +
    /* BuilderGenerator.kt:275 */ pub(crate) result: ::std::option::Option<crate::types::Result>,
         100  +
    /* BuilderGenerator.kt:275 */ pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         101  +
    /* BuilderGenerator.kt:275 */ pub(crate) option: ::std::option::Option<crate::types::Option>,
         102  +
    /* BuilderGenerator.kt:275 */ pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         103  +
    /* BuilderGenerator.kt:275 */
   58    104   
    pub(crate) something_else: ::std::option::Option<crate::types::SomethingElse>,
         105  +
    /* BuilderGenerator.kt:345 */
   59    106   
}
         107  +
/* BuilderGenerator.kt:355 */
   60    108   
impl StructsOutputBuilder {
         109  +
    /* BuilderGenerator.kt:286 */
   61    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:291 */
   62    112   
    pub fn result(mut self, input: crate::types::Result) -> Self {
         113  +
        /* BuilderGenerator.kt:292 */
   63    114   
        self.result = ::std::option::Option::Some(input);
         115  +
        /* BuilderGenerator.kt:293 */
   64    116   
        self
         117  +
        /* BuilderGenerator.kt:291 */
   65    118   
    }
         119  +
    /* BuilderGenerator.kt:312 */
   66    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* BuilderGenerator.kt:314 */
   67    122   
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::Result>) -> Self {
         123  +
        /* BuilderGenerator.kt:315 */
   68    124   
        self.result = input;
   69    125   
        self
         126  +
        /* BuilderGenerator.kt:314 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:334 */
   71    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* BuilderGenerator.kt:336 */
   72    131   
    pub fn get_result(&self) -> &::std::option::Option<crate::types::Result> {
         132  +
        /* BuilderGenerator.kt:337 */
   73    133   
        &self.result
         134  +
        /* BuilderGenerator.kt:336 */
   74    135   
    }
   75         -
    /// Appends an item to `result_list`.
         136  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `result_list`.
         137  +
    /* BuilderGenerator.kt:411 */
   76    138   
    ///
   77         -
    /// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         139  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         140  +
    /* BuilderGenerator.kt:413 */
   78    141   
    ///
         142  +
    /* BuilderGenerator.kt:418 */
   79    143   
    pub fn result_list(mut self, input: crate::types::Result) -> Self {
         144  +
        /* BuilderGenerator.kt:419 */
   80    145   
        let mut v = self.result_list.unwrap_or_default();
   81    146   
        v.push(input);
   82    147   
        self.result_list = ::std::option::Option::Some(v);
   83    148   
        self
         149  +
        /* BuilderGenerator.kt:418 */
   84    150   
    }
         151  +
    /* BuilderGenerator.kt:312 */
   85    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* BuilderGenerator.kt:314 */
   86    154   
    pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         155  +
        /* BuilderGenerator.kt:315 */
   87    156   
        self.result_list = input;
   88    157   
        self
         158  +
        /* BuilderGenerator.kt:314 */
   89    159   
    }
         160  +
    /* BuilderGenerator.kt:334 */
   90    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* BuilderGenerator.kt:336 */
   91    163   
    pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         164  +
        /* BuilderGenerator.kt:337 */
   92    165   
        &self.result_list
         166  +
        /* BuilderGenerator.kt:336 */
   93    167   
    }
         168  +
    /* BuilderGenerator.kt:286 */
   94    169   
    #[allow(missing_docs)] // documentation missing in model
         170  +
                           /* BuilderGenerator.kt:291 */
   95    171   
    pub fn option(mut self, input: crate::types::Option) -> Self {
         172  +
        /* BuilderGenerator.kt:292 */
   96    173   
        self.option = ::std::option::Option::Some(input);
         174  +
        /* BuilderGenerator.kt:293 */
   97    175   
        self
         176  +
        /* BuilderGenerator.kt:291 */
   98    177   
    }
         178  +
    /* BuilderGenerator.kt:312 */
   99    179   
    #[allow(missing_docs)] // documentation missing in model
         180  +
                           /* BuilderGenerator.kt:314 */
  100    181   
    pub fn set_option(mut self, input: ::std::option::Option<crate::types::Option>) -> Self {
         182  +
        /* BuilderGenerator.kt:315 */
  101    183   
        self.option = input;
  102    184   
        self
         185  +
        /* BuilderGenerator.kt:314 */
  103    186   
    }
         187  +
    /* BuilderGenerator.kt:334 */
  104    188   
    #[allow(missing_docs)] // documentation missing in model
         189  +
                           /* BuilderGenerator.kt:336 */
  105    190   
    pub fn get_option(&self) -> &::std::option::Option<crate::types::Option> {
         191  +
        /* BuilderGenerator.kt:337 */
  106    192   
        &self.option
         193  +
        /* BuilderGenerator.kt:336 */
  107    194   
    }
  108         -
    /// Appends an item to `option_list`.
         195  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `option_list`.
         196  +
    /* BuilderGenerator.kt:411 */
  109    197   
    ///
  110         -
    /// To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         198  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         199  +
    /* BuilderGenerator.kt:413 */
  111    200   
    ///
         201  +
    /* BuilderGenerator.kt:418 */
  112    202   
    pub fn option_list(mut self, input: crate::types::Result) -> Self {
         203  +
        /* BuilderGenerator.kt:419 */
  113    204   
        let mut v = self.option_list.unwrap_or_default();
  114    205   
        v.push(input);
  115    206   
        self.option_list = ::std::option::Option::Some(v);
  116    207   
        self
         208  +
        /* BuilderGenerator.kt:418 */
  117    209   
    }
         210  +
    /* BuilderGenerator.kt:312 */
  118    211   
    #[allow(missing_docs)] // documentation missing in model
         212  +
                           /* BuilderGenerator.kt:314 */
  119    213   
    pub fn set_option_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         214  +
        /* BuilderGenerator.kt:315 */
  120    215   
        self.option_list = input;
  121    216   
        self
         217  +
        /* BuilderGenerator.kt:314 */
  122    218   
    }
         219  +
    /* BuilderGenerator.kt:334 */
  123    220   
    #[allow(missing_docs)] // documentation missing in model
         221  +
                           /* BuilderGenerator.kt:336 */
  124    222   
    pub fn get_option_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         223  +
        /* BuilderGenerator.kt:337 */
  125    224   
        &self.option_list
         225  +
        /* BuilderGenerator.kt:336 */
  126    226   
    }
         227  +
    /* BuilderGenerator.kt:286 */
  127    228   
    #[allow(missing_docs)] // documentation missing in model
         229  +
                           /* BuilderGenerator.kt:291 */
  128    230   
    pub fn something_else(mut self, input: crate::types::SomethingElse) -> Self {
         231  +
        /* BuilderGenerator.kt:292 */
  129    232   
        self.something_else = ::std::option::Option::Some(input);
         233  +
        /* BuilderGenerator.kt:293 */
  130    234   
        self
         235  +
        /* BuilderGenerator.kt:291 */
  131    236   
    }
         237  +
    /* BuilderGenerator.kt:312 */
  132    238   
    #[allow(missing_docs)] // documentation missing in model
         239  +
                           /* BuilderGenerator.kt:314 */
  133    240   
    pub fn set_something_else(mut self, input: ::std::option::Option<crate::types::SomethingElse>) -> Self {
         241  +
        /* BuilderGenerator.kt:315 */
  134    242   
        self.something_else = input;
  135    243   
        self
         244  +
        /* BuilderGenerator.kt:314 */
  136    245   
    }
         246  +
    /* BuilderGenerator.kt:334 */
  137    247   
    #[allow(missing_docs)] // documentation missing in model
         248  +
                           /* BuilderGenerator.kt:336 */
  138    249   
    pub fn get_something_else(&self) -> &::std::option::Option<crate::types::SomethingElse> {
         250  +
        /* BuilderGenerator.kt:337 */
  139    251   
        &self.something_else
         252  +
        /* BuilderGenerator.kt:336 */
  140    253   
    }
  141         -
    /// Consumes the builder and constructs a [`StructsOutput`](crate::operation::structs::StructsOutput).
         254  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StructsOutput`](crate::operation::structs::StructsOutput).
         255  +
    /* BuilderGenerator.kt:253 */
  142    256   
    pub fn build(self) -> crate::operation::structs::StructsOutput {
         257  +
        /* BuilderGenerator.kt:477 */
  143    258   
        crate::operation::structs::StructsOutput {
  144         -
            result: self.result,
         259  +
            /* BuilderGenerator.kt:481 */ result: self.result,
         260  +
            /* BuilderGenerator.kt:481 */
  145    261   
            result_list: self.result_list,
         262  +
            /* BuilderGenerator.kt:481 */
  146    263   
            option: self.option,
         264  +
            /* BuilderGenerator.kt:481 */
  147    265   
            option_list: self.option_list,
         266  +
            /* BuilderGenerator.kt:481 */
  148    267   
            something_else: self.something_else,
         268  +
            /* BuilderGenerator.kt:477 */
  149    269   
        }
         270  +
        /* BuilderGenerator.kt:253 */
  150    271   
    }
         272  +
    /* BuilderGenerator.kt:355 */
  151    273   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs/builders.rs

@@ -1,1 +181,223 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::structs::_structs_output::StructsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::structs::_structs_input::StructsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::structs::builders::StructsInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::structs::StructsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::structs::StructsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.structs();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `Structs`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `Structs`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct StructsFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::structs::builders::StructsInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl crate::client::customize::internal::CustomizableSend<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError>
   32     38   
    for StructsFluentBuilder
   33     39   
{
   34     40   
    fn send(
   35     41   
        self,
   36     42   
        config_override: crate::config::Builder,
   37     43   
    ) -> crate::client::customize::internal::BoxFuture<
   38     44   
        crate::client::customize::internal::SendResult<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError>,
   39     45   
    > {
   40     46   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   41     47   
    }
   42     48   
}
          49  +
/* FluentBuilderGenerator.kt:282 */
   43     50   
impl StructsFluentBuilder {
          51  +
    /* FluentBuilderGenerator.kt:288 */
   44     52   
    /// Creates a new `StructsFluentBuilder`.
   45     53   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   46     54   
        Self {
   47     55   
            handle,
   48     56   
            inner: ::std::default::Default::default(),
   49     57   
            config_override: ::std::option::Option::None,
   50     58   
        }
   51     59   
    }
          60  +
    /* FluentBuilderGenerator.kt:301 */
   52     61   
    /// Access the Structs as a reference.
   53     62   
    pub fn as_input(&self) -> &crate::operation::structs::builders::StructsInputBuilder {
   54     63   
        &self.inner
   55     64   
    }
          65  +
    /* FluentBuilderGenerator.kt:145 */
   56     66   
    /// Sends the request and returns the response.
   57     67   
    ///
   58     68   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   59     69   
    /// can be matched against.
   60     70   
    ///
   61     71   
    /// By default, any retryable failures will be retried twice. Retry behavior
   62     72   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   63     73   
    /// set when configuring the client.
   64     74   
    pub async fn send(
   65     75   
        self,
   66     76   
    ) -> ::std::result::Result<
   67     77   
        crate::operation::structs::StructsOutput,
   68     78   
        ::aws_smithy_runtime_api::client::result::SdkError<
   69     79   
            crate::operation::structs::StructsError,
   70     80   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   71     81   
        >,
   72     82   
    > {
   73     83   
        let input = self
   74     84   
            .inner
   75     85   
            .build()
   76     86   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   77     87   
        let runtime_plugins = crate::operation::structs::Structs::operation_runtime_plugins(
   78     88   
            self.handle.runtime_plugins.clone(),
   79     89   
            &self.handle.conf,
   80     90   
            self.config_override,
   81     91   
        );
   82     92   
        crate::operation::structs::Structs::orchestrate(&runtime_plugins, input).await
   83     93   
    }
   84     94   
   85     95   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   86     96   
    pub fn customize(
   87     97   
        self,
   88     98   
    ) -> crate::client::customize::CustomizableOperation<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError, Self>
   89     99   
    {
   90    100   
        crate::client::customize::CustomizableOperation::new(self)
   91    101   
    }
         102  +
    /* FluentBuilderGenerator.kt:315 */
   92    103   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
   93    104   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
   94    105   
        self
   95    106   
    }
   96    107   
   97    108   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
   98    109   
        self.config_override = config_override;
   99    110   
        self
  100    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:498 */
  101    113   
    #[allow(missing_docs)] // documentation missing in model
         114  +
                           /* FluentBuilderGenerator.kt:500 */
  102    115   
    pub fn result(mut self, input: crate::types::Result) -> Self {
  103    116   
        self.inner = self.inner.result(input);
  104    117   
        self
  105    118   
    }
         119  +
    /* FluentBuilderGenerator.kt:498 */
  106    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* FluentBuilderGenerator.kt:500 */
  107    122   
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::Result>) -> Self {
  108    123   
        self.inner = self.inner.set_result(input);
  109    124   
        self
  110    125   
    }
         126  +
    /* FluentBuilderGenerator.kt:518 */
  111    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* FluentBuilderGenerator.kt:520 */
  112    129   
    pub fn get_result(&self) -> &::std::option::Option<crate::types::Result> {
  113    130   
        self.inner.get_result()
  114    131   
    }
  115         -
    ///
         132  +
    /// /* FluentBuilderGenerator.kt:436 */
  116    133   
    /// Appends an item to `resultList`.
  117    134   
    ///
  118    135   
    /// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
  119    136   
    ///
         137  +
    /* FluentBuilderGenerator.kt:443 */
  120    138   
    #[allow(missing_docs)] // documentation missing in model
         139  +
                           /* FluentBuilderGenerator.kt:446 */
  121    140   
    pub fn result_list(mut self, input: crate::types::Result) -> Self {
  122    141   
        self.inner = self.inner.result_list(input);
  123    142   
        self
  124    143   
    }
         144  +
    /* FluentBuilderGenerator.kt:498 */
  125    145   
    #[allow(missing_docs)] // documentation missing in model
         146  +
                           /* FluentBuilderGenerator.kt:500 */
  126    147   
    pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
  127    148   
        self.inner = self.inner.set_result_list(input);
  128    149   
        self
  129    150   
    }
         151  +
    /* FluentBuilderGenerator.kt:518 */
  130    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* FluentBuilderGenerator.kt:520 */
  131    154   
    pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
  132    155   
        self.inner.get_result_list()
  133    156   
    }
         157  +
    /* FluentBuilderGenerator.kt:498 */
  134    158   
    #[allow(missing_docs)] // documentation missing in model
         159  +
                           /* FluentBuilderGenerator.kt:500 */
  135    160   
    pub fn option(mut self, input: crate::types::Option) -> Self {
  136    161   
        self.inner = self.inner.option(input);
  137    162   
        self
  138    163   
    }
         164  +
    /* FluentBuilderGenerator.kt:498 */
  139    165   
    #[allow(missing_docs)] // documentation missing in model
         166  +
                           /* FluentBuilderGenerator.kt:500 */
  140    167   
    pub fn set_option(mut self, input: ::std::option::Option<crate::types::Option>) -> Self {
  141    168   
        self.inner = self.inner.set_option(input);
  142    169   
        self
  143    170   
    }
         171  +
    /* FluentBuilderGenerator.kt:518 */
  144    172   
    #[allow(missing_docs)] // documentation missing in model
         173  +
                           /* FluentBuilderGenerator.kt:520 */
  145    174   
    pub fn get_option(&self) -> &::std::option::Option<crate::types::Option> {
  146    175   
        self.inner.get_option()
  147    176   
    }
  148         -
    ///
         177  +
    /// /* FluentBuilderGenerator.kt:436 */
  149    178   
    /// Appends an item to `optionList`.
  150    179   
    ///
  151    180   
    /// To override the contents of this collection use [`set_option_list`](Self::set_option_list).
  152    181   
    ///
         182  +
    /* FluentBuilderGenerator.kt:443 */
  153    183   
    #[allow(missing_docs)] // documentation missing in model
         184  +
                           /* FluentBuilderGenerator.kt:446 */
  154    185   
    pub fn option_list(mut self, input: crate::types::Result) -> Self {
  155    186   
        self.inner = self.inner.option_list(input);
  156    187   
        self
  157    188   
    }
         189  +
    /* FluentBuilderGenerator.kt:498 */
  158    190   
    #[allow(missing_docs)] // documentation missing in model
         191  +
                           /* FluentBuilderGenerator.kt:500 */
  159    192   
    pub fn set_option_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
  160    193   
        self.inner = self.inner.set_option_list(input);
  161    194   
        self
  162    195   
    }
         196  +
    /* FluentBuilderGenerator.kt:518 */
  163    197   
    #[allow(missing_docs)] // documentation missing in model
         198  +
                           /* FluentBuilderGenerator.kt:520 */
  164    199   
    pub fn get_option_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
  165    200   
        self.inner.get_option_list()
  166    201   
    }
         202  +
    /* FluentBuilderGenerator.kt:498 */
  167    203   
    #[allow(missing_docs)] // documentation missing in model
         204  +
                           /* FluentBuilderGenerator.kt:500 */
  168    205   
    pub fn something_else(mut self, input: crate::types::SomethingElse) -> Self {
  169    206   
        self.inner = self.inner.something_else(input);
  170    207   
        self
  171    208   
    }
         209  +
    /* FluentBuilderGenerator.kt:498 */
  172    210   
    #[allow(missing_docs)] // documentation missing in model
         211  +
                           /* FluentBuilderGenerator.kt:500 */
  173    212   
    pub fn set_something_else(mut self, input: ::std::option::Option<crate::types::SomethingElse>) -> Self {
  174    213   
        self.inner = self.inner.set_something_else(input);
  175    214   
        self
  176    215   
    }
         216  +
    /* FluentBuilderGenerator.kt:518 */
  177    217   
    #[allow(missing_docs)] // documentation missing in model
         218  +
                           /* FluentBuilderGenerator.kt:520 */
  178    219   
    pub fn get_something_else(&self) -> &::std::option::Option<crate::types::SomethingElse> {
  179    220   
        self.inner.get_something_else()
  180    221   
    }
         222  +
    /* FluentBuilderGenerator.kt:282 */
  181    223   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/primitives.rs

@@ -1,1 +7,8 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
    3      4   
pub use ::aws_smithy_types::Blob;
    4         -
pub use ::aws_smithy_types::DateTime;
           5  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
    5      6   
    6         -
/// Event stream related primitives such as `Message` or `Header`.
           7  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
    7      8   
pub mod event_stream;

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

@@ -1,1 +48,51 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ResponseDeserializerGenerator.kt:170 */
    2      3   
pub(crate) fn type_erase_result<O, E>(
    3      4   
    result: ::std::result::Result<O, E>,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6      7   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7      8   
>
    8      9   
where
    9     10   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     11   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     12   
{
   12     13   
    result
   13     14   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     15   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     16   
        .map_err(::std::convert::Into::into)
   16     17   
}
   17     18   
          19  +
/* AwsJson.kt:203 */
   18     20   
pub fn parse_http_error_metadata(
   19     21   
    _response_status: u16,
   20     22   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     23   
    response_body: &[u8],
   22     24   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23     25   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24     26   
}
   25     27   
   26     28   
pub(crate) mod shape_structs;
   27     29   
          30  +
/* JsonParserGenerator.kt:227 */
   28     31   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   29     32   
    if data.is_empty() {
   30     33   
        b"{}"
   31     34   
    } else {
   32     35   
        data
   33     36   
    }
   34     37   
}
   35     38   
   36     39   
pub(crate) mod shape_structs_input;
   37     40   

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_option.rs

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

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

@@ -1,1 +32,55 @@
    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<Option<::std::vec::Vec<crate::types::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_result::de_result(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

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

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

@@ -1,1 +32,55 @@
    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<Option<::std::vec::Vec<crate::types::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_result::de_result(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

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

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

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

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_structs.rs

@@ -1,1 +82,151 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_structs_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::structs::StructsError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::structs::StructsError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_structs_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::structs::builders::StructsOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output =
   25     38   
            crate::protocol_serde::shape_structs::de_structs(_response_body, output).map_err(crate::operation::structs::StructsError::unhandled)?;
          39  +
        /* ClientBuilderInstantiator.kt:56 */
   26     40   
        output.build()
          41  +
        /* ProtocolParserGenerator.kt:77 */
   27     42   
    })
          43  +
    /* ProtocolParserGenerator.kt:71 */
   28     44   
}
   29     45   
          46  +
/* JsonSerializerGenerator.kt:287 */
   30     47   
pub fn ser_structs_input(
   31     48   
    input: &crate::operation::structs::StructsInput,
   32     49   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          50  +
    /* JsonSerializerGenerator.kt:291 */
   33     51   
    let mut out = String::new();
          52  +
    /* JsonSerializerGenerator.kt:292 */
   34     53   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          54  +
    /* JsonSerializerGenerator.kt:375 */
   35     55   
    crate::protocol_serde::shape_structs_input::ser_structs_input_input(&mut object, input)?;
          56  +
    /* JsonSerializerGenerator.kt:295 */
   36     57   
    object.finish();
          58  +
    /* JsonSerializerGenerator.kt:296 */
   37     59   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          60  +
    /* JsonSerializerGenerator.kt:287 */
   38     61   
}
   39     62   
          63  +
/* JsonParserGenerator.kt:148 */
   40     64   
pub(crate) fn de_structs(
   41     65   
    value: &[u8],
   42     66   
    mut builder: crate::operation::structs::builders::StructsOutputBuilder,
   43     67   
) -> ::std::result::Result<crate::operation::structs::builders::StructsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
          68  +
    /* JsonParserGenerator.kt:153 */
   44     69   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   45     70   
    let tokens = &mut tokens_owned;
   46     71   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          72  +
    /* JsonParserGenerator.kt:684 */
   47     73   
    loop {
          74  +
        /* JsonParserGenerator.kt:685 */
   48     75   
        match tokens.next().transpose()? {
   49         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   50         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   51         -
                "result" => {
   52         -
                    builder = builder.set_result(crate::protocol_serde::shape_result::de_result(tokens)?);
          76  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          77  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          78  +
                /* JsonParserGenerator.kt:260 */
          79  +
                match key.to_unescaped()?.as_ref() {
          80  +
                    /* JsonParserGenerator.kt:262 */
          81  +
                    "result" => {
          82  +
                        /* JsonParserGenerator.kt:265 */
          83  +
                        builder = builder.set_result(
          84  +
                            /* JsonParserGenerator.kt:544 */
          85  +
                            crate::protocol_serde::shape_result::de_result(tokens)?, /* JsonParserGenerator.kt:265 */
          86  +
                        );
          87  +
                        /* JsonParserGenerator.kt:262 */
          88  +
                    }
          89  +
                    /* JsonParserGenerator.kt:262 */
          90  +
                    "resultList" => {
          91  +
                        /* JsonParserGenerator.kt:265 */
          92  +
                        builder = builder.set_result_list(
          93  +
                            /* JsonParserGenerator.kt:451 */
          94  +
                            crate::protocol_serde::shape_result_list::de_result_list(tokens)?, /* JsonParserGenerator.kt:265 */
          95  +
                        );
          96  +
                        /* JsonParserGenerator.kt:262 */
          97  +
                    }
          98  +
                    /* JsonParserGenerator.kt:262 */
          99  +
                    "option" => {
         100  +
                        /* JsonParserGenerator.kt:265 */
         101  +
                        builder = builder.set_option(
         102  +
                            /* JsonParserGenerator.kt:544 */
         103  +
                            crate::protocol_serde::shape_option::de_option(tokens)?, /* JsonParserGenerator.kt:265 */
         104  +
                        );
         105  +
                        /* JsonParserGenerator.kt:262 */
         106  +
                    }
         107  +
                    /* JsonParserGenerator.kt:262 */
         108  +
                    "optionList" => {
         109  +
                        /* JsonParserGenerator.kt:265 */
         110  +
                        builder = builder.set_option_list(
         111  +
                            /* JsonParserGenerator.kt:451 */
         112  +
                            crate::protocol_serde::shape_option_list::de_option_list(tokens)?, /* JsonParserGenerator.kt:265 */
         113  +
                        );
         114  +
                        /* JsonParserGenerator.kt:262 */
         115  +
                    }
         116  +
                    /* JsonParserGenerator.kt:262 */
         117  +
                    "somethingElse" => {
         118  +
                        /* JsonParserGenerator.kt:265 */
         119  +
                        builder = builder.set_something_else(
         120  +
                            /* JsonParserGenerator.kt:544 */
         121  +
                            crate::protocol_serde::shape_something_else::de_something_else(tokens)?, /* JsonParserGenerator.kt:265 */
         122  +
                        );
         123  +
                        /* JsonParserGenerator.kt:262 */
         124  +
                    }
         125  +
                    /* JsonParserGenerator.kt:290 */
         126  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   53    127   
                }
   54         -
                "resultList" => {
   55         -
                    builder = builder.set_result_list(crate::protocol_serde::shape_result_list::de_result_list(tokens)?);
   56         -
                }
   57         -
                "option" => {
   58         -
                    builder = builder.set_option(crate::protocol_serde::shape_option::de_option(tokens)?);
   59         -
                }
   60         -
                "optionList" => {
   61         -
                    builder = builder.set_option_list(crate::protocol_serde::shape_option_list::de_option_list(tokens)?);
   62         -
                }
   63         -
                "somethingElse" => {
   64         -
                    builder = builder.set_something_else(crate::protocol_serde::shape_something_else::de_something_else(tokens)?);
   65         -
                }
   66         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   67         -
            },
         128  +
                /* JsonParserGenerator.kt:686 */
         129  +
            }
         130  +
            /* JsonParserGenerator.kt:695 */
   68    131   
            other => {
   69    132   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   70    133   
                    "expected object key or end object, found: {:?}",
   71    134   
                    other
   72    135   
                )))
   73         -
            }
         136  +
            } /* JsonParserGenerator.kt:685 */
   74    137   
        }
         138  +
        /* JsonParserGenerator.kt:684 */
   75    139   
    }
         140  +
    /* JsonParserGenerator.kt:250 */
   76    141   
    if tokens.next().is_some() {
         142  +
        /* JsonParserGenerator.kt:251 */
   77    143   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   78    144   
            "found more JSON tokens after completing parsing",
   79    145   
        ));
         146  +
        /* JsonParserGenerator.kt:250 */
   80    147   
    }
         148  +
    /* JsonParserGenerator.kt:163 */
   81    149   
    Ok(builder)
         150  +
    /* JsonParserGenerator.kt:148 */
   82    151   
}