Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/_check_health_input.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/_check_health_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CheckHealthOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CheckHealthOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl CheckHealthOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::check_health::builders::CheckHealthOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::check_health::builders::CheckHealthOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          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 CheckHealthOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct CheckHealthOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl CheckHealthOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::check_health::CheckHealthOutput {
   20         -
        crate::operation::check_health::CheckHealthOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::check_health::CheckHealthOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/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::check_health::_check_health_output::CheckHealthOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::check_health::_check_health_input::CheckHealthInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::check_health::builders::CheckHealthInputBuilder {
    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::check_health::CheckHealthOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::check_health::CheckHealthError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.check_health();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `CheckHealth`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `CheckHealth`.
   24     27   
///
   25         -
/// Health check operation, to check the service is up Not yet a deep check
          28  +
/// /* FluentBuilderGenerator.kt:130 */Health check operation, to check the service is up Not yet a deep check
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct CheckHealthFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::check_health::builders::CheckHealthInputBuilder,
   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::check_health::CheckHealthOutput,
   35     41   
        crate::operation::check_health::CheckHealthError,
   36     42   
    > for CheckHealthFluentBuilder
   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::check_health::CheckHealthOutput,
   44     50   
            crate::operation::check_health::CheckHealthError,
   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 CheckHealthFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `CheckHealthFluentBuilder`.
   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 CheckHealth as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::check_health::builders::CheckHealthInputBuilder {
   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::check_health::CheckHealthOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::check_health::CheckHealthError,
   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::check_health::CheckHealth::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::check_health::CheckHealth::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::check_health::CheckHealthOutput,
   97    107   
        crate::operation::check_health::CheckHealthError,
   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-awsjson-client/rust-client-codegen/src/operation/do_nothing.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 `DoNothing`.
           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 DoNothing;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl DoNothing {
    7         -
    /// Creates a new `DoNothing`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `DoNothing`
          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::do_nothing::DoNothingInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::do_nothing::DoNothingOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::do_nothing::DoNothingError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +329,400 @@
   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 DoNothing {
   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("DoNothing");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            DoNothingRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            DoNothingResponseDeserializer,
   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   
            "DoNothing",
  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("DoNothing")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(DoNothingEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::do_nothing::DoNothingError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::do_nothing::DoNothingError,
  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 DoNothingResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DoNothingResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct DoNothingRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DoNothingRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input.downcast::<crate::operation::do_nothing::DoNothingInput>().expect("correct type");
  161    174   
        let _header_serialization_settings = _cfg
  162    175   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163    176   
            .cloned()
  164    177   
            .unwrap_or_default();
  165    178   
        let mut request_builder = {
  166    179   
            fn uri_base(
  167    180   
                _input: &crate::operation::do_nothing::DoNothingInput,
  168    181   
                output: &mut ::std::string::String,
  169    182   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  170    183   
                use ::std::fmt::Write as _;
  171    184   
                ::std::write!(output, "/").expect("formatting should succeed");
  172    185   
                ::std::result::Result::Ok(())
  173    186   
            }
  174    187   
            #[allow(clippy::unnecessary_wraps)]
  175    188   
            fn update_http_builder(
  176    189   
                input: &crate::operation::do_nothing::DoNothingInput,
  177    190   
                builder: ::http::request::Builder,
  178    191   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  179    192   
                let mut uri = ::std::string::String::new();
  180    193   
                uri_base(input, &mut uri)?;
  181    194   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  182    195   
            }
  183    196   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  184    197   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  185    198   
            builder = _header_serialization_settings.set_default_header(
  186    199   
                builder,
  187    200   
                ::http::header::HeaderName::from_static("x-amz-target"),
  188    201   
                "PokemonService.DoNothing",
  189    202   
            );
  190    203   
            builder
  191    204   
        };
  192    205   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_do_nothing::ser_do_nothing_input(&input)?);
  193    206   
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct DoNothingEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DoNothingEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "DoNothingEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<DoNothingInput>()
  218    232   
            .ok_or("failed to downcast to DoNothingInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* OperationErrorGenerator.kt:79 */
  232    247   
/// Error type for the `DoNothingError` operation.
         248  +
/* RustType.kt:516 */
  233    249   
#[non_exhaustive]
         250  +
/* RustType.kt:516 */
  234    251   
#[derive(::std::fmt::Debug)]
  235         -
pub enum DoNothingError {
         252  +
pub /* OperationErrorGenerator.kt:81 */ enum DoNothingError {
         253  +
    /* OperationErrorGenerator.kt:88 */
  236    254   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  237    255   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  238    256   
    variable wildcard pattern and check `.code()`:
  239    257   
     \
  240    258   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  241    259   
     \
  242    260   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DoNothingError) for what information is available for the error.")]
  243    261   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         262  +
    /* OperationErrorGenerator.kt:81 */
  244    263   
}
         264  +
/* OperationErrorGenerator.kt:218 */
  245    265   
impl DoNothingError {
         266  +
    /* OperationErrorGenerator.kt:219 */
  246    267   
    /// Creates the `DoNothingError::Unhandled` variant from any error type.
  247    268   
    pub fn unhandled(
  248    269   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  249    270   
    ) -> Self {
  250    271   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  251    272   
            source: err.into(),
  252    273   
            meta: ::std::default::Default::default(),
  253    274   
        })
  254    275   
    }
  255    276   
  256    277   
    /// Creates the `DoNothingError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  257    278   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  258    279   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  259    280   
            source: err.clone().into(),
  260    281   
            meta: err,
  261    282   
        })
  262    283   
    }
  263         -
    ///
         284  +
    /// /* OperationErrorGenerator.kt:236 */
  264    285   
    /// Returns error metadata, which includes the error code, message,
  265    286   
    /// request ID, and potentially additional information.
  266    287   
    ///
         288  +
    /* OperationErrorGenerator.kt:242 */
  267    289   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         290  +
        /* OperationErrorGenerator.kt:243 */
  268    291   
        match self {
  269         -
            Self::Unhandled(e) => &e.meta,
         292  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         293  +
            /* OperationErrorGenerator.kt:243 */
  270    294   
        }
         295  +
        /* OperationErrorGenerator.kt:242 */
  271    296   
    }
         297  +
    /* OperationErrorGenerator.kt:218 */
  272    298   
}
         299  +
/* OperationErrorGenerator.kt:269 */
  273    300   
impl ::std::error::Error for DoNothingError {
         301  +
    /* OperationErrorGenerator.kt:270 */
  274    302   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         303  +
        /* OperationErrorGenerator.kt:318 */
  275    304   
        match self {
  276         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         305  +
            /* OperationErrorGenerator.kt:326 */
         306  +
            Self::Unhandled(_inner) => {
         307  +
                /* OperationErrorGenerator.kt:279 */
         308  +
                ::std::option::Option::Some(&*_inner.source)
         309  +
                /* OperationErrorGenerator.kt:326 */
         310  +
            } /* OperationErrorGenerator.kt:318 */
  277    311   
        }
         312  +
        /* OperationErrorGenerator.kt:270 */
  278    313   
    }
         314  +
    /* OperationErrorGenerator.kt:269 */
  279    315   
}
         316  +
/* OperationErrorGenerator.kt:133 */
  280    317   
impl ::std::fmt::Display for DoNothingError {
         318  +
    /* OperationErrorGenerator.kt:134 */
  281    319   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         320  +
        /* OperationErrorGenerator.kt:318 */
  282    321   
        match self {
         322  +
            /* OperationErrorGenerator.kt:326 */
  283    323   
            Self::Unhandled(_inner) => {
         324  +
                /* OperationErrorGenerator.kt:139 */
  284    325   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  285    326   
                    write!(f, "unhandled error ({code})")
  286    327   
                } else {
  287    328   
                    f.write_str("unhandled error")
  288    329   
                }
  289         -
            }
         330  +
                /* OperationErrorGenerator.kt:326 */
         331  +
            } /* OperationErrorGenerator.kt:318 */
  290    332   
        }
         333  +
        /* OperationErrorGenerator.kt:134 */
  291    334   
    }
         335  +
    /* OperationErrorGenerator.kt:133 */
  292    336   
}
         337  +
/* OperationErrorGenerator.kt:182 */
  293    338   
impl ::aws_smithy_types::retry::ProvideErrorKind for DoNothingError {
         339  +
    /* OperationErrorGenerator.kt:186 */
  294    340   
    fn code(&self) -> ::std::option::Option<&str> {
         341  +
        /* OperationErrorGenerator.kt:187 */
  295    342   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         343  +
        /* OperationErrorGenerator.kt:186 */
  296    344   
    }
         345  +
    /* OperationErrorGenerator.kt:190 */
  297    346   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         347  +
        /* OperationErrorGenerator.kt:197 */
  298    348   
        ::std::option::Option::None
         349  +
        /* OperationErrorGenerator.kt:190 */
  299    350   
    }
         351  +
    /* OperationErrorGenerator.kt:182 */
  300    352   
}
         353  +
/* OperationErrorGenerator.kt:163 */
  301    354   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DoNothingError {
         355  +
    /* OperationErrorGenerator.kt:164 */
  302    356   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         357  +
        /* OperationErrorGenerator.kt:318 */
  303    358   
        match self {
  304         -
            Self::Unhandled(_inner) => &_inner.meta,
         359  +
            /* OperationErrorGenerator.kt:326 */
         360  +
            Self::Unhandled(_inner) => {
         361  +
                /* OperationErrorGenerator.kt:168 */
         362  +
                &_inner.meta
         363  +
                /* OperationErrorGenerator.kt:326 */
         364  +
            } /* OperationErrorGenerator.kt:318 */
  305    365   
        }
         366  +
        /* OperationErrorGenerator.kt:164 */
  306    367   
    }
         368  +
    /* OperationErrorGenerator.kt:163 */
  307    369   
}
         370  +
/* OperationErrorGenerator.kt:109 */
  308    371   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DoNothingError {
         372  +
    /* OperationErrorGenerator.kt:110 */
  309    373   
    fn create_unhandled_error(
  310    374   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  311    375   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  312    376   
    ) -> Self {
         377  +
        /* OperationErrorGenerator.kt:121 */
  313    378   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  314    379   
            source,
  315    380   
            meta: meta.unwrap_or_default(),
  316    381   
        })
         382  +
        /* OperationErrorGenerator.kt:110 */
  317    383   
    }
         384  +
    /* OperationErrorGenerator.kt:109 */
  318    385   
}
  319    386   
         387  +
/* CodegenDelegator.kt:255 */
  320    388   
pub use crate::operation::do_nothing::_do_nothing_output::DoNothingOutput;
  321    389   
         390  +
/* CodegenDelegator.kt:255 */
  322    391   
pub use crate::operation::do_nothing::_do_nothing_input::DoNothingInput;
  323    392   
         393  +
/* RustModule.kt:172 */
  324    394   
mod _do_nothing_input;
  325    395   
         396  +
/* RustModule.kt:172 */
  326    397   
mod _do_nothing_output;
  327    398   
  328         -
/// Builders
         399  +
/// /* CodegenDelegator.kt:51 */Builders
  329    400   
pub mod builders;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/do_nothing/_do_nothing_input.rs

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/do_nothing/_do_nothing_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct DoNothingOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct DoNothingOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl DoNothingOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::do_nothing::builders::DoNothingOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::do_nothing::builders::DoNothingOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
          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 DoNothingOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct DoNothingOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl DoNothingOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::do_nothing::DoNothingOutput {
   20         -
        crate::operation::do_nothing::DoNothingOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::do_nothing::DoNothingOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

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

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

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/get_server_statistics.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 `GetServerStatistics`.
           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 GetServerStatistics;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl GetServerStatistics {
    7         -
    /// Creates a new `GetServerStatistics`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `GetServerStatistics`
          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::get_server_statistics::GetServerStatisticsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::get_server_statistics::GetServerStatisticsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::get_server_statistics::GetServerStatisticsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +339,410 @@
   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 GetServerStatistics {
   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("GetServerStatistics");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            GetServerStatisticsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            GetServerStatisticsResponseDeserializer,
  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   
            "GetServerStatistics",
  111    122   
            "PokemonService",
  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("GetServerStatistics")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(GetServerStatisticsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::get_server_statistics::GetServerStatisticsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::get_server_statistics::GetServerStatisticsError,
  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 GetServerStatisticsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetServerStatisticsResponseDeserializer {
  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_get_server_statistics::de_get_server_statistics_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_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 GetServerStatisticsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetServerStatisticsRequestSerializer {
  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::get_server_statistics::GetServerStatisticsInput>()
  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::get_server_statistics::GetServerStatisticsInput,
  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::get_server_statistics::GetServerStatisticsInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  193    206   
            builder = _header_serialization_settings.set_default_header(
  194    207   
                builder,
  195    208   
                ::http::header::HeaderName::from_static("x-amz-target"),
  196    209   
                "PokemonService.GetServerStatistics",
  197    210   
            );
  198    211   
            builder
  199    212   
        };
  200    213   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_input(
  201    214   
            &input,
  202    215   
        )?);
  203    216   
  204    217   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  205    218   
    }
  206    219   
}
         220  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  207    221   
#[derive(Debug)]
  208    222   
struct GetServerStatisticsEndpointParamsInterceptor;
  209    223   
  210    224   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetServerStatisticsEndpointParamsInterceptor {
  211    225   
    fn name(&self) -> &'static str {
  212    226   
        "GetServerStatisticsEndpointParamsInterceptor"
  213    227   
    }
  214    228   
  215    229   
    fn read_before_execution(
  216    230   
        &self,
  217    231   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  218    232   
            '_,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  220    234   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  222    236   
        >,
  223    237   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  224    238   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  225    239   
        let _input = context
  226    240   
            .input()
  227    241   
            .downcast_ref::<GetServerStatisticsInput>()
  228    242   
            .ok_or("failed to downcast to GetServerStatisticsInput")?;
  229    243   
  230    244   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  231    245   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  232    246   
        })?;
  233    247   
        cfg.interceptor_state()
  234    248   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  235    249   
        ::std::result::Result::Ok(())
  236    250   
    }
  237    251   
}
  238    252   
  239    253   
// The get_* functions below are generated from JMESPath expressions in the
  240    254   
// operationContextParams trait. They target the operation's input shape.
  241    255   
         256  +
/* OperationErrorGenerator.kt:79 */
  242    257   
/// Error type for the `GetServerStatisticsError` operation.
         258  +
/* RustType.kt:516 */
  243    259   
#[non_exhaustive]
         260  +
/* RustType.kt:516 */
  244    261   
#[derive(::std::fmt::Debug)]
  245         -
pub enum GetServerStatisticsError {
         262  +
pub /* OperationErrorGenerator.kt:81 */ enum GetServerStatisticsError {
         263  +
    /* OperationErrorGenerator.kt:88 */
  246    264   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  247    265   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  248    266   
    variable wildcard pattern and check `.code()`:
  249    267   
     \
  250    268   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  251    269   
     \
  252    270   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetServerStatisticsError) for what information is available for the error.")]
  253    271   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         272  +
    /* OperationErrorGenerator.kt:81 */
  254    273   
}
         274  +
/* OperationErrorGenerator.kt:218 */
  255    275   
impl GetServerStatisticsError {
         276  +
    /* OperationErrorGenerator.kt:219 */
  256    277   
    /// Creates the `GetServerStatisticsError::Unhandled` variant from any error type.
  257    278   
    pub fn unhandled(
  258    279   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  259    280   
    ) -> Self {
  260    281   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  261    282   
            source: err.into(),
  262    283   
            meta: ::std::default::Default::default(),
  263    284   
        })
  264    285   
    }
  265    286   
  266    287   
    /// Creates the `GetServerStatisticsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  267    288   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  268    289   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  269    290   
            source: err.clone().into(),
  270    291   
            meta: err,
  271    292   
        })
  272    293   
    }
  273         -
    ///
         294  +
    /// /* OperationErrorGenerator.kt:236 */
  274    295   
    /// Returns error metadata, which includes the error code, message,
  275    296   
    /// request ID, and potentially additional information.
  276    297   
    ///
         298  +
    /* OperationErrorGenerator.kt:242 */
  277    299   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         300  +
        /* OperationErrorGenerator.kt:243 */
  278    301   
        match self {
  279         -
            Self::Unhandled(e) => &e.meta,
         302  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         303  +
            /* OperationErrorGenerator.kt:243 */
  280    304   
        }
         305  +
        /* OperationErrorGenerator.kt:242 */
  281    306   
    }
         307  +
    /* OperationErrorGenerator.kt:218 */
  282    308   
}
         309  +
/* OperationErrorGenerator.kt:269 */
  283    310   
impl ::std::error::Error for GetServerStatisticsError {
         311  +
    /* OperationErrorGenerator.kt:270 */
  284    312   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         313  +
        /* OperationErrorGenerator.kt:318 */
  285    314   
        match self {
  286         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         315  +
            /* OperationErrorGenerator.kt:326 */
         316  +
            Self::Unhandled(_inner) => {
         317  +
                /* OperationErrorGenerator.kt:279 */
         318  +
                ::std::option::Option::Some(&*_inner.source)
         319  +
                /* OperationErrorGenerator.kt:326 */
         320  +
            } /* OperationErrorGenerator.kt:318 */
  287    321   
        }
         322  +
        /* OperationErrorGenerator.kt:270 */
  288    323   
    }
         324  +
    /* OperationErrorGenerator.kt:269 */
  289    325   
}
         326  +
/* OperationErrorGenerator.kt:133 */
  290    327   
impl ::std::fmt::Display for GetServerStatisticsError {
         328  +
    /* OperationErrorGenerator.kt:134 */
  291    329   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         330  +
        /* OperationErrorGenerator.kt:318 */
  292    331   
        match self {
         332  +
            /* OperationErrorGenerator.kt:326 */
  293    333   
            Self::Unhandled(_inner) => {
         334  +
                /* OperationErrorGenerator.kt:139 */
  294    335   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  295    336   
                    write!(f, "unhandled error ({code})")
  296    337   
                } else {
  297    338   
                    f.write_str("unhandled error")
  298    339   
                }
  299         -
            }
         340  +
                /* OperationErrorGenerator.kt:326 */
         341  +
            } /* OperationErrorGenerator.kt:318 */
  300    342   
        }
         343  +
        /* OperationErrorGenerator.kt:134 */
  301    344   
    }
         345  +
    /* OperationErrorGenerator.kt:133 */
  302    346   
}
         347  +
/* OperationErrorGenerator.kt:182 */
  303    348   
impl ::aws_smithy_types::retry::ProvideErrorKind for GetServerStatisticsError {
         349  +
    /* OperationErrorGenerator.kt:186 */
  304    350   
    fn code(&self) -> ::std::option::Option<&str> {
         351  +
        /* OperationErrorGenerator.kt:187 */
  305    352   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         353  +
        /* OperationErrorGenerator.kt:186 */
  306    354   
    }
         355  +
    /* OperationErrorGenerator.kt:190 */
  307    356   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         357  +
        /* OperationErrorGenerator.kt:197 */
  308    358   
        ::std::option::Option::None
         359  +
        /* OperationErrorGenerator.kt:190 */
  309    360   
    }
         361  +
    /* OperationErrorGenerator.kt:182 */
  310    362   
}
         363  +
/* OperationErrorGenerator.kt:163 */
  311    364   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetServerStatisticsError {
         365  +
    /* OperationErrorGenerator.kt:164 */
  312    366   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         367  +
        /* OperationErrorGenerator.kt:318 */
  313    368   
        match self {
  314         -
            Self::Unhandled(_inner) => &_inner.meta,
         369  +
            /* OperationErrorGenerator.kt:326 */
         370  +
            Self::Unhandled(_inner) => {
         371  +
                /* OperationErrorGenerator.kt:168 */
         372  +
                &_inner.meta
         373  +
                /* OperationErrorGenerator.kt:326 */
         374  +
            } /* OperationErrorGenerator.kt:318 */
  315    375   
        }
         376  +
        /* OperationErrorGenerator.kt:164 */
  316    377   
    }
         378  +
    /* OperationErrorGenerator.kt:163 */
  317    379   
}
         380  +
/* OperationErrorGenerator.kt:109 */
  318    381   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetServerStatisticsError {
         382  +
    /* OperationErrorGenerator.kt:110 */
  319    383   
    fn create_unhandled_error(
  320    384   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  321    385   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  322    386   
    ) -> Self {
         387  +
        /* OperationErrorGenerator.kt:121 */
  323    388   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  324    389   
            source,
  325    390   
            meta: meta.unwrap_or_default(),
  326    391   
        })
         392  +
        /* OperationErrorGenerator.kt:110 */
  327    393   
    }
         394  +
    /* OperationErrorGenerator.kt:109 */
  328    395   
}
  329    396   
         397  +
/* CodegenDelegator.kt:255 */
  330    398   
pub use crate::operation::get_server_statistics::_get_server_statistics_output::GetServerStatisticsOutput;
  331    399   
         400  +
/* CodegenDelegator.kt:255 */
  332    401   
pub use crate::operation::get_server_statistics::_get_server_statistics_input::GetServerStatisticsInput;
  333    402   
         403  +
/* RustModule.kt:172 */
  334    404   
mod _get_server_statistics_input;
  335    405   
         406  +
/* RustModule.kt:172 */
  336    407   
mod _get_server_statistics_output;
  337    408   
  338         -
/// Builders
         409  +
/// /* CodegenDelegator.kt:51 */Builders
  339    410   
pub mod builders;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/get_server_statistics/_get_server_statistics_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 GetServerStatisticsInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct GetServerStatisticsInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl GetServerStatisticsInput {
    7         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
          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 GetServerStatisticsInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct GetServerStatisticsInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl GetServerStatisticsInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<crate::operation::get_server_statistics::GetServerStatisticsInput, ::aws_smithy_types::error::operation::BuildError>
   22     35   
    {
   23         -
        ::std::result::Result::Ok(crate::operation::get_server_statistics::GetServerStatisticsInput {})
          36  +
        /* BuilderGenerator.kt:254 */
          37  +
        ::std::result::Result::Ok(
          38  +
            /* BuilderGenerator.kt:477 */
          39  +
            crate::operation::get_server_statistics::GetServerStatisticsInput {
          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-awsjson-client/rust-client-codegen/src/operation/get_server_statistics/_get_server_statistics_output.rs

@@ -1,1 +60,94 @@
    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 GetServerStatisticsOutput {
    6         -
    /// The number of calls executed by the server.
           8  +
pub /* StructureGenerator.kt:201 */ struct GetServerStatisticsOutput {
           9  +
    /// /* StructureGenerator.kt:231 */The number of calls executed by the server.
    7     10   
    pub calls_count: i64,
          11  +
    /* StructureGenerator.kt:201 */
    8     12   
}
          13  +
/* StructureGenerator.kt:135 */
    9     14   
impl GetServerStatisticsOutput {
   10         -
    /// The number of calls executed by the server.
          15  +
    /// /* StructureGenerator.kt:231 */The number of calls executed by the server.
          16  +
    /* StructureGenerator.kt:166 */
   11     17   
    pub fn calls_count(&self) -> i64 {
          18  +
        /* StructureGenerator.kt:168 */
   12     19   
        self.calls_count
          20  +
        /* StructureGenerator.kt:166 */
   13     21   
    }
          22  +
    /* StructureGenerator.kt:135 */
   14     23   
}
          24  +
/* ClientCodegenVisitor.kt:237 */
   15     25   
impl GetServerStatisticsOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
          26  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
          27  +
    /* BuilderGenerator.kt:175 */
   17     28   
    pub fn builder() -> crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder {
          29  +
        /* BuilderGenerator.kt:176 */
   18     30   
        crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder::default()
          31  +
        /* BuilderGenerator.kt:175 */
   19     32   
    }
          33  +
    /* ClientCodegenVisitor.kt:237 */
   20     34   
}
   21     35   
   22         -
/// A builder for [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
          36  +
/// /* BuilderGenerator.kt:342 */A builder for [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
          37  +
/* RustType.kt:516 */
   23     38   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          39  +
/* RustType.kt:516 */
   24     40   
#[non_exhaustive]
          41  +
/* BuilderGenerator.kt:345 */
   25     42   
pub struct GetServerStatisticsOutputBuilder {
   26         -
    pub(crate) calls_count: ::std::option::Option<i64>,
          43  +
    /* BuilderGenerator.kt:275 */ pub(crate) calls_count: ::std::option::Option<i64>,
          44  +
    /* BuilderGenerator.kt:345 */
   27     45   
}
          46  +
/* BuilderGenerator.kt:355 */
   28     47   
impl GetServerStatisticsOutputBuilder {
   29         -
    /// The number of calls executed by the server.
   30         -
    /// This field is required.
          48  +
    /// /* BuilderGenerator.kt:286 */The number of calls executed by the server.
          49  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          50  +
    /* BuilderGenerator.kt:291 */
   31     51   
    pub fn calls_count(mut self, input: i64) -> Self {
          52  +
        /* BuilderGenerator.kt:292 */
   32     53   
        self.calls_count = ::std::option::Option::Some(input);
          54  +
        /* BuilderGenerator.kt:293 */
   33     55   
        self
          56  +
        /* BuilderGenerator.kt:291 */
   34     57   
    }
   35         -
    /// The number of calls executed by the server.
          58  +
    /// /* BuilderGenerator.kt:312 */The number of calls executed by the server.
          59  +
    /* BuilderGenerator.kt:314 */
   36     60   
    pub fn set_calls_count(mut self, input: ::std::option::Option<i64>) -> Self {
          61  +
        /* BuilderGenerator.kt:315 */
   37     62   
        self.calls_count = input;
   38     63   
        self
          64  +
        /* BuilderGenerator.kt:314 */
   39     65   
    }
   40         -
    /// The number of calls executed by the server.
          66  +
    /// /* BuilderGenerator.kt:334 */The number of calls executed by the server.
          67  +
    /* BuilderGenerator.kt:336 */
   41     68   
    pub fn get_calls_count(&self) -> &::std::option::Option<i64> {
          69  +
        /* BuilderGenerator.kt:337 */
   42     70   
        &self.calls_count
          71  +
        /* BuilderGenerator.kt:336 */
   43     72   
    }
   44         -
    /// Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
   45         -
    /// This method will fail if any of the following fields are not set:
   46         -
    /// - [`calls_count`](crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder::calls_count)
          73  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
          74  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
          75  +
    /// /* BuilderGenerator.kt:246 */- [`calls_count`](crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder::calls_count)
          76  +
    /* BuilderGenerator.kt:253 */
   47     77   
    pub fn build(
   48     78   
        self,
   49     79   
    ) -> ::std::result::Result<crate::operation::get_server_statistics::GetServerStatisticsOutput, ::aws_smithy_types::error::operation::BuildError>
   50     80   
    {
   51         -
        ::std::result::Result::Ok(crate::operation::get_server_statistics::GetServerStatisticsOutput {
   52         -
            calls_count: self.calls_count.ok_or_else(|| {
   53         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   54         -
                    "calls_count",
   55         -
                    "calls_count was not specified but it is required when building GetServerStatisticsOutput",
   56         -
                )
   57         -
            })?,
   58         -
        })
          81  +
        /* BuilderGenerator.kt:254 */
          82  +
        ::std::result::Result::Ok(
          83  +
            /* BuilderGenerator.kt:477 */crate::operation::get_server_statistics::GetServerStatisticsOutput {
          84  +
                /* BuilderGenerator.kt:481 */calls_count: self.calls_count
          85  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
          86  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("calls_count", "calls_count was not specified but it is required when building GetServerStatisticsOutput")
          87  +
                    /* BuilderGenerator.kt:494 */)?
          88  +
                ,
          89  +
            /* BuilderGenerator.kt:477 */}
          90  +
        /* BuilderGenerator.kt:254 */)
          91  +
        /* BuilderGenerator.kt:253 */
   59     92   
    }
          93  +
    /* BuilderGenerator.kt:355 */
   60     94   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/get_server_statistics/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::get_server_statistics::_get_server_statistics_output::GetServerStatisticsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::get_server_statistics::_get_server_statistics_input::GetServerStatisticsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder {
    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_server_statistics::GetServerStatisticsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::get_server_statistics::GetServerStatisticsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.get_server_statistics();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `GetServerStatistics`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `GetServerStatistics`.
   24     27   
///
   25         -
/// Retrieve HTTP server statistiscs, such as calls count.
          28  +
/// /* FluentBuilderGenerator.kt:130 */Retrieve HTTP server statistiscs, such as calls count.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct GetServerStatisticsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder,
   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_server_statistics::GetServerStatisticsOutput,
   35     41   
        crate::operation::get_server_statistics::GetServerStatisticsError,
   36     42   
    > for GetServerStatisticsFluentBuilder
   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_server_statistics::GetServerStatisticsOutput,
   44     50   
            crate::operation::get_server_statistics::GetServerStatisticsError,
   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 GetServerStatisticsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `GetServerStatisticsFluentBuilder`.
   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 GetServerStatistics as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder {
   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_server_statistics::GetServerStatisticsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::get_server_statistics::GetServerStatisticsError,
   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_server_statistics::GetServerStatistics::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_server_statistics::GetServerStatistics::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_server_statistics::GetServerStatisticsOutput,
   97    107   
        crate::operation::get_server_statistics::GetServerStatisticsError,
   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-awsjson-client/rust-client-codegen/src/primitives.rs

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

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

@@ -1,1 +66,70 @@
    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  +
/* AwsJson.kt:203 */
   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_server_statistics;
   33     35   
   34     36   
pub(crate) mod shape_capture_pokemon_output;
   35     37   
   36     38   
pub(crate) mod shape_capturing_event;
   37     39   
          40  +
/* JsonParserGenerator.kt:227 */
   38     41   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   39     42   
    if data.is_empty() {
   40     43   
        b"{}"
   41     44   
    } else {
   42     45   
        data
   43     46   
    }
   44     47   
}
   45     48   
   46     49   
pub(crate) mod shape_invalid_pokeball_error;
   47     50   
   48     51   
pub(crate) mod shape_master_ball_unsuccessful;
   49     52   
   50     53   
pub(crate) mod shape_throttling_error;
   51     54   
   52     55   
pub(crate) mod shape_unsupported_region_error;
   53     56   
   54     57   
pub(crate) mod shape_validation_exception;
   55     58   
          59  +
/* AwsJson.kt:216 */
   56     60   
pub fn parse_event_stream_error_metadata(
   57     61   
    payload: &::bytes::Bytes,
   58     62   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   59     63   
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
   60     64   
}
   61     65   
   62     66   
pub(crate) mod shape_capturing_payload;
   63     67   
   64     68   
pub(crate) mod shape_validation_exception_field_list;
   65     69   

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-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-awsjson-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   
}