Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/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_rpc11/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_rpc11/rust-client-codegen/src/operation/sparse_nulls_operation.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 `SparseNullsOperation`.
           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 SparseNullsOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl SparseNullsOperation {
    7         -
    /// Creates a new `SparseNullsOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `SparseNullsOperation`
          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::sparse_nulls_operation::SparseNullsOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::sparse_nulls_operation::SparseNullsOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   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 SparseNullsOperation {
   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("SparseNullsOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            SparseNullsOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            SparseNullsOperationResponseDeserializer,
  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   
            "SparseNullsOperation",
  111    122   
            "Json Protocol",
  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("SparseNullsOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(SparseNullsOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::sparse_nulls_operation::SparseNullsOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::sparse_nulls_operation::SparseNullsOperationError,
  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 SparseNullsOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SparseNullsOperationResponseDeserializer {
  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_sparse_nulls_operation::de_sparse_nulls_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_sparse_nulls_operation::de_sparse_nulls_operation_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 SparseNullsOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SparseNullsOperationRequestSerializer {
  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::sparse_nulls_operation::SparseNullsOperationInput>()
  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::sparse_nulls_operation::SparseNullsOperationInput,
  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::sparse_nulls_operation::SparseNullsOperationInput,
  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.1");
  193    206   
            builder = _header_serialization_settings.set_default_header(
  194    207   
                builder,
  195    208   
                ::http::header::HeaderName::from_static("x-amz-target"),
  196    209   
                "JsonProtocol.SparseNullsOperation",
  197    210   
            );
  198    211   
            builder
  199    212   
        };
  200    213   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_sparse_nulls_operation::ser_sparse_nulls_operation_input(
  201    214   
            &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 SparseNullsOperationEndpointParamsInterceptor;
  212    226   
  213    227   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SparseNullsOperationEndpointParamsInterceptor {
  214    228   
    fn name(&self) -> &'static str {
  215    229   
        "SparseNullsOperationEndpointParamsInterceptor"
  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::<SparseNullsOperationInput>()
  231    245   
            .ok_or("failed to downcast to SparseNullsOperationInput")?;
  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 sparse_nulls_operation_test {
  248    265   
  249    266   
    /// Serializes null values in maps
  250    267   
    /// Test ID: AwsJson11SparseMapsSerializeNullValues
  251    268   
    #[::tokio::test]
  252    269   
    #[::tracing_test::traced_test]
  253    270   
    async fn aws_json11_sparse_maps_serialize_null_values_request() {
  254    271   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  255    272   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  256    273   
@@ -396,413 +525,601 @@
  416    433   
            parsed.sparse_string_list,
  417    434   
            expected_output.sparse_string_list,
  418    435   
            "Unexpected value for `sparse_string_list`"
  419    436   
        );
  420    437   
        ::pretty_assertions::assert_eq!(
  421    438   
            parsed.sparse_string_map,
  422    439   
            expected_output.sparse_string_map,
  423    440   
            "Unexpected value for `sparse_string_map`"
  424    441   
        );
  425    442   
    }
         443  +
         444  +
    /* ProtocolTestGenerator.kt:98 */
  426    445   
}
  427    446   
         447  +
/* OperationErrorGenerator.kt:79 */
  428    448   
/// Error type for the `SparseNullsOperationError` operation.
         449  +
/* RustType.kt:516 */
  429    450   
#[non_exhaustive]
         451  +
/* RustType.kt:516 */
  430    452   
#[derive(::std::fmt::Debug)]
  431         -
pub enum SparseNullsOperationError {
         453  +
pub /* OperationErrorGenerator.kt:81 */ enum SparseNullsOperationError {
         454  +
    /* OperationErrorGenerator.kt:88 */
  432    455   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  433    456   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  434    457   
    variable wildcard pattern and check `.code()`:
  435    458   
     \
  436    459   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  437    460   
     \
  438    461   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SparseNullsOperationError) for what information is available for the error.")]
  439    462   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         463  +
    /* OperationErrorGenerator.kt:81 */
  440    464   
}
         465  +
/* OperationErrorGenerator.kt:218 */
  441    466   
impl SparseNullsOperationError {
         467  +
    /* OperationErrorGenerator.kt:219 */
  442    468   
    /// Creates the `SparseNullsOperationError::Unhandled` variant from any error type.
  443    469   
    pub fn unhandled(
  444    470   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  445    471   
    ) -> Self {
  446    472   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  447    473   
            source: err.into(),
  448    474   
            meta: ::std::default::Default::default(),
  449    475   
        })
  450    476   
    }
  451    477   
  452    478   
    /// Creates the `SparseNullsOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  453    479   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  454    480   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  455    481   
            source: err.clone().into(),
  456    482   
            meta: err,
  457    483   
        })
  458    484   
    }
  459         -
    ///
         485  +
    /// /* OperationErrorGenerator.kt:236 */
  460    486   
    /// Returns error metadata, which includes the error code, message,
  461    487   
    /// request ID, and potentially additional information.
  462    488   
    ///
         489  +
    /* OperationErrorGenerator.kt:242 */
  463    490   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         491  +
        /* OperationErrorGenerator.kt:243 */
  464    492   
        match self {
  465         -
            Self::Unhandled(e) => &e.meta,
         493  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         494  +
            /* OperationErrorGenerator.kt:243 */
  466    495   
        }
         496  +
        /* OperationErrorGenerator.kt:242 */
  467    497   
    }
         498  +
    /* OperationErrorGenerator.kt:218 */
  468    499   
}
         500  +
/* OperationErrorGenerator.kt:269 */
  469    501   
impl ::std::error::Error for SparseNullsOperationError {
         502  +
    /* OperationErrorGenerator.kt:270 */
  470    503   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         504  +
        /* OperationErrorGenerator.kt:318 */
  471    505   
        match self {
  472         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         506  +
            /* OperationErrorGenerator.kt:326 */
         507  +
            Self::Unhandled(_inner) => {
         508  +
                /* OperationErrorGenerator.kt:279 */
         509  +
                ::std::option::Option::Some(&*_inner.source)
         510  +
                /* OperationErrorGenerator.kt:326 */
         511  +
            } /* OperationErrorGenerator.kt:318 */
  473    512   
        }
         513  +
        /* OperationErrorGenerator.kt:270 */
  474    514   
    }
         515  +
    /* OperationErrorGenerator.kt:269 */
  475    516   
}
         517  +
/* OperationErrorGenerator.kt:133 */
  476    518   
impl ::std::fmt::Display for SparseNullsOperationError {
         519  +
    /* OperationErrorGenerator.kt:134 */
  477    520   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         521  +
        /* OperationErrorGenerator.kt:318 */
  478    522   
        match self {
         523  +
            /* OperationErrorGenerator.kt:326 */
  479    524   
            Self::Unhandled(_inner) => {
         525  +
                /* OperationErrorGenerator.kt:139 */
  480    526   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  481    527   
                    write!(f, "unhandled error ({code})")
  482    528   
                } else {
  483    529   
                    f.write_str("unhandled error")
  484    530   
                }
         531  +
                /* OperationErrorGenerator.kt:326 */
         532  +
            } /* OperationErrorGenerator.kt:318 */
  485    533   
        }
         534  +
        /* OperationErrorGenerator.kt:134 */
  486    535   
    }
  487         -
    }
         536  +
    /* OperationErrorGenerator.kt:133 */
  488    537   
}
         538  +
/* OperationErrorGenerator.kt:182 */
  489    539   
impl ::aws_smithy_types::retry::ProvideErrorKind for SparseNullsOperationError {
         540  +
    /* OperationErrorGenerator.kt:186 */
  490    541   
    fn code(&self) -> ::std::option::Option<&str> {
         542  +
        /* OperationErrorGenerator.kt:187 */
  491    543   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         544  +
        /* OperationErrorGenerator.kt:186 */
  492    545   
    }
         546  +
    /* OperationErrorGenerator.kt:190 */
  493    547   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         548  +
        /* OperationErrorGenerator.kt:197 */
  494    549   
        ::std::option::Option::None
         550  +
        /* OperationErrorGenerator.kt:190 */
  495    551   
    }
         552  +
    /* OperationErrorGenerator.kt:182 */
  496    553   
}
         554  +
/* OperationErrorGenerator.kt:163 */
  497    555   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SparseNullsOperationError {
         556  +
    /* OperationErrorGenerator.kt:164 */
  498    557   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         558  +
        /* OperationErrorGenerator.kt:318 */
  499    559   
        match self {
  500         -
            Self::Unhandled(_inner) => &_inner.meta,
         560  +
            /* OperationErrorGenerator.kt:326 */
         561  +
            Self::Unhandled(_inner) => {
         562  +
                /* OperationErrorGenerator.kt:168 */
         563  +
                &_inner.meta
         564  +
                /* OperationErrorGenerator.kt:326 */
         565  +
            } /* OperationErrorGenerator.kt:318 */
  501    566   
        }
         567  +
        /* OperationErrorGenerator.kt:164 */
  502    568   
    }
         569  +
    /* OperationErrorGenerator.kt:163 */
  503    570   
}
         571  +
/* OperationErrorGenerator.kt:109 */
  504    572   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SparseNullsOperationError {
         573  +
    /* OperationErrorGenerator.kt:110 */
  505    574   
    fn create_unhandled_error(
  506    575   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  507    576   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  508    577   
    ) -> Self {
         578  +
        /* OperationErrorGenerator.kt:121 */
  509    579   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  510    580   
            source,
  511    581   
            meta: meta.unwrap_or_default(),
  512    582   
        })
         583  +
        /* OperationErrorGenerator.kt:110 */
  513    584   
    }
         585  +
    /* OperationErrorGenerator.kt:109 */
  514    586   
}
  515    587   
         588  +
/* CodegenDelegator.kt:255 */
  516    589   
pub use crate::operation::sparse_nulls_operation::_sparse_nulls_operation_output::SparseNullsOperationOutput;
  517    590   
         591  +
/* CodegenDelegator.kt:255 */
  518    592   
pub use crate::operation::sparse_nulls_operation::_sparse_nulls_operation_input::SparseNullsOperationInput;
  519    593   
         594  +
/* RustModule.kt:172 */
  520    595   
mod _sparse_nulls_operation_input;
  521    596   
         597  +
/* RustModule.kt:172 */
  522    598   
mod _sparse_nulls_operation_output;
  523    599   
  524         -
/// Builders
         600  +
/// /* CodegenDelegator.kt:51 */Builders
  525    601   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/sparse_nulls_operation/_sparse_nulls_operation_input.rs

@@ -1,1 +94,160 @@
    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 SparseNullsOperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct SparseNullsOperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub sparse_string_list: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub sparse_string_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl SparseNullsOperationInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
   13         -
    ///
   14         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sparse_string_list.is_none()`.
          21  +
    /// /* StructureGenerator.kt:162 */
          22  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sparse_string_list.is_none()`.
          23  +
    /* StructureGenerator.kt:166 */
   15     24   
    pub fn sparse_string_list(&self) -> &[::std::option::Option<::std::string::String>] {
   16         -
        self.sparse_string_list.as_deref().unwrap_or_default()
          25  +
        /* StructureGenerator.kt:169 */
          26  +
        self.sparse_string_list
          27  +
            .as_deref()
          28  +
            /* StructureGenerator.kt:175 */
          29  +
            .unwrap_or_default()
          30  +
        /* StructureGenerator.kt:166 */
   17     31   
    }
          32  +
    /* StructureGenerator.kt:231 */
   18     33   
    #[allow(missing_docs)] // documentation missing in model
          34  +
                           /* StructureGenerator.kt:166 */
   19     35   
    pub fn sparse_string_map(
   20     36   
        &self,
   21     37   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
          38  +
        /* StructureGenerator.kt:170 */
   22     39   
        self.sparse_string_map.as_ref()
          40  +
        /* StructureGenerator.kt:166 */
   23     41   
    }
          42  +
    /* StructureGenerator.kt:135 */
   24     43   
}
          44  +
/* ClientCodegenVisitor.kt:237 */
   25     45   
impl SparseNullsOperationInput {
   26         -
    /// Creates a new builder-style object to manufacture [`SparseNullsOperationInput`](crate::operation::sparse_nulls_operation::SparseNullsOperationInput).
          46  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`SparseNullsOperationInput`](crate::operation::sparse_nulls_operation::SparseNullsOperationInput).
          47  +
    /* BuilderGenerator.kt:175 */
   27     48   
    pub fn builder() -> crate::operation::sparse_nulls_operation::builders::SparseNullsOperationInputBuilder {
          49  +
        /* BuilderGenerator.kt:176 */
   28     50   
        crate::operation::sparse_nulls_operation::builders::SparseNullsOperationInputBuilder::default()
          51  +
        /* BuilderGenerator.kt:175 */
   29     52   
    }
          53  +
    /* ClientCodegenVisitor.kt:237 */
   30     54   
}
   31     55   
   32         -
/// A builder for [`SparseNullsOperationInput`](crate::operation::sparse_nulls_operation::SparseNullsOperationInput).
          56  +
/// /* BuilderGenerator.kt:342 */A builder for [`SparseNullsOperationInput`](crate::operation::sparse_nulls_operation::SparseNullsOperationInput).
          57  +
/* RustType.kt:516 */
   33     58   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          59  +
/* RustType.kt:516 */
   34     60   
#[non_exhaustive]
          61  +
/* BuilderGenerator.kt:345 */
   35     62   
pub struct SparseNullsOperationInputBuilder {
          63  +
    /* BuilderGenerator.kt:275 */
   36     64   
    pub(crate) sparse_string_list: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
          65  +
    /* BuilderGenerator.kt:275 */
   37     66   
    pub(crate) sparse_string_map:
   38     67   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
          68  +
    /* BuilderGenerator.kt:345 */
   39     69   
}
          70  +
/* BuilderGenerator.kt:355 */
   40     71   
impl SparseNullsOperationInputBuilder {
   41         -
    /// Appends an item to `sparse_string_list`.
          72  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `sparse_string_list`.
          73  +
    /* BuilderGenerator.kt:411 */
   42     74   
    ///
   43         -
    /// To override the contents of this collection use [`set_sparse_string_list`](Self::set_sparse_string_list).
          75  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_sparse_string_list`](Self::set_sparse_string_list).
          76  +
    /* BuilderGenerator.kt:413 */
   44     77   
    ///
          78  +
    /* BuilderGenerator.kt:418 */
   45     79   
    pub fn sparse_string_list(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          80  +
        /* BuilderGenerator.kt:419 */
   46     81   
        let mut v = self.sparse_string_list.unwrap_or_default();
   47     82   
        v.push(input);
   48     83   
        self.sparse_string_list = ::std::option::Option::Some(v);
   49     84   
        self
          85  +
        /* BuilderGenerator.kt:418 */
   50     86   
    }
          87  +
    /* BuilderGenerator.kt:312 */
   51     88   
    #[allow(missing_docs)] // documentation missing in model
          89  +
                           /* BuilderGenerator.kt:314 */
   52     90   
    pub fn set_sparse_string_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>) -> Self {
          91  +
        /* BuilderGenerator.kt:315 */
   53     92   
        self.sparse_string_list = input;
   54     93   
        self
          94  +
        /* BuilderGenerator.kt:314 */
   55     95   
    }
          96  +
    /* BuilderGenerator.kt:334 */
   56     97   
    #[allow(missing_docs)] // documentation missing in model
          98  +
                           /* BuilderGenerator.kt:336 */
   57     99   
    pub fn get_sparse_string_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>> {
         100  +
        /* BuilderGenerator.kt:337 */
   58    101   
        &self.sparse_string_list
         102  +
        /* BuilderGenerator.kt:336 */
   59    103   
    }
   60         -
    /// Adds a key-value pair to `sparse_string_map`.
         104  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_string_map`.
         105  +
    /* BuilderGenerator.kt:437 */
   61    106   
    ///
   62         -
    /// To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         107  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         108  +
    /* BuilderGenerator.kt:439 */
   63    109   
    ///
         110  +
    /* BuilderGenerator.kt:445 */
   64    111   
    pub fn sparse_string_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
         112  +
        /* BuilderGenerator.kt:448 */
   65    113   
        let mut hash_map = self.sparse_string_map.unwrap_or_default();
   66    114   
        hash_map.insert(k.into(), v);
   67    115   
        self.sparse_string_map = ::std::option::Option::Some(hash_map);
   68    116   
        self
         117  +
        /* BuilderGenerator.kt:445 */
   69    118   
    }
         119  +
    /* BuilderGenerator.kt:312 */
   70    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* BuilderGenerator.kt:314 */
   71    122   
    pub fn set_sparse_string_map(
   72    123   
        mut self,
   73    124   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
   74    125   
    ) -> Self {
         126  +
        /* BuilderGenerator.kt:315 */
   75    127   
        self.sparse_string_map = input;
   76    128   
        self
         129  +
        /* BuilderGenerator.kt:314 */
   77    130   
    }
         131  +
    /* BuilderGenerator.kt:334 */
   78    132   
    #[allow(missing_docs)] // documentation missing in model
         133  +
                           /* BuilderGenerator.kt:336 */
   79    134   
    pub fn get_sparse_string_map(
   80    135   
        &self,
   81    136   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
         137  +
        /* BuilderGenerator.kt:337 */
   82    138   
        &self.sparse_string_map
         139  +
        /* BuilderGenerator.kt:336 */
   83    140   
    }
   84         -
    /// Consumes the builder and constructs a [`SparseNullsOperationInput`](crate::operation::sparse_nulls_operation::SparseNullsOperationInput).
         141  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`SparseNullsOperationInput`](crate::operation::sparse_nulls_operation::SparseNullsOperationInput).
         142  +
    /* BuilderGenerator.kt:253 */
   85    143   
    pub fn build(
   86    144   
        self,
   87    145   
    ) -> ::std::result::Result<crate::operation::sparse_nulls_operation::SparseNullsOperationInput, ::aws_smithy_types::error::operation::BuildError>
   88    146   
    {
   89         -
        ::std::result::Result::Ok(crate::operation::sparse_nulls_operation::SparseNullsOperationInput {
   90         -
            sparse_string_list: self.sparse_string_list,
         147  +
        /* BuilderGenerator.kt:254 */
         148  +
        ::std::result::Result::Ok(
         149  +
            /* BuilderGenerator.kt:477 */
         150  +
            crate::operation::sparse_nulls_operation::SparseNullsOperationInput {
         151  +
                /* BuilderGenerator.kt:481 */ sparse_string_list: self.sparse_string_list,
         152  +
                /* BuilderGenerator.kt:481 */
   91    153   
                sparse_string_map: self.sparse_string_map,
   92         -
        })
         154  +
                /* BuilderGenerator.kt:477 */
         155  +
            }, /* BuilderGenerator.kt:254 */
         156  +
        )
         157  +
        /* BuilderGenerator.kt:253 */
   93    158   
    }
         159  +
    /* BuilderGenerator.kt:355 */
   94    160   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/sparse_nulls_operation/_sparse_nulls_operation_output.rs

@@ -1,1 +91,154 @@
    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 SparseNullsOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct SparseNullsOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub sparse_string_list: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub sparse_string_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl SparseNullsOperationOutput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
   13         -
    ///
   14         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sparse_string_list.is_none()`.
          21  +
    /// /* StructureGenerator.kt:162 */
          22  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sparse_string_list.is_none()`.
          23  +
    /* StructureGenerator.kt:166 */
   15     24   
    pub fn sparse_string_list(&self) -> &[::std::option::Option<::std::string::String>] {
   16         -
        self.sparse_string_list.as_deref().unwrap_or_default()
          25  +
        /* StructureGenerator.kt:169 */
          26  +
        self.sparse_string_list
          27  +
            .as_deref()
          28  +
            /* StructureGenerator.kt:175 */
          29  +
            .unwrap_or_default()
          30  +
        /* StructureGenerator.kt:166 */
   17     31   
    }
          32  +
    /* StructureGenerator.kt:231 */
   18     33   
    #[allow(missing_docs)] // documentation missing in model
          34  +
                           /* StructureGenerator.kt:166 */
   19     35   
    pub fn sparse_string_map(
   20     36   
        &self,
   21     37   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
          38  +
        /* StructureGenerator.kt:170 */
   22     39   
        self.sparse_string_map.as_ref()
          40  +
        /* StructureGenerator.kt:166 */
   23     41   
    }
          42  +
    /* StructureGenerator.kt:135 */
   24     43   
}
          44  +
/* ClientCodegenVisitor.kt:237 */
   25     45   
impl SparseNullsOperationOutput {
   26         -
    /// Creates a new builder-style object to manufacture [`SparseNullsOperationOutput`](crate::operation::sparse_nulls_operation::SparseNullsOperationOutput).
          46  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`SparseNullsOperationOutput`](crate::operation::sparse_nulls_operation::SparseNullsOperationOutput).
          47  +
    /* BuilderGenerator.kt:175 */
   27     48   
    pub fn builder() -> crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder {
          49  +
        /* BuilderGenerator.kt:176 */
   28     50   
        crate::operation::sparse_nulls_operation::builders::SparseNullsOperationOutputBuilder::default()
          51  +
        /* BuilderGenerator.kt:175 */
   29     52   
    }
          53  +
    /* ClientCodegenVisitor.kt:237 */
   30     54   
}
   31     55   
   32         -
/// A builder for [`SparseNullsOperationOutput`](crate::operation::sparse_nulls_operation::SparseNullsOperationOutput).
          56  +
/// /* BuilderGenerator.kt:342 */A builder for [`SparseNullsOperationOutput`](crate::operation::sparse_nulls_operation::SparseNullsOperationOutput).
          57  +
/* RustType.kt:516 */
   33     58   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          59  +
/* RustType.kt:516 */
   34     60   
#[non_exhaustive]
          61  +
/* BuilderGenerator.kt:345 */
   35     62   
pub struct SparseNullsOperationOutputBuilder {
          63  +
    /* BuilderGenerator.kt:275 */
   36     64   
    pub(crate) sparse_string_list: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
          65  +
    /* BuilderGenerator.kt:275 */
   37     66   
    pub(crate) sparse_string_map:
   38     67   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
          68  +
    /* BuilderGenerator.kt:345 */
   39     69   
}
          70  +
/* BuilderGenerator.kt:355 */
   40     71   
impl SparseNullsOperationOutputBuilder {
   41         -
    /// Appends an item to `sparse_string_list`.
          72  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `sparse_string_list`.
          73  +
    /* BuilderGenerator.kt:411 */
   42     74   
    ///
   43         -
    /// To override the contents of this collection use [`set_sparse_string_list`](Self::set_sparse_string_list).
          75  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_sparse_string_list`](Self::set_sparse_string_list).
          76  +
    /* BuilderGenerator.kt:413 */
   44     77   
    ///
          78  +
    /* BuilderGenerator.kt:418 */
   45     79   
    pub fn sparse_string_list(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          80  +
        /* BuilderGenerator.kt:419 */
   46     81   
        let mut v = self.sparse_string_list.unwrap_or_default();
   47     82   
        v.push(input);
   48     83   
        self.sparse_string_list = ::std::option::Option::Some(v);
   49     84   
        self
          85  +
        /* BuilderGenerator.kt:418 */
   50     86   
    }
          87  +
    /* BuilderGenerator.kt:312 */
   51     88   
    #[allow(missing_docs)] // documentation missing in model
          89  +
                           /* BuilderGenerator.kt:314 */
   52     90   
    pub fn set_sparse_string_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>) -> Self {
          91  +
        /* BuilderGenerator.kt:315 */
   53     92   
        self.sparse_string_list = input;
   54     93   
        self
          94  +
        /* BuilderGenerator.kt:314 */
   55     95   
    }
          96  +
    /* BuilderGenerator.kt:334 */
   56     97   
    #[allow(missing_docs)] // documentation missing in model
          98  +
                           /* BuilderGenerator.kt:336 */
   57     99   
    pub fn get_sparse_string_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>> {
         100  +
        /* BuilderGenerator.kt:337 */
   58    101   
        &self.sparse_string_list
         102  +
        /* BuilderGenerator.kt:336 */
   59    103   
    }
   60         -
    /// Adds a key-value pair to `sparse_string_map`.
         104  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_string_map`.
         105  +
    /* BuilderGenerator.kt:437 */
   61    106   
    ///
   62         -
    /// To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         107  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         108  +
    /* BuilderGenerator.kt:439 */
   63    109   
    ///
         110  +
    /* BuilderGenerator.kt:445 */
   64    111   
    pub fn sparse_string_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
         112  +
        /* BuilderGenerator.kt:448 */
   65    113   
        let mut hash_map = self.sparse_string_map.unwrap_or_default();
   66    114   
        hash_map.insert(k.into(), v);
   67    115   
        self.sparse_string_map = ::std::option::Option::Some(hash_map);
   68    116   
        self
         117  +
        /* BuilderGenerator.kt:445 */
   69    118   
    }
         119  +
    /* BuilderGenerator.kt:312 */
   70    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* BuilderGenerator.kt:314 */
   71    122   
    pub fn set_sparse_string_map(
   72    123   
        mut self,
   73    124   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
   74    125   
    ) -> Self {
         126  +
        /* BuilderGenerator.kt:315 */
   75    127   
        self.sparse_string_map = input;
   76    128   
        self
         129  +
        /* BuilderGenerator.kt:314 */
   77    130   
    }
         131  +
    /* BuilderGenerator.kt:334 */
   78    132   
    #[allow(missing_docs)] // documentation missing in model
         133  +
                           /* BuilderGenerator.kt:336 */
   79    134   
    pub fn get_sparse_string_map(
   80    135   
        &self,
   81    136   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
         137  +
        /* BuilderGenerator.kt:337 */
   82    138   
        &self.sparse_string_map
         139  +
        /* BuilderGenerator.kt:336 */
   83    140   
    }
   84         -
    /// Consumes the builder and constructs a [`SparseNullsOperationOutput`](crate::operation::sparse_nulls_operation::SparseNullsOperationOutput).
         141  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`SparseNullsOperationOutput`](crate::operation::sparse_nulls_operation::SparseNullsOperationOutput).
         142  +
    /* BuilderGenerator.kt:253 */
   85    143   
    pub fn build(self) -> crate::operation::sparse_nulls_operation::SparseNullsOperationOutput {
         144  +
        /* BuilderGenerator.kt:477 */
   86    145   
        crate::operation::sparse_nulls_operation::SparseNullsOperationOutput {
   87         -
            sparse_string_list: self.sparse_string_list,
         146  +
            /* BuilderGenerator.kt:481 */ sparse_string_list: self.sparse_string_list,
         147  +
            /* BuilderGenerator.kt:481 */
   88    148   
            sparse_string_map: self.sparse_string_map,
         149  +
            /* BuilderGenerator.kt:477 */
   89    150   
        }
         151  +
        /* BuilderGenerator.kt:253 */
   90    152   
    }
         153  +
    /* BuilderGenerator.kt:355 */
   91    154   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/sparse_nulls_operation/builders.rs

@@ -1,1 +153,177 @@
    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::sparse_nulls_operation::_sparse_nulls_operation_output::SparseNullsOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::sparse_nulls_operation::_sparse_nulls_operation_input::SparseNullsOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::sparse_nulls_operation::builders::SparseNullsOperationInputBuilder {
    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::sparse_nulls_operation::SparseNullsOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.sparse_nulls_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `SparseNullsOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `SparseNullsOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct SparseNullsOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::sparse_nulls_operation::builders::SparseNullsOperationInputBuilder,
   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::sparse_nulls_operation::SparseNullsOperationOutput,
   34     40   
        crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   35     41   
    > for SparseNullsOperationFluentBuilder
   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::sparse_nulls_operation::SparseNullsOperationOutput,
   43     49   
            crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   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 SparseNullsOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `SparseNullsOperationFluentBuilder`.
   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 SparseNullsOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::sparse_nulls_operation::builders::SparseNullsOperationInputBuilder {
   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::sparse_nulls_operation::SparseNullsOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   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::sparse_nulls_operation::SparseNullsOperation::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::sparse_nulls_operation::SparseNullsOperation::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::sparse_nulls_operation::SparseNullsOperationOutput,
   96    106   
        crate::operation::sparse_nulls_operation::SparseNullsOperationError,
   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   
    }
  110         -
    ///
         121  +
    /// /* FluentBuilderGenerator.kt:436 */
  111    122   
    /// Appends an item to `sparseStringList`.
  112    123   
    ///
  113    124   
    /// To override the contents of this collection use [`set_sparse_string_list`](Self::set_sparse_string_list).
  114    125   
    ///
         126  +
    /* FluentBuilderGenerator.kt:443 */
  115    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* FluentBuilderGenerator.kt:446 */
  116    129   
    pub fn sparse_string_list(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    130   
        self.inner = self.inner.sparse_string_list(input);
  118    131   
        self
  119    132   
    }
         133  +
    /* FluentBuilderGenerator.kt:498 */
  120    134   
    #[allow(missing_docs)] // documentation missing in model
         135  +
                           /* FluentBuilderGenerator.kt:500 */
  121    136   
    pub fn set_sparse_string_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>) -> Self {
  122    137   
        self.inner = self.inner.set_sparse_string_list(input);
  123    138   
        self
  124    139   
    }
         140  +
    /* FluentBuilderGenerator.kt:518 */
  125    141   
    #[allow(missing_docs)] // documentation missing in model
         142  +
                           /* FluentBuilderGenerator.kt:520 */
  126    143   
    pub fn get_sparse_string_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>> {
  127    144   
        self.inner.get_sparse_string_list()
  128    145   
    }
  129         -
    ///
         146  +
    /// /* FluentBuilderGenerator.kt:466 */
  130    147   
    /// Adds a key-value pair to `sparseStringMap`.
  131    148   
    ///
  132    149   
    /// To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
  133    150   
    ///
         151  +
    /* FluentBuilderGenerator.kt:473 */
  134    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* FluentBuilderGenerator.kt:475 */
  135    154   
    pub fn sparse_string_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
  136    155   
        self.inner = self.inner.sparse_string_map(k.into(), v);
  137    156   
        self
  138    157   
    }
         158  +
    /* FluentBuilderGenerator.kt:498 */
  139    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* FluentBuilderGenerator.kt:500 */
  140    161   
    pub fn set_sparse_string_map(
  141    162   
        mut self,
  142    163   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
  143    164   
    ) -> Self {
  144    165   
        self.inner = self.inner.set_sparse_string_map(input);
  145    166   
        self
  146    167   
    }
         168  +
    /* FluentBuilderGenerator.kt:518 */
  147    169   
    #[allow(missing_docs)] // documentation missing in model
         170  +
                           /* FluentBuilderGenerator.kt:520 */
  148    171   
    pub fn get_sparse_string_map(
  149    172   
        &self,
  150    173   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
  151    174   
        self.inner.get_sparse_string_map()
  152    175   
    }
         176  +
    /* FluentBuilderGenerator.kt:282 */
  153    177   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/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_rpc11/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_rpc11/rust-client-codegen/src/protocol_serde.rs

@@ -1,1 +89,92 @@
    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_datetime_offsets;
   29     31   
   30     32   
pub(crate) mod shape_empty_operation;
   31     33   
   32     34   
pub(crate) mod shape_endpoint_operation;
   33     35   
   34     36   
pub(crate) mod shape_endpoint_with_host_label_operation;
   35     37   
   36     38   
pub(crate) mod shape_fractional_seconds;
   37     39   
   38     40   
pub(crate) mod shape_greeting_with_errors;
   39     41   
   40     42   
pub(crate) mod shape_host_with_path_operation;
   41     43   
   42     44   
pub(crate) mod shape_json_enums;
   43     45   
   44     46   
pub(crate) mod shape_json_unions;
   45     47   
   46     48   
pub(crate) mod shape_kitchen_sink_operation;
   47     49   
   48     50   
pub(crate) mod shape_null_operation;
   49     51   
   50     52   
pub(crate) mod shape_operation_with_optional_input_output;
   51     53   
   52     54   
pub(crate) mod shape_put_and_get_inline_documents;
   53     55   
   54     56   
pub(crate) mod shape_put_with_content_encoding;
   55     57   
   56     58   
pub(crate) mod shape_simple_scalar_properties;
   57     59   
   58     60   
pub(crate) mod shape_sparse_nulls_operation;
   59     61   
          62  +
/* JsonParserGenerator.kt:227 */
   60     63   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   61     64   
    if data.is_empty() {
   62     65   
        b"{}"
   63     66   
    } else {
   64     67   
        data
   65     68   
    }
   66     69   
}
   67     70   
   68     71   
pub(crate) mod shape_complex_error;
   69     72   

tmp-codegen-diff/codegen-client-test/json_rpc11/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_rpc11/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_rpc11/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_rpc11/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_rpc11/rust-client-codegen/src/protocol_serde/shape_datetime_offsets.rs

@@ -1,1 +72,113 @@
    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_datetime_offsets_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::datetime_offsets::DatetimeOffsetsOutput, crate::operation::datetime_offsets::DatetimeOffsetsError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::datetime_offsets::DatetimeOffsetsError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::datetime_offsets::DatetimeOffsetsError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_datetime_offsets_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::datetime_offsets::DatetimeOffsetsOutput, crate::operation::datetime_offsets::DatetimeOffsetsError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output = crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets(_response_body, output)
   25     38   
            .map_err(crate::operation::datetime_offsets::DatetimeOffsetsError::unhandled)?;
          39  +
        /* ClientBuilderInstantiator.kt:56 */
   26     40   
        output.build()
          41  +
        /* ProtocolParserGenerator.kt:77 */
   27     42   
    })
          43  +
    /* ProtocolParserGenerator.kt:71 */
   28     44   
}
   29     45   
          46  +
/* AwsJson.kt:152 */
   30     47   
pub fn ser_datetime_offsets_input(
   31     48   
    _input: &crate::operation::datetime_offsets::DatetimeOffsetsInput,
   32     49   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          50  +
    /* AwsJson.kt:156 */
   33     51   
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
          52  +
    /* AwsJson.kt:152 */
   34     53   
}
   35     54   
          55  +
/* JsonParserGenerator.kt:148 */
   36     56   
pub(crate) fn de_datetime_offsets(
   37     57   
    value: &[u8],
   38     58   
    mut builder: crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder,
   39     59   
) -> ::std::result::Result<
   40     60   
    crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder,
   41     61   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   42     62   
> {
          63  +
    /* JsonParserGenerator.kt:153 */
   43     64   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   44     65   
    let tokens = &mut tokens_owned;
   45     66   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          67  +
    /* JsonParserGenerator.kt:684 */
   46     68   
    loop {
          69  +
        /* JsonParserGenerator.kt:685 */
   47     70   
        match tokens.next().transpose()? {
   48         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   49         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          71  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          72  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          73  +
                /* JsonParserGenerator.kt:260 */
          74  +
                match key.to_unescaped()?.as_ref() {
          75  +
                    /* JsonParserGenerator.kt:262 */
   50     76   
                    "datetime" => {
   51         -
                    builder = builder.set_datetime(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
          77  +
                        /* JsonParserGenerator.kt:265 */
          78  +
                        builder = builder.set_datetime(
          79  +
                            /* JsonParserGenerator.kt:384 */
          80  +
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   52     81   
                                tokens.next(),
   53     82   
                                ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
   54         -
                    )?);
          83  +
                            )?, /* JsonParserGenerator.kt:265 */
          84  +
                        );
          85  +
                        /* JsonParserGenerator.kt:262 */
   55     86   
                    }
   56         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   57         -
            },
          87  +
                    /* JsonParserGenerator.kt:290 */
          88  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          89  +
                }
          90  +
                /* JsonParserGenerator.kt:686 */
          91  +
            }
          92  +
            /* JsonParserGenerator.kt:695 */
   58     93   
            other => {
   59     94   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   60     95   
                    "expected object key or end object, found: {:?}",
   61     96   
                    other
   62     97   
                )))
          98  +
            } /* JsonParserGenerator.kt:685 */
   63     99   
        }
         100  +
        /* JsonParserGenerator.kt:684 */
   64    101   
    }
   65         -
    }
         102  +
    /* JsonParserGenerator.kt:250 */
   66    103   
    if tokens.next().is_some() {
         104  +
        /* JsonParserGenerator.kt:251 */
   67    105   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   68    106   
            "found more JSON tokens after completing parsing",
   69    107   
        ));
         108  +
        /* JsonParserGenerator.kt:250 */
   70    109   
    }
         110  +
    /* JsonParserGenerator.kt:163 */
   71    111   
    Ok(builder)
         112  +
    /* JsonParserGenerator.kt:148 */
   72    113   
}

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

@@ -1,1 +32,50 @@
    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_empty_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::empty_operation::EmptyOperationOutput, crate::operation::empty_operation::EmptyOperationError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::empty_operation::EmptyOperationError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::empty_operation::EmptyOperationError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_empty_operation_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::empty_operation::EmptyOperationOutput, crate::operation::empty_operation::EmptyOperationError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::empty_operation::builders::EmptyOperationOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}
   27     42   
          43  +
/* AwsJson.kt:152 */
   28     44   
pub fn ser_empty_operation_input(
   29     45   
    _input: &crate::operation::empty_operation::EmptyOperationInput,
   30     46   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          47  +
    /* AwsJson.kt:156 */
   31     48   
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
          49  +
    /* AwsJson.kt:152 */
   32     50   
}

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

@@ -1,1 +27,43 @@
    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_empty_struct<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::EmptyStruct>, ::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::EmptyStructBuilder::default();
          17  +
            /* JsonParserGenerator.kt:682 */
   13     18   
            ::aws_smithy_json::deserialize::token::skip_to_end(tokens)?;
          19  +
            /* JsonParserGenerator.kt:540 */
   14     20   
            Ok(Some(builder.build()))
          21  +
            /* JsonParserGenerator.kt:713 */
   15     22   
        }
   16         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          23  +
        /* JsonParserGenerator.kt:722 */
          24  +
        _ => {
          25  +
            /* JsonParserGenerator.kt:723 */
          26  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   17     27   
                "expected start object or null",
   18         -
        )),
          28  +
            ))
          29  +
            /* JsonParserGenerator.kt:722 */
          30  +
        } /* JsonParserGenerator.kt:712 */
   19     31   
    }
          32  +
    /* JsonParserGenerator.kt:516 */
   20     33   
}
   21     34   
          35  +
/* JsonSerializerGenerator.kt:358 */
   22     36   
pub fn ser_empty_struct(
   23     37   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   24     38   
    #[allow(unused_variables)] input: &crate::types::EmptyStruct,
   25     39   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          40  +
    /* JsonSerializerGenerator.kt:372 */
   26     41   
    Ok(())
          42  +
    /* JsonSerializerGenerator.kt:358 */
   27     43   
}