Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/put_with_content_encoding/_put_with_content_encoding_output.rs

@@ -1,1 +22,39 @@
    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 PutWithContentEncodingOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct PutWithContentEncodingOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl PutWithContentEncodingOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct PutWithContentEncodingOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct PutWithContentEncodingOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl PutWithContentEncodingOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PutWithContentEncodingOutput`](crate::operation::put_with_content_encoding::PutWithContentEncodingOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::put_with_content_encoding::PutWithContentEncodingOutput {
   20         -
        crate::operation::put_with_content_encoding::PutWithContentEncodingOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::put_with_content_encoding::PutWithContentEncodingOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/put_with_content_encoding/builders.rs

@@ -1,1 +138,162 @@
    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::put_with_content_encoding::_put_with_content_encoding_output::PutWithContentEncodingOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::put_with_content_encoding::_put_with_content_encoding_input::PutWithContentEncodingInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder {
    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::put_with_content_encoding::PutWithContentEncodingOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.put_with_content_encoding();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `PutWithContentEncoding`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `PutWithContentEncoding`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct PutWithContentEncodingFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   34     40   
        crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   35     41   
    > for PutWithContentEncodingFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   43     49   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl PutWithContentEncodingFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `PutWithContentEncodingFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the PutWithContentEncoding as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::put_with_content_encoding::PutWithContentEncoding::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::put_with_content_encoding::PutWithContentEncoding::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   96    106   
        crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn encoding(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.encoding(input.into());
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_encoding(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_encoding(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_encoding(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_encoding()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:498 */
  124    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:500 */
  125    144   
    pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  126    145   
        self.inner = self.inner.data(input.into());
  127    146   
        self
  128    147   
    }
         148  +
    /* FluentBuilderGenerator.kt:498 */
  129    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* FluentBuilderGenerator.kt:500 */
  130    151   
    pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  131    152   
        self.inner = self.inner.set_data(input);
  132    153   
        self
  133    154   
    }
         155  +
    /* FluentBuilderGenerator.kt:518 */
  134    156   
    #[allow(missing_docs)] // documentation missing in model
         157  +
                           /* FluentBuilderGenerator.kt:520 */
  135    158   
    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
  136    159   
        self.inner.get_data()
  137    160   
    }
         161  +
    /* FluentBuilderGenerator.kt:282 */
  138    162   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties.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 `SimpleScalarProperties`.
           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 SimpleScalarProperties;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl SimpleScalarProperties {
    7         -
    /// Creates a new `SimpleScalarProperties`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `SimpleScalarProperties`
          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::simple_scalar_properties::SimpleScalarPropertiesInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +276,293 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SimpleScalarProperties {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SimpleScalarProperties");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            SimpleScalarPropertiesRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            SimpleScalarPropertiesResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "SimpleScalarProperties",
  111    122   
            "JSON RPC 10",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("SimpleScalarProperties")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(SimpleScalarPropertiesEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct SimpleScalarPropertiesResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SimpleScalarPropertiesResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct SimpleScalarPropertiesRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SimpleScalarPropertiesRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  193    206   
            builder = _header_serialization_settings.set_default_header(
  194    207   
                builder,
  195    208   
                ::http::header::HeaderName::from_static("x-amz-target"),
  196    209   
                "JsonRpc10.SimpleScalarProperties",
  197    210   
            );
  198    211   
            builder
  199    212   
        };
  200    213   
        let body = ::aws_smithy_types::body::SdkBody::from(
  201    214   
            crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_input(&input)?,
  202    215   
        );
  203    216   
        if let Some(content_length) = body.content_length() {
  204    217   
            let content_length = content_length.to_string();
  205    218   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  206    219   
        }
  207    220   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  208    221   
    }
  209    222   
}
         223  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  210    224   
#[derive(Debug)]
  211    225   
struct SimpleScalarPropertiesEndpointParamsInterceptor;
  212    226   
  213    227   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SimpleScalarPropertiesEndpointParamsInterceptor {
  214    228   
    fn name(&self) -> &'static str {
  215    229   
        "SimpleScalarPropertiesEndpointParamsInterceptor"
  216    230   
    }
  217    231   
  218    232   
    fn read_before_execution(
  219    233   
        &self,
  220    234   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  221    235   
            '_,
  222    236   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  224    238   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  225    239   
        >,
  226    240   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  227    241   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  228    242   
        let _input = context
  229    243   
            .input()
  230    244   
            .downcast_ref::<SimpleScalarPropertiesInput>()
  231    245   
            .ok_or("failed to downcast to SimpleScalarPropertiesInput")?;
  232    246   
  233    247   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  234    248   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  235    249   
        })?;
  236    250   
        cfg.interceptor_state()
  237    251   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  238    252   
        ::std::result::Result::Ok(())
  239    253   
    }
  240    254   
}
  241    255   
  242    256   
// The get_* functions below are generated from JMESPath expressions in the
  243    257   
// operationContextParams trait. They target the operation's input shape.
  244    258   
         259  +
/* RustType.kt:516 */
  245    260   
#[allow(unreachable_code, unused_variables)]
         261  +
/* RustType.kt:516 */
  246    262   
#[cfg(test)]
         263  +
/* ProtocolTestGenerator.kt:98 */
  247    264   
mod simple_scalar_properties_test {
  248    265   
    use ::aws_smithy_protocol_test::FloatEquals;
  249    266   
  250    267   
    /// Supports handling NaN float values.
  251    268   
    /// Test ID: AwsJson10SupportsNaNFloatInputs
  252    269   
    #[::tokio::test]
  253    270   
    #[::tracing_test::traced_test]
  254    271   
    async fn aws_json10_supports_na_n_float_inputs_request() {
  255    272   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  256    273   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
@@ -510,527 +639,715 @@
  530    547   
            expected_output.float_value,
  531    548   
            parsed.float_value
  532    549   
        );
  533    550   
        assert!(
  534    551   
            parsed.double_value.float_equals(&expected_output.double_value),
  535    552   
            "Unexpected value for `double_value` {:?} vs. {:?}",
  536    553   
            expected_output.double_value,
  537    554   
            parsed.double_value
  538    555   
        );
  539    556   
    }
         557  +
         558  +
    /* ProtocolTestGenerator.kt:98 */
  540    559   
}
  541    560   
         561  +
/* OperationErrorGenerator.kt:79 */
  542    562   
/// Error type for the `SimpleScalarPropertiesError` operation.
         563  +
/* RustType.kt:516 */
  543    564   
#[non_exhaustive]
         565  +
/* RustType.kt:516 */
  544    566   
#[derive(::std::fmt::Debug)]
  545         -
pub enum SimpleScalarPropertiesError {
         567  +
pub /* OperationErrorGenerator.kt:81 */ enum SimpleScalarPropertiesError {
         568  +
    /* OperationErrorGenerator.kt:88 */
  546    569   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  547    570   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  548    571   
    variable wildcard pattern and check `.code()`:
  549    572   
     \
  550    573   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  551    574   
     \
  552    575   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SimpleScalarPropertiesError) for what information is available for the error.")]
  553    576   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         577  +
    /* OperationErrorGenerator.kt:81 */
  554    578   
}
         579  +
/* OperationErrorGenerator.kt:218 */
  555    580   
impl SimpleScalarPropertiesError {
         581  +
    /* OperationErrorGenerator.kt:219 */
  556    582   
    /// Creates the `SimpleScalarPropertiesError::Unhandled` variant from any error type.
  557    583   
    pub fn unhandled(
  558    584   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  559    585   
    ) -> Self {
  560    586   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  561    587   
            source: err.into(),
  562    588   
            meta: ::std::default::Default::default(),
  563    589   
        })
  564    590   
    }
  565    591   
  566    592   
    /// Creates the `SimpleScalarPropertiesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  567    593   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  568    594   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  569    595   
            source: err.clone().into(),
  570    596   
            meta: err,
  571    597   
        })
  572    598   
    }
  573         -
    ///
         599  +
    /// /* OperationErrorGenerator.kt:236 */
  574    600   
    /// Returns error metadata, which includes the error code, message,
  575    601   
    /// request ID, and potentially additional information.
  576    602   
    ///
         603  +
    /* OperationErrorGenerator.kt:242 */
  577    604   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         605  +
        /* OperationErrorGenerator.kt:243 */
  578    606   
        match self {
  579         -
            Self::Unhandled(e) => &e.meta,
         607  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         608  +
            /* OperationErrorGenerator.kt:243 */
  580    609   
        }
         610  +
        /* OperationErrorGenerator.kt:242 */
  581    611   
    }
         612  +
    /* OperationErrorGenerator.kt:218 */
  582    613   
}
         614  +
/* OperationErrorGenerator.kt:269 */
  583    615   
impl ::std::error::Error for SimpleScalarPropertiesError {
         616  +
    /* OperationErrorGenerator.kt:270 */
  584    617   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         618  +
        /* OperationErrorGenerator.kt:318 */
  585    619   
        match self {
  586         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         620  +
            /* OperationErrorGenerator.kt:326 */
         621  +
            Self::Unhandled(_inner) => {
         622  +
                /* OperationErrorGenerator.kt:279 */
         623  +
                ::std::option::Option::Some(&*_inner.source)
         624  +
                /* OperationErrorGenerator.kt:326 */
         625  +
            } /* OperationErrorGenerator.kt:318 */
  587    626   
        }
         627  +
        /* OperationErrorGenerator.kt:270 */
  588    628   
    }
         629  +
    /* OperationErrorGenerator.kt:269 */
  589    630   
}
         631  +
/* OperationErrorGenerator.kt:133 */
  590    632   
impl ::std::fmt::Display for SimpleScalarPropertiesError {
         633  +
    /* OperationErrorGenerator.kt:134 */
  591    634   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         635  +
        /* OperationErrorGenerator.kt:318 */
  592    636   
        match self {
         637  +
            /* OperationErrorGenerator.kt:326 */
  593    638   
            Self::Unhandled(_inner) => {
         639  +
                /* OperationErrorGenerator.kt:139 */
  594    640   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  595    641   
                    write!(f, "unhandled error ({code})")
  596    642   
                } else {
  597    643   
                    f.write_str("unhandled error")
  598    644   
                }
         645  +
                /* OperationErrorGenerator.kt:326 */
         646  +
            } /* OperationErrorGenerator.kt:318 */
  599    647   
        }
         648  +
        /* OperationErrorGenerator.kt:134 */
  600    649   
    }
  601         -
    }
         650  +
    /* OperationErrorGenerator.kt:133 */
  602    651   
}
         652  +
/* OperationErrorGenerator.kt:182 */
  603    653   
impl ::aws_smithy_types::retry::ProvideErrorKind for SimpleScalarPropertiesError {
         654  +
    /* OperationErrorGenerator.kt:186 */
  604    655   
    fn code(&self) -> ::std::option::Option<&str> {
         656  +
        /* OperationErrorGenerator.kt:187 */
  605    657   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         658  +
        /* OperationErrorGenerator.kt:186 */
  606    659   
    }
         660  +
    /* OperationErrorGenerator.kt:190 */
  607    661   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         662  +
        /* OperationErrorGenerator.kt:197 */
  608    663   
        ::std::option::Option::None
         664  +
        /* OperationErrorGenerator.kt:190 */
  609    665   
    }
         666  +
    /* OperationErrorGenerator.kt:182 */
  610    667   
}
         668  +
/* OperationErrorGenerator.kt:163 */
  611    669   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SimpleScalarPropertiesError {
         670  +
    /* OperationErrorGenerator.kt:164 */
  612    671   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         672  +
        /* OperationErrorGenerator.kt:318 */
  613    673   
        match self {
  614         -
            Self::Unhandled(_inner) => &_inner.meta,
         674  +
            /* OperationErrorGenerator.kt:326 */
         675  +
            Self::Unhandled(_inner) => {
         676  +
                /* OperationErrorGenerator.kt:168 */
         677  +
                &_inner.meta
         678  +
                /* OperationErrorGenerator.kt:326 */
         679  +
            } /* OperationErrorGenerator.kt:318 */
  615    680   
        }
         681  +
        /* OperationErrorGenerator.kt:164 */
  616    682   
    }
         683  +
    /* OperationErrorGenerator.kt:163 */
  617    684   
}
         685  +
/* OperationErrorGenerator.kt:109 */
  618    686   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SimpleScalarPropertiesError {
         687  +
    /* OperationErrorGenerator.kt:110 */
  619    688   
    fn create_unhandled_error(
  620    689   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  621    690   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  622    691   
    ) -> Self {
         692  +
        /* OperationErrorGenerator.kt:121 */
  623    693   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  624    694   
            source,
  625    695   
            meta: meta.unwrap_or_default(),
  626    696   
        })
         697  +
        /* OperationErrorGenerator.kt:110 */
  627    698   
    }
         699  +
    /* OperationErrorGenerator.kt:109 */
  628    700   
}
  629    701   
         702  +
/* CodegenDelegator.kt:255 */
  630    703   
pub use crate::operation::simple_scalar_properties::_simple_scalar_properties_output::SimpleScalarPropertiesOutput;
  631    704   
         705  +
/* CodegenDelegator.kt:255 */
  632    706   
pub use crate::operation::simple_scalar_properties::_simple_scalar_properties_input::SimpleScalarPropertiesInput;
  633    707   
         708  +
/* RustModule.kt:172 */
  634    709   
mod _simple_scalar_properties_input;
  635    710   
         711  +
/* RustModule.kt:172 */
  636    712   
mod _simple_scalar_properties_output;
  637    713   
  638         -
/// Builders
         714  +
/// /* CodegenDelegator.kt:51 */Builders
  639    715   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_input.rs

@@ -1,1 +76,136 @@
    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 SimpleScalarPropertiesInput {
    6         -
    #[allow(missing_docs)] // documentation missing in model
           8  +
pub /* StructureGenerator.kt:201 */ struct SimpleScalarPropertiesInput {
           9  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
    7     10   
    pub float_value: ::std::option::Option<f32>,
          11  +
    /* StructureGenerator.kt:231 */
    8     12   
    #[allow(missing_docs)] // documentation missing in model
    9     13   
    pub double_value: ::std::option::Option<f64>,
          14  +
    /* StructureGenerator.kt:201 */
   10     15   
}
          16  +
/* StructureGenerator.kt:135 */
   11     17   
impl SimpleScalarPropertiesInput {
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
          20  +
                           /* StructureGenerator.kt:166 */
   13     21   
    pub fn float_value(&self) -> ::std::option::Option<f32> {
          22  +
        /* StructureGenerator.kt:168 */
   14     23   
        self.float_value
          24  +
        /* StructureGenerator.kt:166 */
   15     25   
    }
          26  +
    /* StructureGenerator.kt:231 */
   16     27   
    #[allow(missing_docs)] // documentation missing in model
          28  +
                           /* StructureGenerator.kt:166 */
   17     29   
    pub fn double_value(&self) -> ::std::option::Option<f64> {
          30  +
        /* StructureGenerator.kt:168 */
   18     31   
        self.double_value
          32  +
        /* StructureGenerator.kt:166 */
   19     33   
    }
          34  +
    /* StructureGenerator.kt:135 */
   20     35   
}
          36  +
/* ClientCodegenVisitor.kt:237 */
   21     37   
impl SimpleScalarPropertiesInput {
   22         -
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
          38  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
          39  +
    /* BuilderGenerator.kt:175 */
   23     40   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder {
          41  +
        /* BuilderGenerator.kt:176 */
   24     42   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder::default()
          43  +
        /* BuilderGenerator.kt:175 */
   25     44   
    }
          45  +
    /* ClientCodegenVisitor.kt:237 */
   26     46   
}
   27     47   
   28         -
/// A builder for [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
          48  +
/// /* BuilderGenerator.kt:342 */A builder for [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
          49  +
/* RustType.kt:516 */
   29     50   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          51  +
/* RustType.kt:516 */
   30     52   
#[non_exhaustive]
          53  +
/* BuilderGenerator.kt:345 */
   31     54   
pub struct SimpleScalarPropertiesInputBuilder {
   32         -
    pub(crate) float_value: ::std::option::Option<f32>,
   33         -
    pub(crate) double_value: ::std::option::Option<f64>,
          55  +
    /* BuilderGenerator.kt:275 */ pub(crate) float_value: ::std::option::Option<f32>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) double_value: ::std::option::Option<f64>,
          57  +
    /* BuilderGenerator.kt:345 */
   34     58   
}
          59  +
/* BuilderGenerator.kt:355 */
   35     60   
impl SimpleScalarPropertiesInputBuilder {
          61  +
    /* BuilderGenerator.kt:286 */
   36     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:291 */
   37     64   
    pub fn float_value(mut self, input: f32) -> Self {
          65  +
        /* BuilderGenerator.kt:292 */
   38     66   
        self.float_value = ::std::option::Option::Some(input);
          67  +
        /* BuilderGenerator.kt:293 */
   39     68   
        self
          69  +
        /* BuilderGenerator.kt:291 */
   40     70   
    }
          71  +
    /* BuilderGenerator.kt:312 */
   41     72   
    #[allow(missing_docs)] // documentation missing in model
          73  +
                           /* BuilderGenerator.kt:314 */
   42     74   
    pub fn set_float_value(mut self, input: ::std::option::Option<f32>) -> Self {
          75  +
        /* BuilderGenerator.kt:315 */
   43     76   
        self.float_value = input;
   44     77   
        self
          78  +
        /* BuilderGenerator.kt:314 */
   45     79   
    }
          80  +
    /* BuilderGenerator.kt:334 */
   46     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:336 */
   47     83   
    pub fn get_float_value(&self) -> &::std::option::Option<f32> {
          84  +
        /* BuilderGenerator.kt:337 */
   48     85   
        &self.float_value
          86  +
        /* BuilderGenerator.kt:336 */
   49     87   
    }
          88  +
    /* BuilderGenerator.kt:286 */
   50     89   
    #[allow(missing_docs)] // documentation missing in model
          90  +
                           /* BuilderGenerator.kt:291 */
   51     91   
    pub fn double_value(mut self, input: f64) -> Self {
          92  +
        /* BuilderGenerator.kt:292 */
   52     93   
        self.double_value = ::std::option::Option::Some(input);
          94  +
        /* BuilderGenerator.kt:293 */
   53     95   
        self
          96  +
        /* BuilderGenerator.kt:291 */
   54     97   
    }
          98  +
    /* BuilderGenerator.kt:312 */
   55     99   
    #[allow(missing_docs)] // documentation missing in model
         100  +
                           /* BuilderGenerator.kt:314 */
   56    101   
    pub fn set_double_value(mut self, input: ::std::option::Option<f64>) -> Self {
         102  +
        /* BuilderGenerator.kt:315 */
   57    103   
        self.double_value = input;
   58    104   
        self
         105  +
        /* BuilderGenerator.kt:314 */
   59    106   
    }
         107  +
    /* BuilderGenerator.kt:334 */
   60    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:336 */
   61    110   
    pub fn get_double_value(&self) -> &::std::option::Option<f64> {
         111  +
        /* BuilderGenerator.kt:337 */
   62    112   
        &self.double_value
         113  +
        /* BuilderGenerator.kt:336 */
   63    114   
    }
   64         -
    /// Consumes the builder and constructs a [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
         115  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`SimpleScalarPropertiesInput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput).
         116  +
    /* BuilderGenerator.kt:253 */
   65    117   
    pub fn build(
   66    118   
        self,
   67    119   
    ) -> ::std::result::Result<
   68    120   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   69    121   
        ::aws_smithy_types::error::operation::BuildError,
   70    122   
    > {
   71         -
        ::std::result::Result::Ok(crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput {
   72         -
            float_value: self.float_value,
         123  +
        /* BuilderGenerator.kt:254 */
         124  +
        ::std::result::Result::Ok(
         125  +
            /* BuilderGenerator.kt:477 */
         126  +
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput {
         127  +
                /* BuilderGenerator.kt:481 */ float_value: self.float_value,
         128  +
                /* BuilderGenerator.kt:481 */
   73    129   
                double_value: self.double_value,
   74         -
        })
         130  +
                /* BuilderGenerator.kt:477 */
         131  +
            }, /* BuilderGenerator.kt:254 */
         132  +
        )
         133  +
        /* BuilderGenerator.kt:253 */
   75    134   
    }
         135  +
    /* BuilderGenerator.kt:355 */
   76    136   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/_simple_scalar_properties_output.rs

@@ -1,1 +71,128 @@
    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 SimpleScalarPropertiesOutput {
    6         -
    #[allow(missing_docs)] // documentation missing in model
           8  +
pub /* StructureGenerator.kt:201 */ struct SimpleScalarPropertiesOutput {
           9  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
    7     10   
    pub float_value: ::std::option::Option<f32>,
          11  +
    /* StructureGenerator.kt:231 */
    8     12   
    #[allow(missing_docs)] // documentation missing in model
    9     13   
    pub double_value: ::std::option::Option<f64>,
          14  +
    /* StructureGenerator.kt:201 */
   10     15   
}
          16  +
/* StructureGenerator.kt:135 */
   11     17   
impl SimpleScalarPropertiesOutput {
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
          20  +
                           /* StructureGenerator.kt:166 */
   13     21   
    pub fn float_value(&self) -> ::std::option::Option<f32> {
          22  +
        /* StructureGenerator.kt:168 */
   14     23   
        self.float_value
          24  +
        /* StructureGenerator.kt:166 */
   15     25   
    }
          26  +
    /* StructureGenerator.kt:231 */
   16     27   
    #[allow(missing_docs)] // documentation missing in model
          28  +
                           /* StructureGenerator.kt:166 */
   17     29   
    pub fn double_value(&self) -> ::std::option::Option<f64> {
          30  +
        /* StructureGenerator.kt:168 */
   18     31   
        self.double_value
          32  +
        /* StructureGenerator.kt:166 */
   19     33   
    }
          34  +
    /* StructureGenerator.kt:135 */
   20     35   
}
          36  +
/* ClientCodegenVisitor.kt:237 */
   21     37   
impl SimpleScalarPropertiesOutput {
   22         -
    /// Creates a new builder-style object to manufacture [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
          38  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
          39  +
    /* BuilderGenerator.kt:175 */
   23     40   
    pub fn builder() -> crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder {
          41  +
        /* BuilderGenerator.kt:176 */
   24     42   
        crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default()
          43  +
        /* BuilderGenerator.kt:175 */
   25     44   
    }
          45  +
    /* ClientCodegenVisitor.kt:237 */
   26     46   
}
   27     47   
   28         -
/// A builder for [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
          48  +
/// /* BuilderGenerator.kt:342 */A builder for [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
          49  +
/* RustType.kt:516 */
   29     50   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          51  +
/* RustType.kt:516 */
   30     52   
#[non_exhaustive]
          53  +
/* BuilderGenerator.kt:345 */
   31     54   
pub struct SimpleScalarPropertiesOutputBuilder {
   32         -
    pub(crate) float_value: ::std::option::Option<f32>,
   33         -
    pub(crate) double_value: ::std::option::Option<f64>,
          55  +
    /* BuilderGenerator.kt:275 */ pub(crate) float_value: ::std::option::Option<f32>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) double_value: ::std::option::Option<f64>,
          57  +
    /* BuilderGenerator.kt:345 */
   34     58   
}
          59  +
/* BuilderGenerator.kt:355 */
   35     60   
impl SimpleScalarPropertiesOutputBuilder {
          61  +
    /* BuilderGenerator.kt:286 */
   36     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:291 */
   37     64   
    pub fn float_value(mut self, input: f32) -> Self {
          65  +
        /* BuilderGenerator.kt:292 */
   38     66   
        self.float_value = ::std::option::Option::Some(input);
          67  +
        /* BuilderGenerator.kt:293 */
   39     68   
        self
          69  +
        /* BuilderGenerator.kt:291 */
   40     70   
    }
          71  +
    /* BuilderGenerator.kt:312 */
   41     72   
    #[allow(missing_docs)] // documentation missing in model
          73  +
                           /* BuilderGenerator.kt:314 */
   42     74   
    pub fn set_float_value(mut self, input: ::std::option::Option<f32>) -> Self {
          75  +
        /* BuilderGenerator.kt:315 */
   43     76   
        self.float_value = input;
   44     77   
        self
          78  +
        /* BuilderGenerator.kt:314 */
   45     79   
    }
          80  +
    /* BuilderGenerator.kt:334 */
   46     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:336 */
   47     83   
    pub fn get_float_value(&self) -> &::std::option::Option<f32> {
          84  +
        /* BuilderGenerator.kt:337 */
   48     85   
        &self.float_value
          86  +
        /* BuilderGenerator.kt:336 */
   49     87   
    }
          88  +
    /* BuilderGenerator.kt:286 */
   50     89   
    #[allow(missing_docs)] // documentation missing in model
          90  +
                           /* BuilderGenerator.kt:291 */
   51     91   
    pub fn double_value(mut self, input: f64) -> Self {
          92  +
        /* BuilderGenerator.kt:292 */
   52     93   
        self.double_value = ::std::option::Option::Some(input);
          94  +
        /* BuilderGenerator.kt:293 */
   53     95   
        self
          96  +
        /* BuilderGenerator.kt:291 */
   54     97   
    }
          98  +
    /* BuilderGenerator.kt:312 */
   55     99   
    #[allow(missing_docs)] // documentation missing in model
         100  +
                           /* BuilderGenerator.kt:314 */
   56    101   
    pub fn set_double_value(mut self, input: ::std::option::Option<f64>) -> Self {
         102  +
        /* BuilderGenerator.kt:315 */
   57    103   
        self.double_value = input;
   58    104   
        self
         105  +
        /* BuilderGenerator.kt:314 */
   59    106   
    }
         107  +
    /* BuilderGenerator.kt:334 */
   60    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:336 */
   61    110   
    pub fn get_double_value(&self) -> &::std::option::Option<f64> {
         111  +
        /* BuilderGenerator.kt:337 */
   62    112   
        &self.double_value
         113  +
        /* BuilderGenerator.kt:336 */
   63    114   
    }
   64         -
    /// Consumes the builder and constructs a [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
         115  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`SimpleScalarPropertiesOutput`](crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput).
         116  +
    /* BuilderGenerator.kt:253 */
   65    117   
    pub fn build(self) -> crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput {
         118  +
        /* BuilderGenerator.kt:477 */
   66    119   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput {
   67         -
            float_value: self.float_value,
         120  +
            /* BuilderGenerator.kt:481 */ float_value: self.float_value,
         121  +
            /* BuilderGenerator.kt:481 */
   68    122   
            double_value: self.double_value,
         123  +
            /* BuilderGenerator.kt:477 */
   69    124   
        }
         125  +
        /* BuilderGenerator.kt:253 */
   70    126   
    }
         127  +
    /* BuilderGenerator.kt:355 */
   71    128   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/simple_scalar_properties/builders.rs

@@ -1,1 +138,162 @@
    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::simple_scalar_properties::_simple_scalar_properties_output::SimpleScalarPropertiesOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::simple_scalar_properties::_simple_scalar_properties_input::SimpleScalarPropertiesInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder {
    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::simple_scalar_properties::SimpleScalarPropertiesOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.simple_scalar_properties();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `SimpleScalarProperties`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `SimpleScalarProperties`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct SimpleScalarPropertiesFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   34     40   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   35     41   
    > for SimpleScalarPropertiesFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   43     49   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl SimpleScalarPropertiesFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `SimpleScalarPropertiesFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the SimpleScalarProperties as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::simple_scalar_properties::SimpleScalarProperties::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::simple_scalar_properties::SimpleScalarProperties::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesOutput,
   96    106   
        crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn float_value(mut self, input: f32) -> Self {
  112    125   
        self.inner = self.inner.float_value(input);
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_float_value(mut self, input: ::std::option::Option<f32>) -> Self {
  117    132   
        self.inner = self.inner.set_float_value(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_float_value(&self) -> &::std::option::Option<f32> {
  122    139   
        self.inner.get_float_value()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:498 */
  124    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:500 */
  125    144   
    pub fn double_value(mut self, input: f64) -> Self {
  126    145   
        self.inner = self.inner.double_value(input);
  127    146   
        self
  128    147   
    }
         148  +
    /* FluentBuilderGenerator.kt:498 */
  129    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* FluentBuilderGenerator.kt:500 */
  130    151   
    pub fn set_double_value(mut self, input: ::std::option::Option<f64>) -> Self {
  131    152   
        self.inner = self.inner.set_double_value(input);
  132    153   
        self
  133    154   
    }
         155  +
    /* FluentBuilderGenerator.kt:518 */
  134    156   
    #[allow(missing_docs)] // documentation missing in model
         157  +
                           /* FluentBuilderGenerator.kt:520 */
  135    158   
    pub fn get_double_value(&self) -> &::std::option::Option<f64> {
  136    159   
        self.inner.get_double_value()
  137    160   
    }
         161  +
    /* FluentBuilderGenerator.kt:282 */
  138    162   
}

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

@@ -1,1 +9,10 @@
    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;
    8      9   
    9     10   
pub(crate) mod sealed_enum_unknown;

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

@@ -1,1 +21,29 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Opaque struct used as inner data for the `Unknown` variant defined in enums in
           2  +
/* ClientEnumGenerator.kt:189 */
           3  +
/// /* ClientEnumGenerator.kt:189 */Opaque struct used as inner data for the `Unknown` variant defined in enums in
    4      4   
/// the crate.
    5      5   
///
    6      6   
/// This is not intended to be used directly.
           7  +
/* RustType.kt:516 */
    7      8   
#[non_exhaustive]
           9  +
/* RustType.kt:516 */
    8     10   
#[derive(
    9     11   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   10     12   
)]
   11         -
pub struct UnknownVariantValue(pub(crate) ::std::string::String);
          13  +
pub /* ClientEnumGenerator.kt:203 */ struct UnknownVariantValue(pub(crate) ::std::string::String);
          14  +
/* ClientEnumGenerator.kt:204 */
   12     15   
impl UnknownVariantValue {
          16  +
    /* ClientEnumGenerator.kt:206 */
   13     17   
    pub(crate) fn as_str(&self) -> &str {
          18  +
        /* ClientEnumGenerator.kt:207 */
   14     19   
        &self.0
          20  +
        /* ClientEnumGenerator.kt:206 */
   15     21   
    }
          22  +
    /* ClientEnumGenerator.kt:204 */
   16     23   
}
          24  +
/* ClientEnumGenerator.kt:210 */
   17     25   
impl ::std::fmt::Display for UnknownVariantValue {
   18     26   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
   19     27   
        write!(f, "{}", self.0)
   20     28   
    }
   21     29   
}

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

@@ -1,1 +83,86 @@
    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_content_type_parameters;
   27     29   
   28     30   
pub(crate) mod shape_empty_input_and_empty_output;
   29     31   
   30     32   
pub(crate) mod shape_endpoint_operation;
   31     33   
   32     34   
pub(crate) mod shape_endpoint_with_host_label_operation;
   33     35   
   34     36   
pub(crate) mod shape_greeting_with_errors;
   35     37   
   36     38   
pub(crate) mod shape_host_with_path_operation;
   37     39   
   38     40   
pub(crate) mod shape_json_unions;
   39     41   
   40     42   
pub(crate) mod shape_no_input_and_no_output;
   41     43   
   42     44   
pub(crate) mod shape_no_input_and_output;
   43     45   
   44     46   
pub(crate) mod shape_operation_with_defaults;
   45     47   
   46     48   
pub(crate) mod shape_operation_with_nested_structure;
   47     49   
   48     50   
pub(crate) mod shape_operation_with_required_members;
   49     51   
   50     52   
pub(crate) mod shape_put_with_content_encoding;
   51     53   
   52     54   
pub(crate) mod shape_simple_scalar_properties;
   53     55   
          56  +
/* JsonParserGenerator.kt:227 */
   54     57   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   55     58   
    if data.is_empty() {
   56     59   
        b"{}"
   57     60   
    } else {
   58     61   
        data
   59     62   
    }
   60     63   
}
   61     64   
   62     65   
pub(crate) mod shape_complex_error;
   63     66   

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

@@ -1,1 +13,19 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_client_optional_defaults(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::types::ClientOptionalDefaults,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.member {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("member").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:372 */
   12     17   
    Ok(())
          18  +
    /* JsonSerializerGenerator.kt:358 */
   13     19   
}

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

@@ -1,1 +48,81 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:148 */
    2      3   
pub(crate) fn de_complex_error_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::ComplexErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ComplexErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    /* JsonParserGenerator.kt:153 */
    6      8   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
    7      9   
    let tokens = &mut tokens_owned;
    8     10   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          11  +
    /* JsonParserGenerator.kt:684 */
    9     12   
    loop {
          13  +
        /* JsonParserGenerator.kt:685 */
   10     14   
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          15  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          17  +
                /* JsonParserGenerator.kt:260 */
          18  +
                match key.to_unescaped()?.as_ref() {
          19  +
                    /* JsonParserGenerator.kt:262 */
   13     20   
                    "TopLevel" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
   14     22   
                        builder = builder.set_top_level(
          23  +
                            /* JsonParserGenerator.kt:354 */
   15     24   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
          25  +
                                .map(|s|
          26  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          27  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          29  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
   18     30   
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
   19     32   
                    }
          33  +
                    /* JsonParserGenerator.kt:262 */
   20     34   
                    "Nested" => {
   21         -
                    builder = builder.set_nested(crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(
   22         -
                        tokens,
   23         -
                    )?);
          35  +
                        /* JsonParserGenerator.kt:265 */
          36  +
                        builder = builder.set_nested(
          37  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(tokens)?
          38  +
                        /* JsonParserGenerator.kt:265 */);
          39  +
                        /* JsonParserGenerator.kt:262 */
   24     40   
                    }
          41  +
                    /* JsonParserGenerator.kt:262 */
   25     42   
                    "Message" => {
          43  +
                        /* JsonParserGenerator.kt:265 */
   26     44   
                        builder = builder.set_message(
          45  +
                            /* JsonParserGenerator.kt:354 */
   27     46   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                            .transpose()?,
          47  +
                                .map(|s|
          48  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          49  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          50  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          51  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
   30     52   
                        );
          53  +
                        /* JsonParserGenerator.kt:262 */
   31     54   
                    }
   32         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
            },
          55  +
                    /* JsonParserGenerator.kt:290 */
          56  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          57  +
                }
          58  +
                /* JsonParserGenerator.kt:686 */
          59  +
            }
          60  +
            /* JsonParserGenerator.kt:695 */
   34     61   
            other => {
   35     62   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36     63   
                    "expected object key or end object, found: {:?}",
   37     64   
                    other
   38     65   
                )))
          66  +
            } /* JsonParserGenerator.kt:685 */
   39     67   
        }
          68  +
        /* JsonParserGenerator.kt:684 */
   40     69   
    }
   41         -
    }
          70  +
    /* JsonParserGenerator.kt:250 */
   42     71   
    if tokens.next().is_some() {
          72  +
        /* JsonParserGenerator.kt:251 */
   43     73   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44     74   
            "found more JSON tokens after completing parsing",
   45     75   
        ));
          76  +
        /* JsonParserGenerator.kt:250 */
   46     77   
    }
          78  +
    /* JsonParserGenerator.kt:163 */
   47     79   
    Ok(builder)
          80  +
    /* JsonParserGenerator.kt:148 */
   48     81   
}

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

@@ -1,1 +40,68 @@
    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_complex_nested_error_data<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::ComplexNestedErrorData>, ::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::ComplexNestedErrorDataBuilder::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() {
          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 */
   17     26   
                            "Foo" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_foo(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
          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 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
          39  +
                            /* JsonParserGenerator.kt:290 */
          40  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          41  +
                        }
          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   
                        )))
          50  +
                    } /* JsonParserGenerator.kt:685 */
   31     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   32     53   
            }
   33         -
            }
          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(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     62   
                "expected start object or null",
   38         -
        )),
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   39     66   
    }
          67  +
    /* JsonParserGenerator.kt:516 */
   40     68   
}

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

@@ -1,1 +42,64 @@
    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_content_type_parameters_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<
    8     10   
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
    9     11   
    crate::operation::content_type_parameters::ContentTypeParametersError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::content_type_parameters::ContentTypeParametersError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::content_type_parameters::ContentTypeParametersError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_content_type_parameters_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
   25     34   
    crate::operation::content_type_parameters::ContentTypeParametersError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}
   33     48   
          49  +
/* JsonSerializerGenerator.kt:287 */
   34     50   
pub fn ser_content_type_parameters_input(
   35     51   
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
   36     52   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          53  +
    /* JsonSerializerGenerator.kt:291 */
   37     54   
    let mut out = String::new();
          55  +
    /* JsonSerializerGenerator.kt:292 */
   38     56   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          57  +
    /* JsonSerializerGenerator.kt:375 */
   39     58   
    crate::protocol_serde::shape_content_type_parameters_input::ser_content_type_parameters_input_input(&mut object, input)?;
          59  +
    /* JsonSerializerGenerator.kt:295 */
   40     60   
    object.finish();
          61  +
    /* JsonSerializerGenerator.kt:296 */
   41     62   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          63  +
    /* JsonSerializerGenerator.kt:287 */
   42     64   
}

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

@@ -1,1 +13,19 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_content_type_parameters_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.value {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("value").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:372 */
   12     17   
    Ok(())
          18  +
    /* JsonSerializerGenerator.kt:358 */
   13     19   
}

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

@@ -1,1 +149,249 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_defaults(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::types::Defaults,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* SerializerUtil.kt:46 */
    6      8   
    {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("defaultString").string(input.default_string.as_str());
          11  +
        /* SerializerUtil.kt:46 */
    8     12   
    }
          13  +
    /* SerializerUtil.kt:46 */
    9     14   
    if !input.default_boolean {
          15  +
        /* JsonSerializerGenerator.kt:424 */
   10     16   
        object.key("defaultBoolean").boolean(input.default_boolean);
          17  +
        /* SerializerUtil.kt:46 */
   11     18   
    }
          19  +
    /* SerializerUtil.kt:46 */
   12     20   
    {
          21  +
        /* JsonSerializerGenerator.kt:484 */
   13     22   
        let mut array_1 = object.key("defaultList").start_array();
          23  +
        /* JsonSerializerGenerator.kt:524 */
   14     24   
        for item_2 in &input.default_list {
          25  +
            /* SerializerUtil.kt:42 */
   15     26   
            {
          27  +
                /* JsonSerializerGenerator.kt:423 */
   16     28   
                array_1.value().string(item_2.as_str());
          29  +
                /* SerializerUtil.kt:42 */
   17     30   
            }
          31  +
            /* JsonSerializerGenerator.kt:524 */
   18     32   
        }
          33  +
        /* JsonSerializerGenerator.kt:486 */
   19     34   
        array_1.finish();
          35  +
        /* SerializerUtil.kt:46 */
   20     36   
    }
          37  +
    /* SerializerUtil.kt:46 */
   21     38   
    {
          39  +
        /* JsonSerializerGenerator.kt:474 */
   22     40   
        object.key("defaultDocumentMap").document(&input.default_document_map);
          41  +
        /* SerializerUtil.kt:46 */
   23     42   
    }
          43  +
    /* SerializerUtil.kt:46 */
   24     44   
    {
          45  +
        /* JsonSerializerGenerator.kt:474 */
   25     46   
        object.key("defaultDocumentString").document(&input.default_document_string);
          47  +
        /* SerializerUtil.kt:46 */
   26     48   
    }
          49  +
    /* SerializerUtil.kt:46 */
   27     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:474 */
   28     52   
        object.key("defaultDocumentBoolean").document(&input.default_document_boolean);
          53  +
        /* SerializerUtil.kt:46 */
   29     54   
    }
          55  +
    /* SerializerUtil.kt:46 */
   30     56   
    {
          57  +
        /* JsonSerializerGenerator.kt:474 */
   31     58   
        object.key("defaultDocumentList").document(&input.default_document_list);
          59  +
        /* SerializerUtil.kt:46 */
   32     60   
    }
          61  +
    /* JsonSerializerGenerator.kt:382 */
   33     62   
    if let Some(var_3) = &input.default_null_document {
          63  +
        /* JsonSerializerGenerator.kt:474 */
   34     64   
        object.key("defaultNullDocument").document(var_3);
          65  +
        /* JsonSerializerGenerator.kt:382 */
   35     66   
    }
          67  +
    /* SerializerUtil.kt:46 */
   36     68   
    {
          69  +
        /* JsonSerializerGenerator.kt:448 */
   37     70   
        object
   38     71   
            .key("defaultTimestamp")
   39     72   
            .date_time(&input.default_timestamp, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
          73  +
        /* SerializerUtil.kt:46 */
   40     74   
    }
          75  +
    /* SerializerUtil.kt:46 */
   41     76   
    {
          77  +
        /* JsonSerializerGenerator.kt:439 */
   42     78   
        object
   43     79   
            .key("defaultBlob")
   44     80   
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.default_blob));
          81  +
        /* SerializerUtil.kt:46 */
   45     82   
    }
          83  +
    /* SerializerUtil.kt:46 */
   46     84   
    if input.default_byte != 1 {
          85  +
        /* JsonSerializerGenerator.kt:432 */
   47     86   
        object.key("defaultByte").number(
   48     87   
            #[allow(clippy::useless_conversion)]
   49     88   
            ::aws_smithy_types::Number::NegInt((input.default_byte).into()),
   50     89   
        );
          90  +
        /* SerializerUtil.kt:46 */
   51     91   
    }
          92  +
    /* SerializerUtil.kt:46 */
   52     93   
    if input.default_short != 1 {
          94  +
        /* JsonSerializerGenerator.kt:432 */
   53     95   
        object.key("defaultShort").number(
   54     96   
            #[allow(clippy::useless_conversion)]
   55     97   
            ::aws_smithy_types::Number::NegInt((input.default_short).into()),
   56     98   
        );
          99  +
        /* SerializerUtil.kt:46 */
   57    100   
    }
         101  +
    /* SerializerUtil.kt:46 */
   58    102   
    if input.default_integer != 10 {
         103  +
        /* JsonSerializerGenerator.kt:432 */
   59    104   
        object.key("defaultInteger").number(
   60    105   
            #[allow(clippy::useless_conversion)]
   61    106   
            ::aws_smithy_types::Number::NegInt((input.default_integer).into()),
   62    107   
        );
         108  +
        /* SerializerUtil.kt:46 */
   63    109   
    }
         110  +
    /* SerializerUtil.kt:46 */
   64    111   
    if input.default_long != 100 {
         112  +
        /* JsonSerializerGenerator.kt:432 */
   65    113   
        object.key("defaultLong").number(
   66    114   
            #[allow(clippy::useless_conversion)]
   67    115   
            ::aws_smithy_types::Number::NegInt((input.default_long).into()),
   68    116   
        );
         117  +
        /* SerializerUtil.kt:46 */
   69    118   
    }
         119  +
    /* SerializerUtil.kt:46 */
   70    120   
    if input.default_float != 1.0 {
         121  +
        /* JsonSerializerGenerator.kt:432 */
   71    122   
        object.key("defaultFloat").number(
   72    123   
            #[allow(clippy::useless_conversion)]
   73    124   
            ::aws_smithy_types::Number::Float((input.default_float).into()),
   74    125   
        );
         126  +
        /* SerializerUtil.kt:46 */
   75    127   
    }
         128  +
    /* SerializerUtil.kt:46 */
   76    129   
    if input.default_double != 1.0 {
         130  +
        /* JsonSerializerGenerator.kt:432 */
   77    131   
        object.key("defaultDouble").number(
   78    132   
            #[allow(clippy::useless_conversion)]
   79    133   
            ::aws_smithy_types::Number::Float((input.default_double).into()),
   80    134   
        );
         135  +
        /* SerializerUtil.kt:46 */
   81    136   
    }
         137  +
    /* SerializerUtil.kt:46 */
   82    138   
    {
         139  +
        /* JsonSerializerGenerator.kt:495 */
   83    140   
        #[allow(unused_mut)]
         141  +
        /* JsonSerializerGenerator.kt:496 */
   84    142   
        let mut object_4 = object.key("defaultMap").start_object();
         143  +
        /* JsonSerializerGenerator.kt:537 */
   85    144   
        for (key_5, value_6) in &input.default_map {
         145  +
            /* SerializerUtil.kt:42 */
   86    146   
            {
         147  +
                /* JsonSerializerGenerator.kt:423 */
   87    148   
                object_4.key(key_5.as_str()).string(value_6.as_str());
         149  +
                /* SerializerUtil.kt:42 */
   88    150   
            }
         151  +
            /* JsonSerializerGenerator.kt:537 */
   89    152   
        }
         153  +
        /* JsonSerializerGenerator.kt:515 */
   90    154   
        object_4.finish();
         155  +
        /* SerializerUtil.kt:46 */
   91    156   
    }
         157  +
    /* SerializerUtil.kt:46 */
   92    158   
    {
         159  +
        /* JsonSerializerGenerator.kt:423 */
   93    160   
        object.key("defaultEnum").string(input.default_enum.as_str());
         161  +
        /* SerializerUtil.kt:46 */
   94    162   
    }
         163  +
    /* SerializerUtil.kt:46 */
   95    164   
    if input.default_int_enum != 1 {
         165  +
        /* JsonSerializerGenerator.kt:432 */
   96    166   
        object.key("defaultIntEnum").number(
   97    167   
            #[allow(clippy::useless_conversion)]
   98    168   
            ::aws_smithy_types::Number::NegInt((input.default_int_enum).into()),
   99    169   
        );
         170  +
        /* SerializerUtil.kt:46 */
  100    171   
    }
         172  +
    /* SerializerUtil.kt:46 */
  101    173   
    {
         174  +
        /* JsonSerializerGenerator.kt:423 */
  102    175   
        object.key("emptyString").string(input.empty_string.as_str());
         176  +
        /* SerializerUtil.kt:46 */
  103    177   
    }
         178  +
    /* SerializerUtil.kt:46 */
  104    179   
    if input.false_boolean {
         180  +
        /* JsonSerializerGenerator.kt:424 */
  105    181   
        object.key("falseBoolean").boolean(input.false_boolean);
         182  +
        /* SerializerUtil.kt:46 */
  106    183   
    }
         184  +
    /* SerializerUtil.kt:46 */
  107    185   
    {
         186  +
        /* JsonSerializerGenerator.kt:439 */
  108    187   
        object
  109    188   
            .key("emptyBlob")
  110    189   
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.empty_blob));
         190  +
        /* SerializerUtil.kt:46 */
  111    191   
    }
         192  +
    /* SerializerUtil.kt:46 */
  112    193   
    if input.zero_byte != 0 {
         194  +
        /* JsonSerializerGenerator.kt:432 */
  113    195   
        object.key("zeroByte").number(
  114    196   
            #[allow(clippy::useless_conversion)]
  115    197   
            ::aws_smithy_types::Number::NegInt((input.zero_byte).into()),
  116    198   
        );
         199  +
        /* SerializerUtil.kt:46 */
  117    200   
    }
         201  +
    /* SerializerUtil.kt:46 */
  118    202   
    if input.zero_short != 0 {
         203  +
        /* JsonSerializerGenerator.kt:432 */
  119    204   
        object.key("zeroShort").number(
  120    205   
            #[allow(clippy::useless_conversion)]
  121    206   
            ::aws_smithy_types::Number::NegInt((input.zero_short).into()),
  122    207   
        );
         208  +
        /* SerializerUtil.kt:46 */
  123    209   
    }
         210  +
    /* SerializerUtil.kt:46 */
  124    211   
    if input.zero_integer != 0 {
         212  +
        /* JsonSerializerGenerator.kt:432 */
  125    213   
        object.key("zeroInteger").number(
  126    214   
            #[allow(clippy::useless_conversion)]
  127    215   
            ::aws_smithy_types::Number::NegInt((input.zero_integer).into()),
  128    216   
        );
         217  +
        /* SerializerUtil.kt:46 */
  129    218   
    }
         219  +
    /* SerializerUtil.kt:46 */
  130    220   
    if input.zero_long != 0 {
         221  +
        /* JsonSerializerGenerator.kt:432 */
  131    222   
        object.key("zeroLong").number(
  132    223   
            #[allow(clippy::useless_conversion)]
  133    224   
            ::aws_smithy_types::Number::NegInt((input.zero_long).into()),
  134    225   
        );
         226  +
        /* SerializerUtil.kt:46 */
  135    227   
    }
         228  +
    /* SerializerUtil.kt:46 */
  136    229   
    if input.zero_float != 0.0 {
         230  +
        /* JsonSerializerGenerator.kt:432 */
  137    231   
        object.key("zeroFloat").number(
  138    232   
            #[allow(clippy::useless_conversion)]
  139    233   
            ::aws_smithy_types::Number::Float((input.zero_float).into()),
  140    234   
        );
         235  +
        /* SerializerUtil.kt:46 */
  141    236   
    }
         237  +
    /* SerializerUtil.kt:46 */
  142    238   
    if input.zero_double != 0.0 {
         239  +
        /* JsonSerializerGenerator.kt:432 */
  143    240   
        object.key("zeroDouble").number(
  144    241   
            #[allow(clippy::useless_conversion)]
  145    242   
            ::aws_smithy_types::Number::Float((input.zero_double).into()),
  146    243   
        );
         244  +
        /* SerializerUtil.kt:46 */
  147    245   
    }
         246  +
    /* JsonSerializerGenerator.kt:372 */
  148    247   
    Ok(())
         248  +
    /* JsonSerializerGenerator.kt:358 */
  149    249   
}

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

@@ -1,1 +69,125 @@
    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_dialog<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::Dialog>, ::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::DialogBuilder::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() {
          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 */
   17     26   
                            "language" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_language(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
          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 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
   24     40   
                            "greeting" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
   25     42   
                                builder = builder.set_greeting(
          43  +
                                    /* JsonParserGenerator.kt:354 */
   26     44   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
          45  +
                                        .map(|s|
          46  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          47  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          48  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          49  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   29     50   
                                );
          51  +
                                /* JsonParserGenerator.kt:262 */
   30     52   
                            }
          53  +
                            /* JsonParserGenerator.kt:262 */
   31     54   
                            "farewell" => {
   32         -
                            builder = builder.set_farewell(crate::protocol_serde::shape_farewell::de_farewell(tokens)?);
          55  +
                                /* JsonParserGenerator.kt:265 */
          56  +
                                builder = builder.set_farewell(
          57  +
                                    /* JsonParserGenerator.kt:544 */
          58  +
                                    crate::protocol_serde::shape_farewell::de_farewell(tokens)?, /* JsonParserGenerator.kt:265 */
          59  +
                                );
          60  +
                                /* JsonParserGenerator.kt:262 */
          61  +
                            }
          62  +
                            /* JsonParserGenerator.kt:290 */
          63  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   33     64   
                        }
   34         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   35         -
                    },
          65  +
                        /* JsonParserGenerator.kt:686 */
          66  +
                    }
          67  +
                    /* JsonParserGenerator.kt:695 */
   36     68   
                    other => {
   37     69   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   38     70   
                            "expected object key or end object, found: {:?}",
   39     71   
                            other
   40     72   
                        )))
          73  +
                    } /* JsonParserGenerator.kt:685 */
   41     74   
                }
          75  +
                /* JsonParserGenerator.kt:684 */
   42     76   
            }
   43         -
            }
          77  +
            /* JsonParserGenerator.kt:540 */
   44     78   
            Ok(Some(builder.build()))
          79  +
            /* JsonParserGenerator.kt:713 */
   45     80   
        }
   46         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          81  +
        /* JsonParserGenerator.kt:722 */
          82  +
        _ => {
          83  +
            /* JsonParserGenerator.kt:723 */
          84  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   47     85   
                "expected start object or null",
   48         -
        )),
          86  +
            ))
          87  +
            /* JsonParserGenerator.kt:722 */
          88  +
        } /* JsonParserGenerator.kt:712 */
   49     89   
    }
          90  +
    /* JsonParserGenerator.kt:516 */
   50     91   
}
   51     92   
          93  +
/* JsonSerializerGenerator.kt:358 */
   52     94   
pub fn ser_dialog(
   53     95   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   54     96   
    input: &crate::types::Dialog,
   55     97   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          98  +
    /* JsonSerializerGenerator.kt:382 */
   56     99   
    if let Some(var_1) = &input.language {
         100  +
        /* JsonSerializerGenerator.kt:423 */
   57    101   
        object.key("language").string(var_1.as_str());
         102  +
        /* JsonSerializerGenerator.kt:382 */
   58    103   
    }
         104  +
    /* SerializerUtil.kt:46 */
   59    105   
    {
         106  +
        /* JsonSerializerGenerator.kt:423 */
   60    107   
        object.key("greeting").string(input.greeting.as_str());
         108  +
        /* SerializerUtil.kt:46 */
   61    109   
    }
         110  +
    /* JsonSerializerGenerator.kt:382 */
   62    111   
    if let Some(var_2) = &input.farewell {
         112  +
        /* JsonSerializerGenerator.kt:495 */
   63    113   
        #[allow(unused_mut)]
         114  +
        /* JsonSerializerGenerator.kt:496 */
   64    115   
        let mut object_3 = object.key("farewell").start_object();
         116  +
        /* JsonSerializerGenerator.kt:375 */
   65    117   
        crate::protocol_serde::shape_farewell::ser_farewell(&mut object_3, var_2)?;
         118  +
        /* JsonSerializerGenerator.kt:515 */
   66    119   
        object_3.finish();
         120  +
        /* JsonSerializerGenerator.kt:382 */
   67    121   
    }
         122  +
    /* JsonSerializerGenerator.kt:372 */
   68    123   
    Ok(())
         124  +
    /* JsonSerializerGenerator.kt:358 */
   69    125   
}