Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_timestamp_query_http_date/builders.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_union.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 `MalformedUnion`.
           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 MalformedUnion;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl MalformedUnion {
    7         -
    /// Creates a new `MalformedUnion`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `MalformedUnion`
          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::malformed_union::MalformedUnionInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::malformed_union::MalformedUnionOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::malformed_union::MalformedUnionError,
   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 MalformedUnion {
   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("MalformedUnion");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            MalformedUnionRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            MalformedUnionResponseDeserializer,
   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   
            "MalformedUnion",
  105    116   
            "Rest Json Protocol",
  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("MalformedUnion")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(MalformedUnionEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::malformed_union::MalformedUnionError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::malformed_union::MalformedUnionError,
  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 MalformedUnionResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedUnionResponseDeserializer {
  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_malformed_union::de_malformed_union_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_malformed_union::de_malformed_union_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 MalformedUnionRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedUnionRequestSerializer {
  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
  161    174   
            .downcast::<crate::operation::malformed_union::MalformedUnionInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::malformed_union::MalformedUnionInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/MalformedUnion").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::malformed_union::MalformedUnionInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_malformed_union::ser_malformed_union_input(&input)?);
  190    203   
        if let Some(content_length) = body.content_length() {
  191    204   
            let content_length = content_length.to_string();
  192    205   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  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 MalformedUnionEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedUnionEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "MalformedUnionEndpointParamsInterceptor"
  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::<MalformedUnionInput>()
  218    232   
            .ok_or("failed to downcast to MalformedUnionInput")?;
  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 `MalformedUnionError` operation.
         248  +
/* RustType.kt:516 */
  233    249   
#[non_exhaustive]
         250  +
/* RustType.kt:516 */
  234    251   
#[derive(::std::fmt::Debug)]
  235         -
pub enum MalformedUnionError {
         252  +
pub /* OperationErrorGenerator.kt:81 */ enum MalformedUnionError {
         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-MalformedUnionError) 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 MalformedUnionError {
         266  +
    /* OperationErrorGenerator.kt:219 */
  246    267   
    /// Creates the `MalformedUnionError::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 `MalformedUnionError::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 MalformedUnionError {
         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 MalformedUnionError {
         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 MalformedUnionError {
         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 MalformedUnionError {
         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 MalformedUnionError {
         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::malformed_union::_malformed_union_output::MalformedUnionOutput;
  321    389   
         390  +
/* CodegenDelegator.kt:255 */
  322    391   
pub use crate::operation::malformed_union::_malformed_union_input::MalformedUnionInput;
  323    392   
         393  +
/* RustModule.kt:172 */
  324    394   
mod _malformed_union_input;
  325    395   
         396  +
/* RustModule.kt:172 */
  326    397   
mod _malformed_union_output;
  327    398   
  328         -
/// Builders
         399  +
/// /* CodegenDelegator.kt:51 */Builders
  329    400   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_union/_malformed_union_input.rs

@@ -1,1 +49,93 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct MalformedUnionInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MalformedUnionInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub union: ::std::option::Option<crate::types::SimpleUnion>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MalformedUnionInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn union(&self) -> ::std::option::Option<&crate::types::SimpleUnion> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.union.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MalformedUnionInput {
   16         -
    /// Creates a new builder-style object to manufacture [`MalformedUnionInput`](crate::operation::malformed_union::MalformedUnionInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MalformedUnionInput`](crate::operation::malformed_union::MalformedUnionInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::malformed_union::builders::MalformedUnionInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::malformed_union::builders::MalformedUnionInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MalformedUnionInput`](crate::operation::malformed_union::MalformedUnionInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MalformedUnionInput`](crate::operation::malformed_union::MalformedUnionInput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct MalformedUnionInputBuilder {
   26         -
    pub(crate) union: ::std::option::Option<crate::types::SimpleUnion>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) union: ::std::option::Option<crate::types::SimpleUnion>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl MalformedUnionInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn union(mut self, input: crate::types::SimpleUnion) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.union = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_union(mut self, input: ::std::option::Option<crate::types::SimpleUnion>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.union = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_union(&self) -> &::std::option::Option<crate::types::SimpleUnion> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.union
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`MalformedUnionInput`](crate::operation::malformed_union::MalformedUnionInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MalformedUnionInput`](crate::operation::malformed_union::MalformedUnionInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<crate::operation::malformed_union::MalformedUnionInput, ::aws_smithy_types::error::operation::BuildError> {
   47         -
        ::std::result::Result::Ok(crate::operation::malformed_union::MalformedUnionInput { union: self.union })
          82  +
        /* BuilderGenerator.kt:254 */
          83  +
        ::std::result::Result::Ok(
          84  +
            /* BuilderGenerator.kt:477 */
          85  +
            crate::operation::malformed_union::MalformedUnionInput {
          86  +
                /* BuilderGenerator.kt:481 */ union: self.union,
          87  +
                /* BuilderGenerator.kt:477 */
          88  +
            }, /* BuilderGenerator.kt:254 */
          89  +
        )
          90  +
        /* BuilderGenerator.kt:253 */
   48     91   
    }
          92  +
    /* BuilderGenerator.kt:355 */
   49     93   
}

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_union/builders.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/media_type_header.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 `MediaTypeHeader`.
           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 MediaTypeHeader;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl MediaTypeHeader {
    7         -
    /// Creates a new `MediaTypeHeader`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `MediaTypeHeader`
          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::media_type_header::MediaTypeHeaderInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::media_type_header::MediaTypeHeaderOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::media_type_header::MediaTypeHeaderError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +266,283 @@
   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 MediaTypeHeader {
   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("MediaTypeHeader");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            MediaTypeHeaderRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            MediaTypeHeaderResponseDeserializer,
  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   
            "MediaTypeHeader",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("MediaTypeHeader")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(MediaTypeHeaderEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::media_type_header::MediaTypeHeaderError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::media_type_header::MediaTypeHeaderError,
  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 MediaTypeHeaderResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MediaTypeHeaderResponseDeserializer {
  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_media_type_header::de_media_type_header_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_media_type_header::de_media_type_header_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 MediaTypeHeaderRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MediaTypeHeaderRequestSerializer {
  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::media_type_header::MediaTypeHeaderInput>()
  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::media_type_header::MediaTypeHeaderInput,
  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, "/MediaTypeHeader").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::media_type_header::MediaTypeHeaderInput,
  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   
                let builder = crate::protocol_serde::shape_media_type_header::ser_media_type_header_headers(input, builder)?;
  190    203   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  191    204   
            }
  192    205   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  196    209   
  197    210   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  198    211   
    }
  199    212   
}
         213  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  200    214   
#[derive(Debug)]
  201    215   
struct MediaTypeHeaderEndpointParamsInterceptor;
  202    216   
  203    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MediaTypeHeaderEndpointParamsInterceptor {
  204    218   
    fn name(&self) -> &'static str {
  205    219   
        "MediaTypeHeaderEndpointParamsInterceptor"
  206    220   
    }
  207    221   
  208    222   
    fn read_before_execution(
  209    223   
        &self,
  210    224   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  211    225   
            '_,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  214    228   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  215    229   
        >,
  216    230   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  217    231   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  218    232   
        let _input = context
  219    233   
            .input()
  220    234   
            .downcast_ref::<MediaTypeHeaderInput>()
  221    235   
            .ok_or("failed to downcast to MediaTypeHeaderInput")?;
  222    236   
  223    237   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  224    238   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  225    239   
        })?;
  226    240   
        cfg.interceptor_state()
  227    241   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  228    242   
        ::std::result::Result::Ok(())
  229    243   
    }
  230    244   
}
  231    245   
  232    246   
// The get_* functions below are generated from JMESPath expressions in the
  233    247   
// operationContextParams trait. They target the operation's input shape.
  234    248   
         249  +
/* RustType.kt:516 */
  235    250   
#[allow(unreachable_code, unused_variables)]
         251  +
/* RustType.kt:516 */
  236    252   
#[cfg(test)]
         253  +
/* ProtocolTestGenerator.kt:98 */
  237    254   
mod media_type_header_test {
  238    255   
  239    256   
    /// Headers that target strings with a mediaType are base64 encoded
  240    257   
    /// Test ID: MediaTypeHeaderInputBase64
  241    258   
    #[::tokio::test]
  242    259   
    #[::tracing_test::traced_test]
  243    260   
    async fn media_type_header_input_base64_request() {
  244    261   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  245    262   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  246    263   
@@ -276,293 +405,481 @@
  296    313   
                )))
  297    314   
            });
  298    315   
            de.deserialize_nonstreaming(&http_response)
  299    316   
        });
  300    317   
        let parsed = parsed
  301    318   
            .expect("should be successful response")
  302    319   
            .downcast::<crate::operation::media_type_header::MediaTypeHeaderOutput>()
  303    320   
            .unwrap();
  304    321   
        ::pretty_assertions::assert_eq!(parsed.json, expected_output.json, "Unexpected value for `json`");
  305    322   
    }
         323  +
         324  +
    /* ProtocolTestGenerator.kt:98 */
  306    325   
}
  307    326   
         327  +
/* OperationErrorGenerator.kt:79 */
  308    328   
/// Error type for the `MediaTypeHeaderError` operation.
         329  +
/* RustType.kt:516 */
  309    330   
#[non_exhaustive]
         331  +
/* RustType.kt:516 */
  310    332   
#[derive(::std::fmt::Debug)]
  311         -
pub enum MediaTypeHeaderError {
         333  +
pub /* OperationErrorGenerator.kt:81 */ enum MediaTypeHeaderError {
         334  +
    /* OperationErrorGenerator.kt:88 */
  312    335   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  313    336   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  314    337   
    variable wildcard pattern and check `.code()`:
  315    338   
     \
  316    339   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  317    340   
     \
  318    341   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MediaTypeHeaderError) for what information is available for the error.")]
  319    342   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         343  +
    /* OperationErrorGenerator.kt:81 */
  320    344   
}
         345  +
/* OperationErrorGenerator.kt:218 */
  321    346   
impl MediaTypeHeaderError {
         347  +
    /* OperationErrorGenerator.kt:219 */
  322    348   
    /// Creates the `MediaTypeHeaderError::Unhandled` variant from any error type.
  323    349   
    pub fn unhandled(
  324    350   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  325    351   
    ) -> Self {
  326    352   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  327    353   
            source: err.into(),
  328    354   
            meta: ::std::default::Default::default(),
  329    355   
        })
  330    356   
    }
  331    357   
  332    358   
    /// Creates the `MediaTypeHeaderError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  333    359   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  334    360   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  335    361   
            source: err.clone().into(),
  336    362   
            meta: err,
  337    363   
        })
  338    364   
    }
  339         -
    ///
         365  +
    /// /* OperationErrorGenerator.kt:236 */
  340    366   
    /// Returns error metadata, which includes the error code, message,
  341    367   
    /// request ID, and potentially additional information.
  342    368   
    ///
         369  +
    /* OperationErrorGenerator.kt:242 */
  343    370   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         371  +
        /* OperationErrorGenerator.kt:243 */
  344    372   
        match self {
  345         -
            Self::Unhandled(e) => &e.meta,
         373  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         374  +
            /* OperationErrorGenerator.kt:243 */
  346    375   
        }
         376  +
        /* OperationErrorGenerator.kt:242 */
  347    377   
    }
         378  +
    /* OperationErrorGenerator.kt:218 */
  348    379   
}
         380  +
/* OperationErrorGenerator.kt:269 */
  349    381   
impl ::std::error::Error for MediaTypeHeaderError {
         382  +
    /* OperationErrorGenerator.kt:270 */
  350    383   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         384  +
        /* OperationErrorGenerator.kt:318 */
  351    385   
        match self {
  352         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         386  +
            /* OperationErrorGenerator.kt:326 */
         387  +
            Self::Unhandled(_inner) => {
         388  +
                /* OperationErrorGenerator.kt:279 */
         389  +
                ::std::option::Option::Some(&*_inner.source)
         390  +
                /* OperationErrorGenerator.kt:326 */
         391  +
            } /* OperationErrorGenerator.kt:318 */
  353    392   
        }
         393  +
        /* OperationErrorGenerator.kt:270 */
  354    394   
    }
         395  +
    /* OperationErrorGenerator.kt:269 */
  355    396   
}
         397  +
/* OperationErrorGenerator.kt:133 */
  356    398   
impl ::std::fmt::Display for MediaTypeHeaderError {
         399  +
    /* OperationErrorGenerator.kt:134 */
  357    400   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         401  +
        /* OperationErrorGenerator.kt:318 */
  358    402   
        match self {
         403  +
            /* OperationErrorGenerator.kt:326 */
  359    404   
            Self::Unhandled(_inner) => {
         405  +
                /* OperationErrorGenerator.kt:139 */
  360    406   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  361    407   
                    write!(f, "unhandled error ({code})")
  362    408   
                } else {
  363    409   
                    f.write_str("unhandled error")
  364    410   
                }
  365         -
            }
         411  +
                /* OperationErrorGenerator.kt:326 */
         412  +
            } /* OperationErrorGenerator.kt:318 */
  366    413   
        }
         414  +
        /* OperationErrorGenerator.kt:134 */
  367    415   
    }
         416  +
    /* OperationErrorGenerator.kt:133 */
  368    417   
}
         418  +
/* OperationErrorGenerator.kt:182 */
  369    419   
impl ::aws_smithy_types::retry::ProvideErrorKind for MediaTypeHeaderError {
         420  +
    /* OperationErrorGenerator.kt:186 */
  370    421   
    fn code(&self) -> ::std::option::Option<&str> {
         422  +
        /* OperationErrorGenerator.kt:187 */
  371    423   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         424  +
        /* OperationErrorGenerator.kt:186 */
  372    425   
    }
         426  +
    /* OperationErrorGenerator.kt:190 */
  373    427   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         428  +
        /* OperationErrorGenerator.kt:197 */
  374    429   
        ::std::option::Option::None
         430  +
        /* OperationErrorGenerator.kt:190 */
  375    431   
    }
         432  +
    /* OperationErrorGenerator.kt:182 */
  376    433   
}
         434  +
/* OperationErrorGenerator.kt:163 */
  377    435   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MediaTypeHeaderError {
         436  +
    /* OperationErrorGenerator.kt:164 */
  378    437   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         438  +
        /* OperationErrorGenerator.kt:318 */
  379    439   
        match self {
  380         -
            Self::Unhandled(_inner) => &_inner.meta,
         440  +
            /* OperationErrorGenerator.kt:326 */
         441  +
            Self::Unhandled(_inner) => {
         442  +
                /* OperationErrorGenerator.kt:168 */
         443  +
                &_inner.meta
         444  +
                /* OperationErrorGenerator.kt:326 */
         445  +
            } /* OperationErrorGenerator.kt:318 */
  381    446   
        }
         447  +
        /* OperationErrorGenerator.kt:164 */
  382    448   
    }
         449  +
    /* OperationErrorGenerator.kt:163 */
  383    450   
}
         451  +
/* OperationErrorGenerator.kt:109 */
  384    452   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MediaTypeHeaderError {
         453  +
    /* OperationErrorGenerator.kt:110 */
  385    454   
    fn create_unhandled_error(
  386    455   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  387    456   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  388    457   
    ) -> Self {
         458  +
        /* OperationErrorGenerator.kt:121 */
  389    459   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  390    460   
            source,
  391    461   
            meta: meta.unwrap_or_default(),
  392    462   
        })
         463  +
        /* OperationErrorGenerator.kt:110 */
  393    464   
    }
         465  +
    /* OperationErrorGenerator.kt:109 */
  394    466   
}
  395    467   
         468  +
/* CodegenDelegator.kt:255 */
  396    469   
pub use crate::operation::media_type_header::_media_type_header_output::MediaTypeHeaderOutput;
  397    470   
         471  +
/* CodegenDelegator.kt:255 */
  398    472   
pub use crate::operation::media_type_header::_media_type_header_input::MediaTypeHeaderInput;
  399    473   
         474  +
/* RustModule.kt:172 */
  400    475   
mod _media_type_header_input;
  401    476   
         477  +
/* RustModule.kt:172 */
  402    478   
mod _media_type_header_output;
  403    479   
  404         -
/// Builders
         480  +
/// /* CodegenDelegator.kt:51 */Builders
  405    481   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/media_type_header/_media_type_header_input.rs

@@ -1,1 +49,93 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct MediaTypeHeaderInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MediaTypeHeaderInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub json: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MediaTypeHeaderInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn json(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.json.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MediaTypeHeaderInput {
   16         -
    /// Creates a new builder-style object to manufacture [`MediaTypeHeaderInput`](crate::operation::media_type_header::MediaTypeHeaderInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MediaTypeHeaderInput`](crate::operation::media_type_header::MediaTypeHeaderInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::media_type_header::builders::MediaTypeHeaderInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::media_type_header::builders::MediaTypeHeaderInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MediaTypeHeaderInput`](crate::operation::media_type_header::MediaTypeHeaderInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MediaTypeHeaderInput`](crate::operation::media_type_header::MediaTypeHeaderInput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct MediaTypeHeaderInputBuilder {
   26         -
    pub(crate) json: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) json: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl MediaTypeHeaderInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn json(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.json = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_json(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.json = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_json(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.json
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`MediaTypeHeaderInput`](crate::operation::media_type_header::MediaTypeHeaderInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MediaTypeHeaderInput`](crate::operation::media_type_header::MediaTypeHeaderInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<crate::operation::media_type_header::MediaTypeHeaderInput, ::aws_smithy_types::error::operation::BuildError> {
   47         -
        ::std::result::Result::Ok(crate::operation::media_type_header::MediaTypeHeaderInput { json: self.json })
          82  +
        /* BuilderGenerator.kt:254 */
          83  +
        ::std::result::Result::Ok(
          84  +
            /* BuilderGenerator.kt:477 */
          85  +
            crate::operation::media_type_header::MediaTypeHeaderInput {
          86  +
                /* BuilderGenerator.kt:481 */ json: self.json,
          87  +
                /* BuilderGenerator.kt:477 */
          88  +
            }, /* BuilderGenerator.kt:254 */
          89  +
        )
          90  +
        /* BuilderGenerator.kt:253 */
   48     91   
    }
          92  +
    /* BuilderGenerator.kt:355 */
   49     93   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/media_type_header/_media_type_header_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/media_type_header/builders.rs

@@ -1,1 +125,143 @@
    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::media_type_header::_media_type_header_output::MediaTypeHeaderOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::media_type_header::_media_type_header_input::MediaTypeHeaderInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::media_type_header::builders::MediaTypeHeaderInputBuilder {
    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::media_type_header::MediaTypeHeaderOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::media_type_header::MediaTypeHeaderError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.media_type_header();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `MediaTypeHeader`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `MediaTypeHeader`.
   24     27   
///
   25         -
/// This example ensures that mediaType strings are base64 encoded in headers.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example ensures that mediaType strings are base64 encoded in headers.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct MediaTypeHeaderFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::media_type_header::builders::MediaTypeHeaderInputBuilder,
   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::media_type_header::MediaTypeHeaderOutput,
   35     41   
        crate::operation::media_type_header::MediaTypeHeaderError,
   36     42   
    > for MediaTypeHeaderFluentBuilder
   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::media_type_header::MediaTypeHeaderOutput,
   44     50   
            crate::operation::media_type_header::MediaTypeHeaderError,
   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 MediaTypeHeaderFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `MediaTypeHeaderFluentBuilder`.
   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 MediaTypeHeader as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::media_type_header::builders::MediaTypeHeaderInputBuilder {
   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::media_type_header::MediaTypeHeaderOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::media_type_header::MediaTypeHeaderError,
   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::media_type_header::MediaTypeHeader::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::media_type_header::MediaTypeHeader::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::media_type_header::MediaTypeHeaderOutput,
   97    107   
        crate::operation::media_type_header::MediaTypeHeaderError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:498 */
  111    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* FluentBuilderGenerator.kt:500 */
  112    125   
    pub fn json(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.json(input.into());
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_json(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_json(input);
  119    134   
        self
  120    135   
    }
         136  +
    /* FluentBuilderGenerator.kt:518 */
  121    137   
    #[allow(missing_docs)] // documentation missing in model
         138  +
                           /* FluentBuilderGenerator.kt:520 */
  122    139   
    pub fn get_json(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_json()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/no_input_and_no_output.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 `NoInputAndNoOutput`.
           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 NoInputAndNoOutput;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl NoInputAndNoOutput {
    7         -
    /// Creates a new `NoInputAndNoOutput`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `NoInputAndNoOutput`
          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::no_input_and_no_output::NoInputAndNoOutputInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   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 NoInputAndNoOutput {
   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("NoInputAndNoOutput");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            NoInputAndNoOutputRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            NoInputAndNoOutputResponseDeserializer,
  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   
            "NoInputAndNoOutput",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("NoInputAndNoOutput")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(NoInputAndNoOutputEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
  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 NoInputAndNoOutputResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputAndNoOutputResponseDeserializer {
  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_no_input_and_no_output::de_no_input_and_no_output_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_no_input_and_no_output::de_no_input_and_no_output_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 NoInputAndNoOutputRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NoInputAndNoOutputRequestSerializer {
  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::no_input_and_no_output::NoInputAndNoOutputInput>()
  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::no_input_and_no_output::NoInputAndNoOutputInput,
  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, "/NoInputAndNoOutput").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::no_input_and_no_output::NoInputAndNoOutputInput,
  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
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct NoInputAndNoOutputEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NoInputAndNoOutputEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "NoInputAndNoOutputEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<NoInputAndNoOutputInput>()
  220    234   
            .ok_or("failed to downcast to NoInputAndNoOutputInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod no_input_and_no_output_test {
  237    254   
  238    255   
    /// No input serializes no payload. When clients do not need to
  239    256   
    /// serialize any data in the payload, they should omit a payload
  240    257   
    /// altogether.
  241    258   
    /// Test ID: RestJsonNoInputAndNoOutput
  242    259   
    #[::tokio::test]
  243    260   
    #[::tracing_test::traced_test]
  244    261   
    async fn rest_json_no_input_and_no_output_request() {
  245    262   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
@@ -269,286 +398,474 @@
  289    306   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  290    307   
                )))
  291    308   
            });
  292    309   
            de.deserialize_nonstreaming(&http_response)
  293    310   
        });
  294    311   
        let parsed = parsed
  295    312   
            .expect("should be successful response")
  296    313   
            .downcast::<crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput>()
  297    314   
            .unwrap();
  298    315   
    }
         316  +
         317  +
    /* ProtocolTestGenerator.kt:98 */
  299    318   
}
  300    319   
         320  +
/* OperationErrorGenerator.kt:79 */
  301    321   
/// Error type for the `NoInputAndNoOutputError` operation.
         322  +
/* RustType.kt:516 */
  302    323   
#[non_exhaustive]
         324  +
/* RustType.kt:516 */
  303    325   
#[derive(::std::fmt::Debug)]
  304         -
pub enum NoInputAndNoOutputError {
         326  +
pub /* OperationErrorGenerator.kt:81 */ enum NoInputAndNoOutputError {
         327  +
    /* OperationErrorGenerator.kt:88 */
  305    328   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  306    329   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  307    330   
    variable wildcard pattern and check `.code()`:
  308    331   
     \
  309    332   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  310    333   
     \
  311    334   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-NoInputAndNoOutputError) for what information is available for the error.")]
  312    335   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         336  +
    /* OperationErrorGenerator.kt:81 */
  313    337   
}
         338  +
/* OperationErrorGenerator.kt:218 */
  314    339   
impl NoInputAndNoOutputError {
         340  +
    /* OperationErrorGenerator.kt:219 */
  315    341   
    /// Creates the `NoInputAndNoOutputError::Unhandled` variant from any error type.
  316    342   
    pub fn unhandled(
  317    343   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  318    344   
    ) -> Self {
  319    345   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  320    346   
            source: err.into(),
  321    347   
            meta: ::std::default::Default::default(),
  322    348   
        })
  323    349   
    }
  324    350   
  325    351   
    /// Creates the `NoInputAndNoOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  326    352   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  327    353   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  328    354   
            source: err.clone().into(),
  329    355   
            meta: err,
  330    356   
        })
  331    357   
    }
  332         -
    ///
         358  +
    /// /* OperationErrorGenerator.kt:236 */
  333    359   
    /// Returns error metadata, which includes the error code, message,
  334    360   
    /// request ID, and potentially additional information.
  335    361   
    ///
         362  +
    /* OperationErrorGenerator.kt:242 */
  336    363   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         364  +
        /* OperationErrorGenerator.kt:243 */
  337    365   
        match self {
  338         -
            Self::Unhandled(e) => &e.meta,
         366  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         367  +
            /* OperationErrorGenerator.kt:243 */
  339    368   
        }
         369  +
        /* OperationErrorGenerator.kt:242 */
  340    370   
    }
         371  +
    /* OperationErrorGenerator.kt:218 */
  341    372   
}
         373  +
/* OperationErrorGenerator.kt:269 */
  342    374   
impl ::std::error::Error for NoInputAndNoOutputError {
         375  +
    /* OperationErrorGenerator.kt:270 */
  343    376   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         377  +
        /* OperationErrorGenerator.kt:318 */
  344    378   
        match self {
  345         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         379  +
            /* OperationErrorGenerator.kt:326 */
         380  +
            Self::Unhandled(_inner) => {
         381  +
                /* OperationErrorGenerator.kt:279 */
         382  +
                ::std::option::Option::Some(&*_inner.source)
         383  +
                /* OperationErrorGenerator.kt:326 */
         384  +
            } /* OperationErrorGenerator.kt:318 */
  346    385   
        }
         386  +
        /* OperationErrorGenerator.kt:270 */
  347    387   
    }
         388  +
    /* OperationErrorGenerator.kt:269 */
  348    389   
}
         390  +
/* OperationErrorGenerator.kt:133 */
  349    391   
impl ::std::fmt::Display for NoInputAndNoOutputError {
         392  +
    /* OperationErrorGenerator.kt:134 */
  350    393   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         394  +
        /* OperationErrorGenerator.kt:318 */
  351    395   
        match self {
         396  +
            /* OperationErrorGenerator.kt:326 */
  352    397   
            Self::Unhandled(_inner) => {
         398  +
                /* OperationErrorGenerator.kt:139 */
  353    399   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  354    400   
                    write!(f, "unhandled error ({code})")
  355    401   
                } else {
  356    402   
                    f.write_str("unhandled error")
  357    403   
                }
  358         -
            }
         404  +
                /* OperationErrorGenerator.kt:326 */
         405  +
            } /* OperationErrorGenerator.kt:318 */
  359    406   
        }
         407  +
        /* OperationErrorGenerator.kt:134 */
  360    408   
    }
         409  +
    /* OperationErrorGenerator.kt:133 */
  361    410   
}
         411  +
/* OperationErrorGenerator.kt:182 */
  362    412   
impl ::aws_smithy_types::retry::ProvideErrorKind for NoInputAndNoOutputError {
         413  +
    /* OperationErrorGenerator.kt:186 */
  363    414   
    fn code(&self) -> ::std::option::Option<&str> {
         415  +
        /* OperationErrorGenerator.kt:187 */
  364    416   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         417  +
        /* OperationErrorGenerator.kt:186 */
  365    418   
    }
         419  +
    /* OperationErrorGenerator.kt:190 */
  366    420   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         421  +
        /* OperationErrorGenerator.kt:197 */
  367    422   
        ::std::option::Option::None
         423  +
        /* OperationErrorGenerator.kt:190 */
  368    424   
    }
         425  +
    /* OperationErrorGenerator.kt:182 */
  369    426   
}
         427  +
/* OperationErrorGenerator.kt:163 */
  370    428   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for NoInputAndNoOutputError {
         429  +
    /* OperationErrorGenerator.kt:164 */
  371    430   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         431  +
        /* OperationErrorGenerator.kt:318 */
  372    432   
        match self {
  373         -
            Self::Unhandled(_inner) => &_inner.meta,
         433  +
            /* OperationErrorGenerator.kt:326 */
         434  +
            Self::Unhandled(_inner) => {
         435  +
                /* OperationErrorGenerator.kt:168 */
         436  +
                &_inner.meta
         437  +
                /* OperationErrorGenerator.kt:326 */
         438  +
            } /* OperationErrorGenerator.kt:318 */
  374    439   
        }
         440  +
        /* OperationErrorGenerator.kt:164 */
  375    441   
    }
         442  +
    /* OperationErrorGenerator.kt:163 */
  376    443   
}
         444  +
/* OperationErrorGenerator.kt:109 */
  377    445   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for NoInputAndNoOutputError {
         446  +
    /* OperationErrorGenerator.kt:110 */
  378    447   
    fn create_unhandled_error(
  379    448   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  380    449   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  381    450   
    ) -> Self {
         451  +
        /* OperationErrorGenerator.kt:121 */
  382    452   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  383    453   
            source,
  384    454   
            meta: meta.unwrap_or_default(),
  385    455   
        })
         456  +
        /* OperationErrorGenerator.kt:110 */
  386    457   
    }
         458  +
    /* OperationErrorGenerator.kt:109 */
  387    459   
}
  388    460   
         461  +
/* CodegenDelegator.kt:255 */
  389    462   
pub use crate::operation::no_input_and_no_output::_no_input_and_no_output_output::NoInputAndNoOutputOutput;
  390    463   
         464  +
/* CodegenDelegator.kt:255 */
  391    465   
pub use crate::operation::no_input_and_no_output::_no_input_and_no_output_input::NoInputAndNoOutputInput;
  392    466   
         467  +
/* RustModule.kt:172 */
  393    468   
mod _no_input_and_no_output_input;
  394    469   
         470  +
/* RustModule.kt:172 */
  395    471   
mod _no_input_and_no_output_output;
  396    472   
  397         -
/// Builders
         473  +
/// /* CodegenDelegator.kt:51 */Builders
  398    474   
pub mod builders;

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/no_input_and_no_output/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::no_input_and_no_output::_no_input_and_no_output_output::NoInputAndNoOutputOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::no_input_and_no_output::_no_input_and_no_output_input::NoInputAndNoOutputInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputInputBuilder {
    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::no_input_and_no_output::NoInputAndNoOutputOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.no_input_and_no_output();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `NoInputAndNoOutput`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `NoInputAndNoOutput`.
   24     27   
///
   25         -
/// The example tests how requests and responses are serialized when there's no request or response payload because the operation has no input or output. While this should be rare, code generators must support this.
          28  +
/// /* FluentBuilderGenerator.kt:130 */The example tests how requests and responses are serialized when there's no request or response payload because the operation has no input or output. While this should be rare, code generators must support this.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct NoInputAndNoOutputFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputInputBuilder,
   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::no_input_and_no_output::NoInputAndNoOutputOutput,
   35     41   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   36     42   
    > for NoInputAndNoOutputFluentBuilder
   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::no_input_and_no_output::NoInputAndNoOutputOutput,
   44     50   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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 NoInputAndNoOutputFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `NoInputAndNoOutputFluentBuilder`.
   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 NoInputAndNoOutput as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputInputBuilder {
   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::no_input_and_no_output::NoInputAndNoOutputOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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::no_input_and_no_output::NoInputAndNoOutput::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::no_input_and_no_output::NoInputAndNoOutput::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::no_input_and_no_output::NoInputAndNoOutputOutput,
   97    107   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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/rest_json/rust-client-codegen/src/operation/no_input_and_output.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 `NoInputAndOutput`.
           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 NoInputAndOutput;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl NoInputAndOutput {
    7         -
    /// Creates a new `NoInputAndOutput`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `NoInputAndOutput`
          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::no_input_and_output::NoInputAndOutputInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   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 NoInputAndOutput {
   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("NoInputAndOutput");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            NoInputAndOutputRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            NoInputAndOutputResponseDeserializer,
  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   
            "NoInputAndOutput",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("NoInputAndOutput")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(NoInputAndOutputEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::no_input_and_output::NoInputAndOutputError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::no_input_and_output::NoInputAndOutputError,
  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 NoInputAndOutputResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputAndOutputResponseDeserializer {
  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_no_input_and_output::de_no_input_and_output_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_no_input_and_output::de_no_input_and_output_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 NoInputAndOutputRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NoInputAndOutputRequestSerializer {
  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::no_input_and_output::NoInputAndOutputInput>()
  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::no_input_and_output::NoInputAndOutputInput,
  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, "/NoInputAndOutputOutput").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::no_input_and_output::NoInputAndOutputInput,
  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
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct NoInputAndOutputEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NoInputAndOutputEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "NoInputAndOutputEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<NoInputAndOutputInput>()
  220    234   
            .ok_or("failed to downcast to NoInputAndOutputInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod no_input_and_output_test {
  237    254   
  238    255   
    /// No input serializes no payload. When clients do not need to
  239    256   
    /// serialize any data in the payload, they should omit a payload
  240    257   
    /// altogether.
  241    258   
    /// Test ID: RestJsonNoInputAndOutput
  242    259   
    #[::tokio::test]
  243    260   
    #[::tracing_test::traced_test]
  244    261   
    async fn rest_json_no_input_and_output_request() {
  245    262   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
@@ -309,326 +438,514 @@
  329    346   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  330    347   
                )))
  331    348   
            });
  332    349   
            de.deserialize_nonstreaming(&http_response)
  333    350   
        });
  334    351   
        let parsed = parsed
  335    352   
            .expect("should be successful response")
  336    353   
            .downcast::<crate::operation::no_input_and_output::NoInputAndOutputOutput>()
  337    354   
            .unwrap();
  338    355   
    }
         356  +
         357  +
    /* ProtocolTestGenerator.kt:98 */
  339    358   
}
  340    359   
         360  +
/* OperationErrorGenerator.kt:79 */
  341    361   
/// Error type for the `NoInputAndOutputError` operation.
         362  +
/* RustType.kt:516 */
  342    363   
#[non_exhaustive]
         364  +
/* RustType.kt:516 */
  343    365   
#[derive(::std::fmt::Debug)]
  344         -
pub enum NoInputAndOutputError {
         366  +
pub /* OperationErrorGenerator.kt:81 */ enum NoInputAndOutputError {
         367  +
    /* OperationErrorGenerator.kt:88 */
  345    368   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  346    369   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  347    370   
    variable wildcard pattern and check `.code()`:
  348    371   
     \
  349    372   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  350    373   
     \
  351    374   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-NoInputAndOutputError) for what information is available for the error.")]
  352    375   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         376  +
    /* OperationErrorGenerator.kt:81 */
  353    377   
}
         378  +
/* OperationErrorGenerator.kt:218 */
  354    379   
impl NoInputAndOutputError {
         380  +
    /* OperationErrorGenerator.kt:219 */
  355    381   
    /// Creates the `NoInputAndOutputError::Unhandled` variant from any error type.
  356    382   
    pub fn unhandled(
  357    383   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  358    384   
    ) -> Self {
  359    385   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  360    386   
            source: err.into(),
  361    387   
            meta: ::std::default::Default::default(),
  362    388   
        })
  363    389   
    }
  364    390   
  365    391   
    /// Creates the `NoInputAndOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  366    392   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  367    393   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  368    394   
            source: err.clone().into(),
  369    395   
            meta: err,
  370    396   
        })
  371    397   
    }
  372         -
    ///
         398  +
    /// /* OperationErrorGenerator.kt:236 */
  373    399   
    /// Returns error metadata, which includes the error code, message,
  374    400   
    /// request ID, and potentially additional information.
  375    401   
    ///
         402  +
    /* OperationErrorGenerator.kt:242 */
  376    403   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         404  +
        /* OperationErrorGenerator.kt:243 */
  377    405   
        match self {
  378         -
            Self::Unhandled(e) => &e.meta,
         406  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         407  +
            /* OperationErrorGenerator.kt:243 */
  379    408   
        }
         409  +
        /* OperationErrorGenerator.kt:242 */
  380    410   
    }
         411  +
    /* OperationErrorGenerator.kt:218 */
  381    412   
}
         413  +
/* OperationErrorGenerator.kt:269 */
  382    414   
impl ::std::error::Error for NoInputAndOutputError {
         415  +
    /* OperationErrorGenerator.kt:270 */
  383    416   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         417  +
        /* OperationErrorGenerator.kt:318 */
  384    418   
        match self {
  385         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         419  +
            /* OperationErrorGenerator.kt:326 */
         420  +
            Self::Unhandled(_inner) => {
         421  +
                /* OperationErrorGenerator.kt:279 */
         422  +
                ::std::option::Option::Some(&*_inner.source)
         423  +
                /* OperationErrorGenerator.kt:326 */
         424  +
            } /* OperationErrorGenerator.kt:318 */
  386    425   
        }
         426  +
        /* OperationErrorGenerator.kt:270 */
  387    427   
    }
         428  +
    /* OperationErrorGenerator.kt:269 */
  388    429   
}
         430  +
/* OperationErrorGenerator.kt:133 */
  389    431   
impl ::std::fmt::Display for NoInputAndOutputError {
         432  +
    /* OperationErrorGenerator.kt:134 */
  390    433   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         434  +
        /* OperationErrorGenerator.kt:318 */
  391    435   
        match self {
         436  +
            /* OperationErrorGenerator.kt:326 */
  392    437   
            Self::Unhandled(_inner) => {
         438  +
                /* OperationErrorGenerator.kt:139 */
  393    439   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  394    440   
                    write!(f, "unhandled error ({code})")
  395    441   
                } else {
  396    442   
                    f.write_str("unhandled error")
  397    443   
                }
  398         -
            }
         444  +
                /* OperationErrorGenerator.kt:326 */
         445  +
            } /* OperationErrorGenerator.kt:318 */
  399    446   
        }
         447  +
        /* OperationErrorGenerator.kt:134 */
  400    448   
    }
         449  +
    /* OperationErrorGenerator.kt:133 */
  401    450   
}
         451  +
/* OperationErrorGenerator.kt:182 */
  402    452   
impl ::aws_smithy_types::retry::ProvideErrorKind for NoInputAndOutputError {
         453  +
    /* OperationErrorGenerator.kt:186 */
  403    454   
    fn code(&self) -> ::std::option::Option<&str> {
         455  +
        /* OperationErrorGenerator.kt:187 */
  404    456   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         457  +
        /* OperationErrorGenerator.kt:186 */
  405    458   
    }
         459  +
    /* OperationErrorGenerator.kt:190 */
  406    460   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         461  +
        /* OperationErrorGenerator.kt:197 */
  407    462   
        ::std::option::Option::None
         463  +
        /* OperationErrorGenerator.kt:190 */
  408    464   
    }
         465  +
    /* OperationErrorGenerator.kt:182 */
  409    466   
}
         467  +
/* OperationErrorGenerator.kt:163 */
  410    468   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for NoInputAndOutputError {
         469  +
    /* OperationErrorGenerator.kt:164 */
  411    470   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         471  +
        /* OperationErrorGenerator.kt:318 */
  412    472   
        match self {
  413         -
            Self::Unhandled(_inner) => &_inner.meta,
         473  +
            /* OperationErrorGenerator.kt:326 */
         474  +
            Self::Unhandled(_inner) => {
         475  +
                /* OperationErrorGenerator.kt:168 */
         476  +
                &_inner.meta
         477  +
                /* OperationErrorGenerator.kt:326 */
         478  +
            } /* OperationErrorGenerator.kt:318 */
  414    479   
        }
         480  +
        /* OperationErrorGenerator.kt:164 */
  415    481   
    }
         482  +
    /* OperationErrorGenerator.kt:163 */
  416    483   
}
         484  +
/* OperationErrorGenerator.kt:109 */
  417    485   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for NoInputAndOutputError {
         486  +
    /* OperationErrorGenerator.kt:110 */
  418    487   
    fn create_unhandled_error(
  419    488   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  420    489   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  421    490   
    ) -> Self {
         491  +
        /* OperationErrorGenerator.kt:121 */
  422    492   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  423    493   
            source,
  424    494   
            meta: meta.unwrap_or_default(),
  425    495   
        })
         496  +
        /* OperationErrorGenerator.kt:110 */
  426    497   
    }
         498  +
    /* OperationErrorGenerator.kt:109 */
  427    499   
}
  428    500   
         501  +
/* CodegenDelegator.kt:255 */
  429    502   
pub use crate::operation::no_input_and_output::_no_input_and_output_output::NoInputAndOutputOutput;
  430    503   
         504  +
/* CodegenDelegator.kt:255 */
  431    505   
pub use crate::operation::no_input_and_output::_no_input_and_output_input::NoInputAndOutputInput;
  432    506   
         507  +
/* RustModule.kt:172 */
  433    508   
mod _no_input_and_output_input;
  434    509   
         510  +
/* RustModule.kt:172 */
  435    511   
mod _no_input_and_output_output;
  436    512   
  437         -
/// Builders
         513  +
/// /* CodegenDelegator.kt:51 */Builders
  438    514   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/no_input_and_output/_no_input_and_output_input.rs

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