Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_storage/_get_storage_output.rs

@@ -1,1 +64,99 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Contents of the Pokémon storage.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Contents of the Pokémon storage.
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct GetStorageOutput {
    7         -
    /// A list of Pokémon species.
           8  +
pub /* StructureGenerator.kt:201 */ struct GetStorageOutput {
           9  +
    /// /* StructureGenerator.kt:231 */A list of Pokémon species.
    8     10   
    pub collection: ::std::vec::Vec<::std::string::String>,
          11  +
    /* StructureGenerator.kt:201 */
    9     12   
}
          13  +
/* StructureGenerator.kt:135 */
   10     14   
impl GetStorageOutput {
   11         -
    /// A list of Pokémon species.
          15  +
    /// /* StructureGenerator.kt:231 */A list of Pokémon species.
          16  +
    /* StructureGenerator.kt:166 */
   12     17   
    pub fn collection(&self) -> &[::std::string::String] {
          18  +
        /* StructureGenerator.kt:171 */
   13     19   
        use std::ops::Deref;
   14     20   
        self.collection.deref()
          21  +
        /* StructureGenerator.kt:166 */
   15     22   
    }
          23  +
    /* StructureGenerator.kt:135 */
   16     24   
}
          25  +
/* ClientCodegenVisitor.kt:237 */
   17     26   
impl GetStorageOutput {
   18         -
    /// Creates a new builder-style object to manufacture [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
          27  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
          28  +
    /* BuilderGenerator.kt:175 */
   19     29   
    pub fn builder() -> crate::operation::get_storage::builders::GetStorageOutputBuilder {
          30  +
        /* BuilderGenerator.kt:176 */
   20     31   
        crate::operation::get_storage::builders::GetStorageOutputBuilder::default()
          32  +
        /* BuilderGenerator.kt:175 */
   21     33   
    }
          34  +
    /* ClientCodegenVisitor.kt:237 */
   22     35   
}
   23     36   
   24         -
/// A builder for [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
          37  +
/// /* BuilderGenerator.kt:342 */A builder for [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
          38  +
/* RustType.kt:516 */
   25     39   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          40  +
/* RustType.kt:516 */
   26     41   
#[non_exhaustive]
          42  +
/* BuilderGenerator.kt:345 */
   27     43   
pub struct GetStorageOutputBuilder {
          44  +
    /* BuilderGenerator.kt:275 */
   28     45   
    pub(crate) collection: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          46  +
    /* BuilderGenerator.kt:345 */
   29     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   30     49   
impl GetStorageOutputBuilder {
   31         -
    /// Appends an item to `collection`.
          50  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `collection`.
          51  +
    /* BuilderGenerator.kt:411 */
   32     52   
    ///
   33         -
    /// To override the contents of this collection use [`set_collection`](Self::set_collection).
          53  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_collection`](Self::set_collection).
          54  +
    /* BuilderGenerator.kt:413 */
   34     55   
    ///
   35         -
    /// A list of Pokémon species.
          56  +
    /// /* BuilderGenerator.kt:414 */A list of Pokémon species.
          57  +
    /* BuilderGenerator.kt:418 */
   36     58   
    pub fn collection(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          59  +
        /* BuilderGenerator.kt:419 */
   37     60   
        let mut v = self.collection.unwrap_or_default();
   38     61   
        v.push(input.into());
   39     62   
        self.collection = ::std::option::Option::Some(v);
   40     63   
        self
          64  +
        /* BuilderGenerator.kt:418 */
   41     65   
    }
   42         -
    /// A list of Pokémon species.
          66  +
    /// /* BuilderGenerator.kt:312 */A list of Pokémon species.
          67  +
    /* BuilderGenerator.kt:314 */
   43     68   
    pub fn set_collection(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
          69  +
        /* BuilderGenerator.kt:315 */
   44     70   
        self.collection = input;
   45     71   
        self
          72  +
        /* BuilderGenerator.kt:314 */
   46     73   
    }
   47         -
    /// A list of Pokémon species.
          74  +
    /// /* BuilderGenerator.kt:334 */A list of Pokémon species.
          75  +
    /* BuilderGenerator.kt:336 */
   48     76   
    pub fn get_collection(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
          77  +
        /* BuilderGenerator.kt:337 */
   49     78   
        &self.collection
          79  +
        /* BuilderGenerator.kt:336 */
   50     80   
    }
   51         -
    /// Consumes the builder and constructs a [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
   52         -
    /// This method will fail if any of the following fields are not set:
   53         -
    /// - [`collection`](crate::operation::get_storage::builders::GetStorageOutputBuilder::collection)
          81  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
          82  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
          83  +
    /// /* BuilderGenerator.kt:246 */- [`collection`](crate::operation::get_storage::builders::GetStorageOutputBuilder::collection)
          84  +
    /* BuilderGenerator.kt:253 */
   54     85   
    pub fn build(self) -> ::std::result::Result<crate::operation::get_storage::GetStorageOutput, ::aws_smithy_types::error::operation::BuildError> {
   55         -
        ::std::result::Result::Ok(crate::operation::get_storage::GetStorageOutput {
   56         -
            collection: self.collection.ok_or_else(|| {
   57         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   58         -
                    "collection",
   59         -
                    "collection was not specified but it is required when building GetStorageOutput",
   60         -
                )
   61         -
            })?,
   62         -
        })
          86  +
        /* BuilderGenerator.kt:254 */
          87  +
        ::std::result::Result::Ok(
          88  +
            /* BuilderGenerator.kt:477 */crate::operation::get_storage::GetStorageOutput {
          89  +
                /* BuilderGenerator.kt:481 */collection: self.collection
          90  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
          91  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("collection", "collection was not specified but it is required when building GetStorageOutput")
          92  +
                    /* BuilderGenerator.kt:494 */)?
          93  +
                ,
          94  +
            /* BuilderGenerator.kt:477 */}
          95  +
        /* BuilderGenerator.kt:254 */)
          96  +
        /* BuilderGenerator.kt:253 */
   63     97   
    }
          98  +
    /* BuilderGenerator.kt:355 */
   64     99   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_storage/builders.rs

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

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

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/stream_pokemon_radio/_stream_pokemon_radio_input.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/stream_pokemon_radio/_stream_pokemon_radio_output.rs

@@ -1,1 +49,93 @@
    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::fmt::Debug)]
    5         -
pub struct StreamPokemonRadioOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StreamPokemonRadioOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub data: ::aws_smithy_types::byte_stream::ByteStream,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl StreamPokemonRadioOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
          20  +
        /* StructureGenerator.kt:172 */
   12     21   
        &self.data
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl StreamPokemonRadioOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct StreamPokemonRadioOutputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
          47  +
    /* BuilderGenerator.kt:345 */
   27     48   
}
          49  +
/* BuilderGenerator.kt:355 */
   28     50   
impl StreamPokemonRadioOutputBuilder {
          51  +
    /* BuilderGenerator.kt:286 */
   29     52   
    #[allow(missing_docs)] // documentation missing in model
          53  +
                           /* BuilderGenerator.kt:291 */
   30     54   
    pub fn data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   31     56   
        self.data = ::std::option::Option::Some(input);
          57  +
        /* BuilderGenerator.kt:293 */
   32     58   
        self
          59  +
        /* BuilderGenerator.kt:291 */
   33     60   
    }
          61  +
    /* BuilderGenerator.kt:312 */
   34     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:314 */
   35     64   
    pub fn set_data(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   36     66   
        self.data = input;
   37     67   
        self
          68  +
        /* BuilderGenerator.kt:314 */
   38     69   
    }
          70  +
    /* BuilderGenerator.kt:334 */
   39     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* BuilderGenerator.kt:336 */
   40     73   
    pub fn get_data(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
          74  +
        /* BuilderGenerator.kt:337 */
   41     75   
        &self.data
          76  +
        /* BuilderGenerator.kt:336 */
   42     77   
    }
   43         -
    /// Consumes the builder and constructs a [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
          79  +
    /* BuilderGenerator.kt:253 */
   44     80   
    pub fn build(self) -> crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput {
          81  +
        /* BuilderGenerator.kt:477 */
   45     82   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput {
   46         -
            data: self.data.unwrap_or_default(),
          83  +
            /* BuilderGenerator.kt:481 */
          84  +
            data: self
          85  +
                .data
          86  +
                /* BuilderGenerator.kt:487 */
          87  +
                .unwrap_or_default(),
          88  +
            /* BuilderGenerator.kt:477 */
   47     89   
        }
          90  +
        /* BuilderGenerator.kt:253 */
   48     91   
    }
          92  +
    /* BuilderGenerator.kt:355 */
   49     93   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/stream_pokemon_radio/builders.rs

@@ -1,1 +111,123 @@
    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::stream_pokemon_radio::_stream_pokemon_radio_output::StreamPokemonRadioOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::stream_pokemon_radio::_stream_pokemon_radio_input::StreamPokemonRadioInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioInputBuilder {
    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::stream_pokemon_radio::StreamPokemonRadioOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.stream_pokemon_radio();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `StreamPokemonRadio`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `StreamPokemonRadio`.
   24     27   
///
   25         -
/// Fetch a radio song from the database and stream it back as a playable audio.
          28  +
/// /* FluentBuilderGenerator.kt:130 */Fetch a radio song from the database and stream it back as a playable audio.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct StreamPokemonRadioFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioInputBuilder,
   30     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   31     36   
}
          37  +
/* FluentBuilderGenerator.kt:381 */
   32     38   
impl
   33     39   
    crate::client::customize::internal::CustomizableSend<
   34     40   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput,
   35     41   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   36     42   
    > for StreamPokemonRadioFluentBuilder
   37     43   
{
   38     44   
    fn send(
   39     45   
        self,
   40     46   
        config_override: crate::config::Builder,
   41     47   
    ) -> crate::client::customize::internal::BoxFuture<
   42     48   
        crate::client::customize::internal::SendResult<
   43     49   
            crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput,
   44     50   
            crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   45     51   
        >,
   46     52   
    > {
   47     53   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   48     54   
    }
   49     55   
}
          56  +
/* FluentBuilderGenerator.kt:282 */
   50     57   
impl StreamPokemonRadioFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `StreamPokemonRadioFluentBuilder`.
   52     60   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   53     61   
        Self {
   54     62   
            handle,
   55     63   
            inner: ::std::default::Default::default(),
   56     64   
            config_override: ::std::option::Option::None,
   57     65   
        }
   58     66   
    }
          67  +
    /* FluentBuilderGenerator.kt:301 */
   59     68   
    /// Access the StreamPokemonRadio as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioInputBuilder {
   61     70   
        &self.inner
   62     71   
    }
          72  +
    /* FluentBuilderGenerator.kt:145 */
   63     73   
    /// Sends the request and returns the response.
   64     74   
    ///
   65     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66     76   
    /// can be matched against.
   67     77   
    ///
   68     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   69     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70     80   
    /// set when configuring the client.
   71     81   
    pub async fn send(
   72     82   
        self,
   73     83   
    ) -> ::std::result::Result<
   74     84   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   77     87   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78     88   
        >,
   79     89   
    > {
   80     90   
        let input = self
   81     91   
            .inner
   82     92   
            .build()
   83     93   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     94   
        let runtime_plugins = crate::operation::stream_pokemon_radio::StreamPokemonRadio::operation_runtime_plugins(
   85     95   
            self.handle.runtime_plugins.clone(),
   86     96   
            &self.handle.conf,
   87     97   
            self.config_override,
   88     98   
        );
   89     99   
        crate::operation::stream_pokemon_radio::StreamPokemonRadio::orchestrate(&runtime_plugins, input).await
   90    100   
    }
   91    101   
   92    102   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93    103   
    pub fn customize(
   94    104   
        self,
   95    105   
    ) -> crate::client::customize::CustomizableOperation<
   96    106   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput,
   97    107   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:282 */
  111    123   
}

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

@@ -1,1 +17,18 @@
    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::body::SdkBody;
    3      4   
pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
    4      5   
pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
    5         -
pub use ::aws_smithy_types::byte_stream::ByteStream;
           6  +
/* SmithyTypesPubUseExtra.kt:86 */ pub use ::aws_smithy_types::byte_stream::ByteStream;
    6      7   
#[cfg(feature = "rt-tokio")]
    7      8   
pub use ::aws_smithy_types::byte_stream::FsBuilder;
    8      9   
#[cfg(feature = "rt-tokio")]
    9     10   
pub use ::aws_smithy_types::byte_stream::Length;
   10     11   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
   11     12   
pub use ::aws_smithy_types::Blob;
   12         -
pub use ::aws_smithy_types::DateTime;
          13  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
   13     14   
   14         -
/// Event stream related primitives such as `Message` or `Header`.
          15  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
   15     16   
pub mod event_stream;
   16     17   
   17     18   
pub(crate) mod sealed_enum_unknown;

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/primitives/event_stream.rs

@@ -1,1 +6,7 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:115 */
    2      3   
pub use crate::event_receiver::EventReceiver;
    3      4   
pub use ::aws_smithy_types::event_stream::Header;
    4      5   
pub use ::aws_smithy_types::event_stream::HeaderValue;
    5      6   
pub use ::aws_smithy_types::event_stream::Message;
    6      7   
pub use ::aws_smithy_types::str_bytes::StrBytes;

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

@@ -1,1 +84,88 @@
    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   
   18     19   
pub(crate) mod shape_capture_pokemon;
   19     20   
          21  +
/* RestJson.kt:122 */
   20     22   
pub fn parse_http_error_metadata(
   21     23   
    _response_status: u16,
   22     24   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   23     25   
    response_body: &[u8],
   24     26   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   25     27   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   26     28   
}
   27     29   
   28     30   
pub(crate) mod shape_check_health;
   29     31   
   30     32   
pub(crate) mod shape_do_nothing;
   31     33   
   32     34   
pub(crate) mod shape_get_pokemon_species;
   33     35   
   34     36   
pub(crate) mod shape_get_server_statistics;
   35     37   
   36     38   
pub(crate) mod shape_get_storage;
   37     39   
   38     40   
pub(crate) mod shape_stream_pokemon_radio;
   39     41   
   40     42   
pub(crate) mod shape_capture_pokemon_output;
   41     43   
   42     44   
pub(crate) mod shape_capturing_event;
   43     45   
          46  +
/* JsonParserGenerator.kt:227 */
   44     47   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   45     48   
    if data.is_empty() {
   46     49   
        b"{}"
   47     50   
    } else {
   48     51   
        data
   49     52   
    }
   50     53   
}
   51     54   
   52     55   
pub(crate) mod shape_invalid_pokeball_error;
   53     56   
   54     57   
pub(crate) mod shape_master_ball_unsuccessful;
   55     58   
   56     59   
pub(crate) mod shape_resource_not_found_exception;
   57     60   
   58     61   
pub(crate) mod shape_storage_access_not_authorized;
   59     62   
   60     63   
pub(crate) mod shape_stream_pokemon_radio_output;
   61     64   
   62     65   
pub(crate) mod shape_throttling_error;
   63     66   
   64     67   
pub(crate) mod shape_unsupported_region_error;
   65     68   
   66     69   
pub(crate) mod shape_validation_exception;
   67     70   
          71  +
/* RestJson.kt:135 */
   68     72   
pub fn parse_event_stream_error_metadata(
   69     73   
    payload: &::bytes::Bytes,
   70     74   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   71     75   
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
   72     76   
}
   73     77   
   74     78   
pub(crate) mod shape_capturing_payload;
   75     79   
   76     80   
pub(crate) mod shape_flavor_text_entries;
   77     81   

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_capture_pokemon.rs

@@ -1,1 +121,164 @@
    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:200 */
    3      5   
pub fn de_capture_pokemon_http_response(
    4      6   
    response: &mut ::aws_smithy_runtime_api::http::Response,
    5      7   
) -> std::result::Result<crate::operation::capture_pokemon::CapturePokemonOutput, crate::operation::capture_pokemon::CapturePokemonError> {
           8  +
    /* ProtocolParserGenerator.kt:206 */
    6      9   
    let mut _response_body = ::aws_smithy_types::body::SdkBody::taken();
    7     10   
    std::mem::swap(&mut _response_body, response.body_mut());
    8     11   
    let _response_body = &mut _response_body;
    9     12   
   10     13   
    let _response_status = response.status().as_u16();
   11     14   
    let _response_headers = response.headers();
          15  +
    /* ProtocolParserGenerator.kt:217 */
   12     16   
    Ok({
          17  +
        /* RustType.kt:516 */
   13     18   
        #[allow(unused_mut)]
          19  +
        /* ProtocolParserGenerator.kt:240 */
   14     20   
        let mut output = crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::default();
   15         -
        output = output.set_events(Some(crate::protocol_serde::shape_capture_pokemon_output::de_events_payload(
   16         -
            _response_body,
   17         -
        )?));
          21  +
        /* ProtocolParserGenerator.kt:267 */
          22  +
        output = output.set_events(
          23  +
            /* ProtocolParserGenerator.kt:325 */
          24  +
            Some(crate::protocol_serde::shape_capture_pokemon_output::de_events_payload(_response_body)?), /* ProtocolParserGenerator.kt:267 */
          25  +
        );
          26  +
        /* ClientBuilderInstantiator.kt:46 */
   18     27   
        output
   19     28   
            .build()
   20     29   
            .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
          30  +
        /* ProtocolParserGenerator.kt:217 */
   21     31   
    })
          32  +
    /* ProtocolParserGenerator.kt:200 */
   22     33   
}
   23     34   
          35  +
/* RustType.kt:516 */
   24     36   
#[allow(clippy::unnecessary_wraps)]
          37  +
/* ProtocolParserGenerator.kt:99 */
   25     38   
pub fn de_capture_pokemon_http_error(
   26     39   
    _response_status: u16,
   27     40   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   28     41   
    _response_body: &[u8],
   29     42   
) -> std::result::Result<crate::operation::capture_pokemon::CapturePokemonOutput, crate::operation::capture_pokemon::CapturePokemonError> {
          43  +
    /* RustType.kt:516 */
   30     44   
    #[allow(unused_mut)]
          45  +
    /* ProtocolParserGenerator.kt:106 */
   31     46   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   32     47   
        .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
          48  +
    /* ProtocolParserGenerator.kt:120 */
   33     49   
    let generic = generic_builder.build();
          50  +
    /* ProtocolParserGenerator.kt:122 */
   34     51   
    let error_code = match generic.code() {
   35     52   
        Some(code) => code,
   36     53   
        None => return Err(crate::operation::capture_pokemon::CapturePokemonError::unhandled(generic)),
   37     54   
    };
   38     55   
   39     56   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          57  +
    /* ProtocolParserGenerator.kt:133 */
   40     58   
    Err(match error_code {
          59  +
        /* ProtocolParserGenerator.kt:139 */
   41     60   
        "ValidationException" => crate::operation::capture_pokemon::CapturePokemonError::ValidationError({
          61  +
            /* RustType.kt:516 */
   42     62   
            #[allow(unused_mut)]
   43         -
            let mut tmp = {
   44         -
                #[allow(unused_mut)]
   45         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   46         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   47         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   48         -
                let output = output.meta(generic);
   49         -
                crate::serde_util::validation_exception_correct_errors(output)
   50         -
                    .build()
   51         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   52         -
            };
          63  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          64  +
                /* ProtocolParserGenerator.kt:146 */ {
          65  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          66  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          67  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
          68  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          69  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
          70  +
                /* ProtocolParserGenerator.kt:146 */}
          71  +
            /* ProtocolParserGenerator.kt:145 */;
          72  +
            /* ProtocolParserGenerator.kt:179 */
   53     73   
            tmp
          74  +
            /* ProtocolParserGenerator.kt:139 */
   54     75   
        }),
          76  +
        /* ProtocolParserGenerator.kt:139 */
   55     77   
        "MasterBallUnsuccessful" => crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful({
          78  +
            /* RustType.kt:516 */
   56     79   
            #[allow(unused_mut)]
   57         -
            let mut tmp = {
   58         -
                #[allow(unused_mut)]
   59         -
                let mut output = crate::types::error::builders::MasterBallUnsuccessfulBuilder::default();
   60         -
                output = crate::protocol_serde::shape_master_ball_unsuccessful::de_master_ball_unsuccessful_json_err(_response_body, output)
   61         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   62         -
                let output = output.meta(generic);
   63         -
                output.build()
   64         -
            };
          80  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          81  +
                /* ProtocolParserGenerator.kt:146 */ {
          82  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          83  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::MasterBallUnsuccessfulBuilder::default();
          84  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_master_ball_unsuccessful::de_master_ball_unsuccessful_json_err(_response_body, output).map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
          85  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          86  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          87  +
                /* ProtocolParserGenerator.kt:146 */}
          88  +
            /* ProtocolParserGenerator.kt:145 */;
          89  +
            /* ProtocolParserGenerator.kt:170 */
   65     90   
            if tmp.message.is_none() {
   66     91   
                tmp.message = _error_message;
   67     92   
            }
          93  +
            /* ProtocolParserGenerator.kt:179 */
   68     94   
            tmp
          95  +
            /* ProtocolParserGenerator.kt:139 */
   69     96   
        }),
          97  +
        /* ProtocolParserGenerator.kt:139 */
   70     98   
        "InvalidPokeballError" => crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError({
          99  +
            /* RustType.kt:516 */
   71    100   
            #[allow(unused_mut)]
   72         -
            let mut tmp = {
   73         -
                #[allow(unused_mut)]
   74         -
                let mut output = crate::types::error::builders::InvalidPokeballErrorBuilder::default();
   75         -
                output = crate::protocol_serde::shape_invalid_pokeball_error::de_invalid_pokeball_error_json_err(_response_body, output)
   76         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   77         -
                let output = output.meta(generic);
   78         -
                crate::serde_util::invalid_pokeball_error_correct_errors(output)
   79         -
                    .build()
   80         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   81         -
            };
         101  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         102  +
                /* ProtocolParserGenerator.kt:146 */ {
         103  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         104  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InvalidPokeballErrorBuilder::default();
         105  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_pokeball_error::de_invalid_pokeball_error_json_err(_response_body, output).map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
         106  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         107  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::invalid_pokeball_error_correct_errors(output).build().map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
         108  +
                /* ProtocolParserGenerator.kt:146 */}
         109  +
            /* ProtocolParserGenerator.kt:145 */;
         110  +
            /* ProtocolParserGenerator.kt:170 */
   82    111   
            if tmp.message.is_none() {
   83    112   
                tmp.message = _error_message;
   84    113   
            }
         114  +
            /* ProtocolParserGenerator.kt:179 */
   85    115   
            tmp
         116  +
            /* ProtocolParserGenerator.kt:139 */
   86    117   
        }),
         118  +
        /* ProtocolParserGenerator.kt:139 */
   87    119   
        "ThrottlingError" => crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError({
         120  +
            /* RustType.kt:516 */
   88    121   
            #[allow(unused_mut)]
   89         -
            let mut tmp = {
   90         -
                #[allow(unused_mut)]
   91         -
                let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default();
   92         -
                output = crate::protocol_serde::shape_throttling_error::de_throttling_error_json_err(_response_body, output)
   93         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   94         -
                let output = output.meta(generic);
   95         -
                output.build()
   96         -
            };
         122  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         123  +
                /* ProtocolParserGenerator.kt:146 */ {
         124  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         125  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default();
         126  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_throttling_error::de_throttling_error_json_err(_response_body, output).map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
         127  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         128  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         129  +
                /* ProtocolParserGenerator.kt:146 */}
         130  +
            /* ProtocolParserGenerator.kt:145 */;
         131  +
            /* ProtocolParserGenerator.kt:170 */
   97    132   
            if tmp.message.is_none() {
   98    133   
                tmp.message = _error_message;
   99    134   
            }
         135  +
            /* ProtocolParserGenerator.kt:179 */
  100    136   
            tmp
         137  +
            /* ProtocolParserGenerator.kt:139 */
  101    138   
        }),
         139  +
        /* ProtocolParserGenerator.kt:139 */
  102    140   
        "UnsupportedRegionError" => crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError({
         141  +
            /* RustType.kt:516 */
  103    142   
            #[allow(unused_mut)]
  104         -
            let mut tmp = {
  105         -
                #[allow(unused_mut)]
  106         -
                let mut output = crate::types::error::builders::UnsupportedRegionErrorBuilder::default();
  107         -
                output = crate::protocol_serde::shape_unsupported_region_error::de_unsupported_region_error_json_err(_response_body, output)
  108         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
  109         -
                let output = output.meta(generic);
  110         -
                crate::serde_util::unsupported_region_error_correct_errors(output)
  111         -
                    .build()
  112         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
  113         -
            };
         143  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         144  +
                /* ProtocolParserGenerator.kt:146 */ {
         145  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         146  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::UnsupportedRegionErrorBuilder::default();
         147  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_unsupported_region_error::de_unsupported_region_error_json_err(_response_body, output).map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
         148  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         149  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::unsupported_region_error_correct_errors(output).build().map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
         150  +
                /* ProtocolParserGenerator.kt:146 */}
         151  +
            /* ProtocolParserGenerator.kt:145 */;
         152  +
            /* ProtocolParserGenerator.kt:170 */
  114    153   
            if tmp.message.is_none() {
  115    154   
                tmp.message = _error_message;
  116    155   
            }
         156  +
            /* ProtocolParserGenerator.kt:179 */
  117    157   
            tmp
         158  +
            /* ProtocolParserGenerator.kt:139 */
  118    159   
        }),
  119         -
        _ => crate::operation::capture_pokemon::CapturePokemonError::generic(generic),
         160  +
        /* ProtocolParserGenerator.kt:182 */
         161  +
        _ => crate::operation::capture_pokemon::CapturePokemonError::generic(generic), /* ProtocolParserGenerator.kt:133 */
  120    162   
    })
         163  +
    /* ProtocolParserGenerator.kt:99 */
  121    164   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_capture_pokemon_output.rs

@@ -1,1 +14,17 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_events_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<
    5      6   
    crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError>,
    6      7   
    crate::operation::capture_pokemon::CapturePokemonError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:272 */
    8     10   
    let unmarshaller = crate::event_stream_serde::CapturePokemonEventsUnmarshaller::new();
    9     11   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     12   
    Ok(crate::event_receiver::EventReceiver::new(::aws_smithy_http::event_stream::Receiver::new(
   11     13   
        unmarshaller,
   12     14   
        body,
   13     15   
    )))
          16  +
    /* HttpBindingGenerator.kt:230 */
   14     17   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_capturing_event.rs

@@ -1,1 +10,17 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:240 */
    2      3   
pub fn ser_payload_payload(
    3      4   
    input: &crate::types::CapturingPayload,
    4      5   
) -> std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:245 */
    5      7   
    let mut out = String::new();
           8  +
    /* JsonSerializerGenerator.kt:246 */
    6      9   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          10  +
    /* JsonSerializerGenerator.kt:375 */
    7     11   
    crate::protocol_serde::shape_capturing_payload::ser_capturing_payload(&mut object, input)?;
          12  +
    /* JsonSerializerGenerator.kt:252 */
    8     13   
    object.finish();
          14  +
    /* JsonSerializerGenerator.kt:253 */
    9     15   
    Ok(out.into_bytes())
          16  +
    /* JsonSerializerGenerator.kt:240 */
   10     17   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_capturing_payload.rs

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_capturing_payload(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::types::CapturingPayload,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.name {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("name").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:382 */
    9     14   
    if let Some(var_2) = &input.pokeball {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("pokeball").string(var_2.as_str());
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_check_health.rs

@@ -1,1 +26,41 @@
    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_check_health_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::check_health::CheckHealthOutput, crate::operation::check_health::CheckHealthError> {
          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::check_health::CheckHealthError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::check_health::CheckHealthError::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_check_health_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::check_health::CheckHealthOutput, crate::operation::check_health::CheckHealthError> {
          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::check_health::builders::CheckHealthOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_do_nothing.rs

@@ -1,1 +26,41 @@
    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_do_nothing_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::do_nothing::DoNothingOutput, crate::operation::do_nothing::DoNothingError> {
          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::do_nothing::DoNothingError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::do_nothing::DoNothingError::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_do_nothing_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::do_nothing::DoNothingOutput, crate::operation::do_nothing::DoNothingError> {
          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::do_nothing::builders::DoNothingOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}