Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +209,263 @@
    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::json_timestamps::_json_timestamps_output::JsonTimestampsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::json_timestamps::_json_timestamps_input::JsonTimestampsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::json_timestamps::builders::JsonTimestampsInputBuilder {
    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::json_timestamps::JsonTimestampsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::json_timestamps::JsonTimestampsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.json_timestamps();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `JsonTimestamps`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `JsonTimestamps`.
   24     27   
///
   25         -
/// This tests how timestamps are serialized, including using the default format of date-time and various @timestampFormat trait values.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This tests how timestamps are serialized, including using the default format of date-time and various @timestampFormat trait values.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct JsonTimestampsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::json_timestamps::builders::JsonTimestampsInputBuilder,
   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::json_timestamps::JsonTimestampsOutput,
   35     41   
        crate::operation::json_timestamps::JsonTimestampsError,
   36     42   
    > for JsonTimestampsFluentBuilder
   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::json_timestamps::JsonTimestampsOutput,
   44     50   
            crate::operation::json_timestamps::JsonTimestampsError,
   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 JsonTimestampsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `JsonTimestampsFluentBuilder`.
   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 JsonTimestamps as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::json_timestamps::builders::JsonTimestampsInputBuilder {
   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::json_timestamps::JsonTimestampsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::json_timestamps::JsonTimestampsError,
   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::json_timestamps::JsonTimestamps::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::json_timestamps::JsonTimestamps::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::json_timestamps::JsonTimestampsOutput,
   97    107   
        crate::operation::json_timestamps::JsonTimestampsError,
   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 normal(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  113    126   
        self.inner = self.inner.normal(input);
  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_normal(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  118    133   
        self.inner = self.inner.set_normal(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_normal(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  123    140   
        self.inner.get_normal()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  127    146   
        self.inner = self.inner.date_time(input);
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  132    153   
        self.inner = self.inner.set_date_time(input);
  133    154   
        self
  134    155   
    }
         156  +
    /* FluentBuilderGenerator.kt:518 */
  135    157   
    #[allow(missing_docs)] // documentation missing in model
         158  +
                           /* FluentBuilderGenerator.kt:520 */
  136    159   
    pub fn get_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  137    160   
        self.inner.get_date_time()
  138    161   
    }
         162  +
    /* FluentBuilderGenerator.kt:498 */
  139    163   
    #[allow(missing_docs)] // documentation missing in model
         164  +
                           /* FluentBuilderGenerator.kt:500 */
  140    165   
    pub fn date_time_on_target(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  141    166   
        self.inner = self.inner.date_time_on_target(input);
  142    167   
        self
  143    168   
    }
         169  +
    /* FluentBuilderGenerator.kt:498 */
  144    170   
    #[allow(missing_docs)] // documentation missing in model
         171  +
                           /* FluentBuilderGenerator.kt:500 */
  145    172   
    pub fn set_date_time_on_target(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  146    173   
        self.inner = self.inner.set_date_time_on_target(input);
  147    174   
        self
  148    175   
    }
         176  +
    /* FluentBuilderGenerator.kt:518 */
  149    177   
    #[allow(missing_docs)] // documentation missing in model
         178  +
                           /* FluentBuilderGenerator.kt:520 */
  150    179   
    pub fn get_date_time_on_target(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  151    180   
        self.inner.get_date_time_on_target()
  152    181   
    }
         182  +
    /* FluentBuilderGenerator.kt:498 */
  153    183   
    #[allow(missing_docs)] // documentation missing in model
         184  +
                           /* FluentBuilderGenerator.kt:500 */
  154    185   
    pub fn epoch_seconds(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  155    186   
        self.inner = self.inner.epoch_seconds(input);
  156    187   
        self
  157    188   
    }
         189  +
    /* FluentBuilderGenerator.kt:498 */
  158    190   
    #[allow(missing_docs)] // documentation missing in model
         191  +
                           /* FluentBuilderGenerator.kt:500 */
  159    192   
    pub fn set_epoch_seconds(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  160    193   
        self.inner = self.inner.set_epoch_seconds(input);
  161    194   
        self
  162    195   
    }
         196  +
    /* FluentBuilderGenerator.kt:518 */
  163    197   
    #[allow(missing_docs)] // documentation missing in model
         198  +
                           /* FluentBuilderGenerator.kt:520 */
  164    199   
    pub fn get_epoch_seconds(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  165    200   
        self.inner.get_epoch_seconds()
  166    201   
    }
         202  +
    /* FluentBuilderGenerator.kt:498 */
  167    203   
    #[allow(missing_docs)] // documentation missing in model
         204  +
                           /* FluentBuilderGenerator.kt:500 */
  168    205   
    pub fn epoch_seconds_on_target(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  169    206   
        self.inner = self.inner.epoch_seconds_on_target(input);
  170    207   
        self
  171    208   
    }
         209  +
    /* FluentBuilderGenerator.kt:498 */
  172    210   
    #[allow(missing_docs)] // documentation missing in model
         211  +
                           /* FluentBuilderGenerator.kt:500 */
  173    212   
    pub fn set_epoch_seconds_on_target(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  174    213   
        self.inner = self.inner.set_epoch_seconds_on_target(input);
  175    214   
        self
  176    215   
    }
         216  +
    /* FluentBuilderGenerator.kt:518 */
  177    217   
    #[allow(missing_docs)] // documentation missing in model
         218  +
                           /* FluentBuilderGenerator.kt:520 */
  178    219   
    pub fn get_epoch_seconds_on_target(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  179    220   
        self.inner.get_epoch_seconds_on_target()
  180    221   
    }
         222  +
    /* FluentBuilderGenerator.kt:498 */
  181    223   
    #[allow(missing_docs)] // documentation missing in model
         224  +
                           /* FluentBuilderGenerator.kt:500 */
  182    225   
    pub fn http_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  183    226   
        self.inner = self.inner.http_date(input);
  184    227   
        self
  185    228   
    }
         229  +
    /* FluentBuilderGenerator.kt:498 */
  186    230   
    #[allow(missing_docs)] // documentation missing in model
         231  +
                           /* FluentBuilderGenerator.kt:500 */
  187    232   
    pub fn set_http_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  188    233   
        self.inner = self.inner.set_http_date(input);
  189    234   
        self
  190    235   
    }
         236  +
    /* FluentBuilderGenerator.kt:518 */
  191    237   
    #[allow(missing_docs)] // documentation missing in model
         238  +
                           /* FluentBuilderGenerator.kt:520 */
  192    239   
    pub fn get_http_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  193    240   
        self.inner.get_http_date()
  194    241   
    }
         242  +
    /* FluentBuilderGenerator.kt:498 */
  195    243   
    #[allow(missing_docs)] // documentation missing in model
         244  +
                           /* FluentBuilderGenerator.kt:500 */
  196    245   
    pub fn http_date_on_target(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  197    246   
        self.inner = self.inner.http_date_on_target(input);
  198    247   
        self
  199    248   
    }
         249  +
    /* FluentBuilderGenerator.kt:498 */
  200    250   
    #[allow(missing_docs)] // documentation missing in model
         251  +
                           /* FluentBuilderGenerator.kt:500 */
  201    252   
    pub fn set_http_date_on_target(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  202    253   
        self.inner = self.inner.set_http_date_on_target(input);
  203    254   
        self
  204    255   
    }
         256  +
    /* FluentBuilderGenerator.kt:518 */
  205    257   
    #[allow(missing_docs)] // documentation missing in model
         258  +
                           /* FluentBuilderGenerator.kt:520 */
  206    259   
    pub fn get_http_date_on_target(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  207    260   
        self.inner.get_http_date_on_target()
  208    261   
    }
         262  +
    /* FluentBuilderGenerator.kt:282 */
  209    263   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_unions.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 `JsonUnions`.
           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 JsonUnions;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl JsonUnions {
    7         -
    /// Creates a new `JsonUnions`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `JsonUnions`
          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::json_unions::JsonUnionsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::json_unions::JsonUnionsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::json_unions::JsonUnionsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +261,278 @@
   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 JsonUnions {
   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("JsonUnions");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            JsonUnionsRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            JsonUnionsResponseDeserializer,
   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   
            "JsonUnions",
  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("JsonUnions")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(JsonUnionsEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::json_unions::JsonUnionsError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::json_unions::JsonUnionsError,
  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 JsonUnionsResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonUnionsResponseDeserializer {
  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_json_unions::de_json_unions_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_json_unions::de_json_unions_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 JsonUnionsRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonUnionsRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input.downcast::<crate::operation::json_unions::JsonUnionsInput>().expect("correct type");
  161    174   
        let _header_serialization_settings = _cfg
  162    175   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163    176   
            .cloned()
  164    177   
            .unwrap_or_default();
  165    178   
        let mut request_builder = {
  166    179   
            fn uri_base(
  167    180   
                _input: &crate::operation::json_unions::JsonUnionsInput,
  168    181   
                output: &mut ::std::string::String,
  169    182   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  170    183   
                use ::std::fmt::Write as _;
  171    184   
                ::std::write!(output, "/JsonUnions").expect("formatting should succeed");
  172    185   
                ::std::result::Result::Ok(())
  173    186   
            }
  174    187   
            #[allow(clippy::unnecessary_wraps)]
  175    188   
            fn update_http_builder(
  176    189   
                input: &crate::operation::json_unions::JsonUnionsInput,
  177    190   
                builder: ::http::request::Builder,
  178    191   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  179    192   
                let mut uri = ::std::string::String::new();
  180    193   
                uri_base(input, &mut uri)?;
  181    194   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  182    195   
            }
  183    196   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  184    197   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  185    198   
            builder
  186    199   
        };
  187    200   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_unions::ser_json_unions_input(&input)?);
  188    201   
        if let Some(content_length) = body.content_length() {
  189    202   
            let content_length = content_length.to_string();
  190    203   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  191    204   
        }
  192    205   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  193    206   
    }
  194    207   
}
         208  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  195    209   
#[derive(Debug)]
  196    210   
struct JsonUnionsEndpointParamsInterceptor;
  197    211   
  198    212   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonUnionsEndpointParamsInterceptor {
  199    213   
    fn name(&self) -> &'static str {
  200    214   
        "JsonUnionsEndpointParamsInterceptor"
  201    215   
    }
  202    216   
  203    217   
    fn read_before_execution(
  204    218   
        &self,
  205    219   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  206    220   
            '_,
  207    221   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  208    222   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  210    224   
        >,
  211    225   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  212    226   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  213    227   
        let _input = context
  214    228   
            .input()
  215    229   
            .downcast_ref::<JsonUnionsInput>()
  216    230   
            .ok_or("failed to downcast to JsonUnionsInput")?;
  217    231   
  218    232   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  220    234   
        })?;
  221    235   
        cfg.interceptor_state()
  222    236   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  223    237   
        ::std::result::Result::Ok(())
  224    238   
    }
  225    239   
}
  226    240   
  227    241   
// The get_* functions below are generated from JMESPath expressions in the
  228    242   
// operationContextParams trait. They target the operation's input shape.
  229    243   
         244  +
/* RustType.kt:516 */
  230    245   
#[allow(unreachable_code, unused_variables)]
         246  +
/* RustType.kt:516 */
  231    247   
#[cfg(test)]
         248  +
/* ProtocolTestGenerator.kt:98 */
  232    249   
mod json_unions_test {
  233    250   
  234    251   
    /// Serializes a string union value
  235    252   
    /// Test ID: RestJsonSerializeStringUnionValue
  236    253   
    #[::tokio::test]
  237    254   
    #[::tracing_test::traced_test]
  238    255   
    async fn rest_json_serialize_string_union_value_request() {
  239    256   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  240    257   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  241    258   
@@ -969,986 +1098,1174 @@
  989   1006   
                )))
  990   1007   
            });
  991   1008   
            de.deserialize_nonstreaming(&http_response)
  992   1009   
        });
  993   1010   
        let parsed = parsed
  994   1011   
            .expect("should be successful response")
  995   1012   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
  996   1013   
            .unwrap();
  997   1014   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
  998   1015   
    }
        1016  +
        1017  +
    /* ProtocolTestGenerator.kt:98 */
  999   1018   
}
 1000   1019   
        1020  +
/* OperationErrorGenerator.kt:79 */
 1001   1021   
/// Error type for the `JsonUnionsError` operation.
        1022  +
/* RustType.kt:516 */
 1002   1023   
#[non_exhaustive]
        1024  +
/* RustType.kt:516 */
 1003   1025   
#[derive(::std::fmt::Debug)]
 1004         -
pub enum JsonUnionsError {
        1026  +
pub /* OperationErrorGenerator.kt:81 */ enum JsonUnionsError {
        1027  +
    /* OperationErrorGenerator.kt:88 */
 1005   1028   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
 1006   1029   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
 1007   1030   
    variable wildcard pattern and check `.code()`:
 1008   1031   
     \
 1009   1032   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
 1010   1033   
     \
 1011   1034   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-JsonUnionsError) for what information is available for the error.")]
 1012   1035   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
        1036  +
    /* OperationErrorGenerator.kt:81 */
 1013   1037   
}
        1038  +
/* OperationErrorGenerator.kt:218 */
 1014   1039   
impl JsonUnionsError {
        1040  +
    /* OperationErrorGenerator.kt:219 */
 1015   1041   
    /// Creates the `JsonUnionsError::Unhandled` variant from any error type.
 1016   1042   
    pub fn unhandled(
 1017   1043   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
 1018   1044   
    ) -> Self {
 1019   1045   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
 1020   1046   
            source: err.into(),
 1021   1047   
            meta: ::std::default::Default::default(),
 1022   1048   
        })
 1023   1049   
    }
 1024   1050   
 1025   1051   
    /// Creates the `JsonUnionsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
 1026   1052   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
 1027   1053   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
 1028   1054   
            source: err.clone().into(),
 1029   1055   
            meta: err,
 1030   1056   
        })
 1031   1057   
    }
 1032         -
    ///
        1058  +
    /// /* OperationErrorGenerator.kt:236 */
 1033   1059   
    /// Returns error metadata, which includes the error code, message,
 1034   1060   
    /// request ID, and potentially additional information.
 1035   1061   
    ///
        1062  +
    /* OperationErrorGenerator.kt:242 */
 1036   1063   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
        1064  +
        /* OperationErrorGenerator.kt:243 */
 1037   1065   
        match self {
 1038         -
            Self::Unhandled(e) => &e.meta,
        1066  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
        1067  +
            /* OperationErrorGenerator.kt:243 */
 1039   1068   
        }
        1069  +
        /* OperationErrorGenerator.kt:242 */
 1040   1070   
    }
        1071  +
    /* OperationErrorGenerator.kt:218 */
 1041   1072   
}
        1073  +
/* OperationErrorGenerator.kt:269 */
 1042   1074   
impl ::std::error::Error for JsonUnionsError {
        1075  +
    /* OperationErrorGenerator.kt:270 */
 1043   1076   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
        1077  +
        /* OperationErrorGenerator.kt:318 */
 1044   1078   
        match self {
 1045         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
        1079  +
            /* OperationErrorGenerator.kt:326 */
        1080  +
            Self::Unhandled(_inner) => {
        1081  +
                /* OperationErrorGenerator.kt:279 */
        1082  +
                ::std::option::Option::Some(&*_inner.source)
        1083  +
                /* OperationErrorGenerator.kt:326 */
        1084  +
            } /* OperationErrorGenerator.kt:318 */
 1046   1085   
        }
        1086  +
        /* OperationErrorGenerator.kt:270 */
 1047   1087   
    }
        1088  +
    /* OperationErrorGenerator.kt:269 */
 1048   1089   
}
        1090  +
/* OperationErrorGenerator.kt:133 */
 1049   1091   
impl ::std::fmt::Display for JsonUnionsError {
        1092  +
    /* OperationErrorGenerator.kt:134 */
 1050   1093   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        1094  +
        /* OperationErrorGenerator.kt:318 */
 1051   1095   
        match self {
        1096  +
            /* OperationErrorGenerator.kt:326 */
 1052   1097   
            Self::Unhandled(_inner) => {
        1098  +
                /* OperationErrorGenerator.kt:139 */
 1053   1099   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
 1054   1100   
                    write!(f, "unhandled error ({code})")
 1055   1101   
                } else {
 1056   1102   
                    f.write_str("unhandled error")
 1057   1103   
                }
 1058         -
            }
        1104  +
                /* OperationErrorGenerator.kt:326 */
        1105  +
            } /* OperationErrorGenerator.kt:318 */
 1059   1106   
        }
        1107  +
        /* OperationErrorGenerator.kt:134 */
 1060   1108   
    }
        1109  +
    /* OperationErrorGenerator.kt:133 */
 1061   1110   
}
        1111  +
/* OperationErrorGenerator.kt:182 */
 1062   1112   
impl ::aws_smithy_types::retry::ProvideErrorKind for JsonUnionsError {
        1113  +
    /* OperationErrorGenerator.kt:186 */
 1063   1114   
    fn code(&self) -> ::std::option::Option<&str> {
        1115  +
        /* OperationErrorGenerator.kt:187 */
 1064   1116   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
        1117  +
        /* OperationErrorGenerator.kt:186 */
 1065   1118   
    }
        1119  +
    /* OperationErrorGenerator.kt:190 */
 1066   1120   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
        1121  +
        /* OperationErrorGenerator.kt:197 */
 1067   1122   
        ::std::option::Option::None
        1123  +
        /* OperationErrorGenerator.kt:190 */
 1068   1124   
    }
        1125  +
    /* OperationErrorGenerator.kt:182 */
 1069   1126   
}
        1127  +
/* OperationErrorGenerator.kt:163 */
 1070   1128   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for JsonUnionsError {
        1129  +
    /* OperationErrorGenerator.kt:164 */
 1071   1130   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
        1131  +
        /* OperationErrorGenerator.kt:318 */
 1072   1132   
        match self {
 1073         -
            Self::Unhandled(_inner) => &_inner.meta,
        1133  +
            /* OperationErrorGenerator.kt:326 */
        1134  +
            Self::Unhandled(_inner) => {
        1135  +
                /* OperationErrorGenerator.kt:168 */
        1136  +
                &_inner.meta
        1137  +
                /* OperationErrorGenerator.kt:326 */
        1138  +
            } /* OperationErrorGenerator.kt:318 */
 1074   1139   
        }
        1140  +
        /* OperationErrorGenerator.kt:164 */
 1075   1141   
    }
        1142  +
    /* OperationErrorGenerator.kt:163 */
 1076   1143   
}
        1144  +
/* OperationErrorGenerator.kt:109 */
 1077   1145   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for JsonUnionsError {
        1146  +
    /* OperationErrorGenerator.kt:110 */
 1078   1147   
    fn create_unhandled_error(
 1079   1148   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
 1080   1149   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
 1081   1150   
    ) -> Self {
        1151  +
        /* OperationErrorGenerator.kt:121 */
 1082   1152   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
 1083   1153   
            source,
 1084   1154   
            meta: meta.unwrap_or_default(),
 1085   1155   
        })
        1156  +
        /* OperationErrorGenerator.kt:110 */
 1086   1157   
    }
        1158  +
    /* OperationErrorGenerator.kt:109 */
 1087   1159   
}
 1088   1160   
        1161  +
/* CodegenDelegator.kt:255 */
 1089   1162   
pub use crate::operation::json_unions::_json_unions_output::JsonUnionsOutput;
 1090   1163   
        1164  +
/* CodegenDelegator.kt:255 */
 1091   1165   
pub use crate::operation::json_unions::_json_unions_input::JsonUnionsInput;
 1092   1166   
        1167  +
/* RustModule.kt:172 */
 1093   1168   
mod _json_unions_input;
 1094   1169   
        1170  +
/* RustModule.kt:172 */
 1095   1171   
mod _json_unions_output;
 1096   1172   
 1097         -
/// Builders
        1173  +
/// /* CodegenDelegator.kt:51 */Builders
 1098   1174   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_unions/_json_unions_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/json_unions/_json_unions_output.rs

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

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

@@ -1,1 +125,140 @@
    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::json_unions::_json_unions_output::JsonUnionsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::json_unions::_json_unions_input::JsonUnionsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::json_unions::builders::JsonUnionsInputBuilder {
    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::json_unions::JsonUnionsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::json_unions::JsonUnionsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.json_unions();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `JsonUnions`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `JsonUnions`.
   24     27   
///
   25         -
/// This operation uses unions for inputs and outputs.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation uses unions for inputs and outputs.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct JsonUnionsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::json_unions::builders::JsonUnionsInputBuilder,
   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::json_unions::JsonUnionsOutput,
   35     41   
        crate::operation::json_unions::JsonUnionsError,
   36     42   
    > for JsonUnionsFluentBuilder
   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::json_unions::JsonUnionsOutput,
   44     50   
            crate::operation::json_unions::JsonUnionsError,
   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 JsonUnionsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `JsonUnionsFluentBuilder`.
   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 JsonUnions as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::json_unions::builders::JsonUnionsInputBuilder {
   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::json_unions::JsonUnionsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::json_unions::JsonUnionsError,
   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::json_unions::JsonUnions::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::json_unions::JsonUnions::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::json_unions::JsonUnionsOutput,
   97    107   
        crate::operation::json_unions::JsonUnionsError,
   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   
    }
  111         -
    /// A union with a representative set of types for members.
         122  +
    /// /* FluentBuilderGenerator.kt:498 */A union with a representative set of types for members.
         123  +
    /* FluentBuilderGenerator.kt:500 */
  112    124   
    pub fn contents(mut self, input: crate::types::MyUnion) -> Self {
  113    125   
        self.inner = self.inner.contents(input);
  114    126   
        self
  115    127   
    }
  116         -
    /// A union with a representative set of types for members.
         128  +
    /// /* FluentBuilderGenerator.kt:498 */A union with a representative set of types for members.
         129  +
    /* FluentBuilderGenerator.kt:500 */
  117    130   
    pub fn set_contents(mut self, input: ::std::option::Option<crate::types::MyUnion>) -> Self {
  118    131   
        self.inner = self.inner.set_contents(input);
  119    132   
        self
  120    133   
    }
  121         -
    /// A union with a representative set of types for members.
         134  +
    /// /* FluentBuilderGenerator.kt:518 */A union with a representative set of types for members.
         135  +
    /* FluentBuilderGenerator.kt:520 */
  122    136   
    pub fn get_contents(&self) -> &::std::option::Option<crate::types::MyUnion> {
  123    137   
        self.inner.get_contents()
  124    138   
    }
         139  +
    /* FluentBuilderGenerator.kt:282 */
  125    140   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_body.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 `MalformedAcceptWithBody`.
           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 MalformedAcceptWithBody;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl MalformedAcceptWithBody {
    7         -
    /// Creates a new `MalformedAcceptWithBody`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `MalformedAcceptWithBody`
          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_accept_with_body::MalformedAcceptWithBodyInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +331,402 @@
   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 MalformedAcceptWithBody {
   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("MalformedAcceptWithBody");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            MalformedAcceptWithBodyRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            MalformedAcceptWithBodyResponseDeserializer,
  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   
            "MalformedAcceptWithBody",
  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("MalformedAcceptWithBody")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(MalformedAcceptWithBodyEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
  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 MalformedAcceptWithBodyResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedAcceptWithBodyResponseDeserializer {
  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_malformed_accept_with_body::de_malformed_accept_with_body_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_malformed_accept_with_body::de_malformed_accept_with_body_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 MalformedAcceptWithBodyRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedAcceptWithBodyRequestSerializer {
  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::malformed_accept_with_body::MalformedAcceptWithBodyInput>()
  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::malformed_accept_with_body::MalformedAcceptWithBodyInput,
  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, "/MalformedAcceptWithBody").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::malformed_accept_with_body::MalformedAcceptWithBodyInput,
  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 MalformedAcceptWithBodyEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedAcceptWithBodyEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "MalformedAcceptWithBodyEndpointParamsInterceptor"
  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::<MalformedAcceptWithBodyInput>()
  220    234   
            .ok_or("failed to downcast to MalformedAcceptWithBodyInput")?;
  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  +
/* OperationErrorGenerator.kt:79 */
  234    249   
/// Error type for the `MalformedAcceptWithBodyError` operation.
         250  +
/* RustType.kt:516 */
  235    251   
#[non_exhaustive]
         252  +
/* RustType.kt:516 */
  236    253   
#[derive(::std::fmt::Debug)]
  237         -
pub enum MalformedAcceptWithBodyError {
         254  +
pub /* OperationErrorGenerator.kt:81 */ enum MalformedAcceptWithBodyError {
         255  +
    /* OperationErrorGenerator.kt:88 */
  238    256   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  239    257   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  240    258   
    variable wildcard pattern and check `.code()`:
  241    259   
     \
  242    260   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  243    261   
     \
  244    262   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MalformedAcceptWithBodyError) for what information is available for the error.")]
  245    263   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         264  +
    /* OperationErrorGenerator.kt:81 */
  246    265   
}
         266  +
/* OperationErrorGenerator.kt:218 */
  247    267   
impl MalformedAcceptWithBodyError {
         268  +
    /* OperationErrorGenerator.kt:219 */
  248    269   
    /// Creates the `MalformedAcceptWithBodyError::Unhandled` variant from any error type.
  249    270   
    pub fn unhandled(
  250    271   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  251    272   
    ) -> Self {
  252    273   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  253    274   
            source: err.into(),
  254    275   
            meta: ::std::default::Default::default(),
  255    276   
        })
  256    277   
    }
  257    278   
  258    279   
    /// Creates the `MalformedAcceptWithBodyError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  259    280   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  260    281   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  261    282   
            source: err.clone().into(),
  262    283   
            meta: err,
  263    284   
        })
  264    285   
    }
  265         -
    ///
         286  +
    /// /* OperationErrorGenerator.kt:236 */
  266    287   
    /// Returns error metadata, which includes the error code, message,
  267    288   
    /// request ID, and potentially additional information.
  268    289   
    ///
         290  +
    /* OperationErrorGenerator.kt:242 */
  269    291   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         292  +
        /* OperationErrorGenerator.kt:243 */
  270    293   
        match self {
  271         -
            Self::Unhandled(e) => &e.meta,
         294  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         295  +
            /* OperationErrorGenerator.kt:243 */
  272    296   
        }
         297  +
        /* OperationErrorGenerator.kt:242 */
  273    298   
    }
         299  +
    /* OperationErrorGenerator.kt:218 */
  274    300   
}
         301  +
/* OperationErrorGenerator.kt:269 */
  275    302   
impl ::std::error::Error for MalformedAcceptWithBodyError {
         303  +
    /* OperationErrorGenerator.kt:270 */
  276    304   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         305  +
        /* OperationErrorGenerator.kt:318 */
  277    306   
        match self {
  278         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         307  +
            /* OperationErrorGenerator.kt:326 */
         308  +
            Self::Unhandled(_inner) => {
         309  +
                /* OperationErrorGenerator.kt:279 */
         310  +
                ::std::option::Option::Some(&*_inner.source)
         311  +
                /* OperationErrorGenerator.kt:326 */
         312  +
            } /* OperationErrorGenerator.kt:318 */
  279    313   
        }
         314  +
        /* OperationErrorGenerator.kt:270 */
  280    315   
    }
         316  +
    /* OperationErrorGenerator.kt:269 */
  281    317   
}
         318  +
/* OperationErrorGenerator.kt:133 */
  282    319   
impl ::std::fmt::Display for MalformedAcceptWithBodyError {
         320  +
    /* OperationErrorGenerator.kt:134 */
  283    321   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         322  +
        /* OperationErrorGenerator.kt:318 */
  284    323   
        match self {
         324  +
            /* OperationErrorGenerator.kt:326 */
  285    325   
            Self::Unhandled(_inner) => {
         326  +
                /* OperationErrorGenerator.kt:139 */
  286    327   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  287    328   
                    write!(f, "unhandled error ({code})")
  288    329   
                } else {
  289    330   
                    f.write_str("unhandled error")
  290    331   
                }
  291         -
            }
         332  +
                /* OperationErrorGenerator.kt:326 */
         333  +
            } /* OperationErrorGenerator.kt:318 */
  292    334   
        }
         335  +
        /* OperationErrorGenerator.kt:134 */
  293    336   
    }
         337  +
    /* OperationErrorGenerator.kt:133 */
  294    338   
}
         339  +
/* OperationErrorGenerator.kt:182 */
  295    340   
impl ::aws_smithy_types::retry::ProvideErrorKind for MalformedAcceptWithBodyError {
         341  +
    /* OperationErrorGenerator.kt:186 */
  296    342   
    fn code(&self) -> ::std::option::Option<&str> {
         343  +
        /* OperationErrorGenerator.kt:187 */
  297    344   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         345  +
        /* OperationErrorGenerator.kt:186 */
  298    346   
    }
         347  +
    /* OperationErrorGenerator.kt:190 */
  299    348   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         349  +
        /* OperationErrorGenerator.kt:197 */
  300    350   
        ::std::option::Option::None
         351  +
        /* OperationErrorGenerator.kt:190 */
  301    352   
    }
         353  +
    /* OperationErrorGenerator.kt:182 */
  302    354   
}
         355  +
/* OperationErrorGenerator.kt:163 */
  303    356   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MalformedAcceptWithBodyError {
         357  +
    /* OperationErrorGenerator.kt:164 */
  304    358   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         359  +
        /* OperationErrorGenerator.kt:318 */
  305    360   
        match self {
  306         -
            Self::Unhandled(_inner) => &_inner.meta,
         361  +
            /* OperationErrorGenerator.kt:326 */
         362  +
            Self::Unhandled(_inner) => {
         363  +
                /* OperationErrorGenerator.kt:168 */
         364  +
                &_inner.meta
         365  +
                /* OperationErrorGenerator.kt:326 */
         366  +
            } /* OperationErrorGenerator.kt:318 */
  307    367   
        }
         368  +
        /* OperationErrorGenerator.kt:164 */
  308    369   
    }
         370  +
    /* OperationErrorGenerator.kt:163 */
  309    371   
}
         372  +
/* OperationErrorGenerator.kt:109 */
  310    373   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MalformedAcceptWithBodyError {
         374  +
    /* OperationErrorGenerator.kt:110 */
  311    375   
    fn create_unhandled_error(
  312    376   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  313    377   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  314    378   
    ) -> Self {
         379  +
        /* OperationErrorGenerator.kt:121 */
  315    380   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  316    381   
            source,
  317    382   
            meta: meta.unwrap_or_default(),
  318    383   
        })
         384  +
        /* OperationErrorGenerator.kt:110 */
  319    385   
    }
         386  +
    /* OperationErrorGenerator.kt:109 */
  320    387   
}
  321    388   
         389  +
/* CodegenDelegator.kt:255 */
  322    390   
pub use crate::operation::malformed_accept_with_body::_malformed_accept_with_body_output::MalformedAcceptWithBodyOutput;
  323    391   
         392  +
/* CodegenDelegator.kt:255 */
  324    393   
pub use crate::operation::malformed_accept_with_body::_malformed_accept_with_body_input::MalformedAcceptWithBodyInput;
  325    394   
         395  +
/* RustModule.kt:172 */
  326    396   
mod _malformed_accept_with_body_input;
  327    397   
         398  +
/* RustModule.kt:172 */
  328    399   
mod _malformed_accept_with_body_output;
  329    400   
  330         -
/// Builders
         401  +
/// /* CodegenDelegator.kt:51 */Builders
  331    402   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_body/_malformed_accept_with_body_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_body/_malformed_accept_with_body_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 MalformedAcceptWithBodyOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MalformedAcceptWithBodyOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub hi: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MalformedAcceptWithBodyOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn hi(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.hi.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MalformedAcceptWithBodyOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
          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 MalformedAcceptWithBodyOutputBuilder {
   26         -
    pub(crate) hi: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) hi: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl MalformedAcceptWithBodyOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn hi(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.hi = ::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_hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.hi = 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_hi(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.hi
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MalformedAcceptWithBodyOutput`](crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput {
   45         -
        crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput { hi: self.hi }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyOutput {
          82  +
            /* BuilderGenerator.kt:481 */ hi: self.hi,
          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/malformed_accept_with_body/builders.rs

@@ -1,1 +110,122 @@
    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_accept_with_body::_malformed_accept_with_body_output::MalformedAcceptWithBodyOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::malformed_accept_with_body::_malformed_accept_with_body_input::MalformedAcceptWithBodyInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyInputBuilder {
    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_accept_with_body::MalformedAcceptWithBodyOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.malformed_accept_with_body();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `MalformedAcceptWithBody`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `MalformedAcceptWithBody`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct MalformedAcceptWithBodyFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyInputBuilder,
   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_accept_with_body::MalformedAcceptWithBodyOutput,
   34     40   
        crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   35     41   
    > for MalformedAcceptWithBodyFluentBuilder
   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_accept_with_body::MalformedAcceptWithBodyOutput,
   43     49   
            crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   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 MalformedAcceptWithBodyFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `MalformedAcceptWithBodyFluentBuilder`.
   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 MalformedAcceptWithBody as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::malformed_accept_with_body::builders::MalformedAcceptWithBodyInputBuilder {
   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_accept_with_body::MalformedAcceptWithBodyOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   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_accept_with_body::MalformedAcceptWithBody::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_accept_with_body::MalformedAcceptWithBody::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_accept_with_body::MalformedAcceptWithBodyOutput,
   96    106   
        crate::operation::malformed_accept_with_body::MalformedAcceptWithBodyError,
   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:282 */
  110    122   
}

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_generic_string/_malformed_accept_with_generic_string_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_generic_string/_malformed_accept_with_generic_string_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 MalformedAcceptWithGenericStringOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MalformedAcceptWithGenericStringOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub payload: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MalformedAcceptWithGenericStringOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn payload(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.payload.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MalformedAcceptWithGenericStringOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
          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 MalformedAcceptWithGenericStringOutputBuilder {
   26         -
    pub(crate) payload: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) payload: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl MalformedAcceptWithGenericStringOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn payload(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.payload = ::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_payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.payload = 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_payload(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.payload
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MalformedAcceptWithGenericStringOutput`](crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput {
   45         -
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput { payload: self.payload }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringOutput {
          82  +
            /* BuilderGenerator.kt:481 */ payload: self.payload,
          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/malformed_accept_with_generic_string/builders.rs

@@ -1,1 +110,122 @@
    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_accept_with_generic_string::_malformed_accept_with_generic_string_output::MalformedAcceptWithGenericStringOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::malformed_accept_with_generic_string::_malformed_accept_with_generic_string_input::MalformedAcceptWithGenericStringInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringInputBuilder {
    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_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.malformed_accept_with_generic_string();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `MalformedAcceptWithGenericString`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `MalformedAcceptWithGenericString`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct MalformedAcceptWithGenericStringFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringInputBuilder,
   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_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   34     40   
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   35     41   
    > for MalformedAcceptWithGenericStringFluentBuilder
   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_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   43     49   
            crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   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 MalformedAcceptWithGenericStringFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `MalformedAcceptWithGenericStringFluentBuilder`.
   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 MalformedAcceptWithGenericString as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::malformed_accept_with_generic_string::builders::MalformedAcceptWithGenericStringInputBuilder {
   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_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   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_accept_with_generic_string::MalformedAcceptWithGenericString::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_accept_with_generic_string::MalformedAcceptWithGenericString::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_accept_with_generic_string::MalformedAcceptWithGenericStringOutput,
   96    106   
        crate::operation::malformed_accept_with_generic_string::MalformedAcceptWithGenericStringError,
   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:282 */
  110    122   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_payload.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 `MalformedAcceptWithPayload`.
           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 MalformedAcceptWithPayload;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl MalformedAcceptWithPayload {
    7         -
    /// Creates a new `MalformedAcceptWithPayload`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `MalformedAcceptWithPayload`
          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_accept_with_payload::MalformedAcceptWithPayloadInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +331,402 @@
   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 MalformedAcceptWithPayload {
   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("MalformedAcceptWithPayload");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            MalformedAcceptWithPayloadRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            MalformedAcceptWithPayloadResponseDeserializer,
  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   
            "MalformedAcceptWithPayload",
  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("MalformedAcceptWithPayload")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(MalformedAcceptWithPayloadEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadError,
  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 MalformedAcceptWithPayloadResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedAcceptWithPayloadResponseDeserializer {
  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_malformed_accept_with_payload::de_malformed_accept_with_payload_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_payload_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 MalformedAcceptWithPayloadRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedAcceptWithPayloadRequestSerializer {
  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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput>()
  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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
  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, "/MalformedAcceptWithPayload").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::malformed_accept_with_payload::MalformedAcceptWithPayloadInput,
  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 MalformedAcceptWithPayloadEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedAcceptWithPayloadEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "MalformedAcceptWithPayloadEndpointParamsInterceptor"
  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::<MalformedAcceptWithPayloadInput>()
  220    234   
            .ok_or("failed to downcast to MalformedAcceptWithPayloadInput")?;
  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  +
/* OperationErrorGenerator.kt:79 */
  234    249   
/// Error type for the `MalformedAcceptWithPayloadError` operation.
         250  +
/* RustType.kt:516 */
  235    251   
#[non_exhaustive]
         252  +
/* RustType.kt:516 */
  236    253   
#[derive(::std::fmt::Debug)]
  237         -
pub enum MalformedAcceptWithPayloadError {
         254  +
pub /* OperationErrorGenerator.kt:81 */ enum MalformedAcceptWithPayloadError {
         255  +
    /* OperationErrorGenerator.kt:88 */
  238    256   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  239    257   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  240    258   
    variable wildcard pattern and check `.code()`:
  241    259   
     \
  242    260   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  243    261   
     \
  244    262   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MalformedAcceptWithPayloadError) for what information is available for the error.")]
  245    263   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         264  +
    /* OperationErrorGenerator.kt:81 */
  246    265   
}
         266  +
/* OperationErrorGenerator.kt:218 */
  247    267   
impl MalformedAcceptWithPayloadError {
         268  +
    /* OperationErrorGenerator.kt:219 */
  248    269   
    /// Creates the `MalformedAcceptWithPayloadError::Unhandled` variant from any error type.
  249    270   
    pub fn unhandled(
  250    271   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  251    272   
    ) -> Self {
  252    273   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  253    274   
            source: err.into(),
  254    275   
            meta: ::std::default::Default::default(),
  255    276   
        })
  256    277   
    }
  257    278   
  258    279   
    /// Creates the `MalformedAcceptWithPayloadError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  259    280   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  260    281   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  261    282   
            source: err.clone().into(),
  262    283   
            meta: err,
  263    284   
        })
  264    285   
    }
  265         -
    ///
         286  +
    /// /* OperationErrorGenerator.kt:236 */
  266    287   
    /// Returns error metadata, which includes the error code, message,
  267    288   
    /// request ID, and potentially additional information.
  268    289   
    ///
         290  +
    /* OperationErrorGenerator.kt:242 */
  269    291   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         292  +
        /* OperationErrorGenerator.kt:243 */
  270    293   
        match self {
  271         -
            Self::Unhandled(e) => &e.meta,
         294  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         295  +
            /* OperationErrorGenerator.kt:243 */
  272    296   
        }
         297  +
        /* OperationErrorGenerator.kt:242 */
  273    298   
    }
         299  +
    /* OperationErrorGenerator.kt:218 */
  274    300   
}
         301  +
/* OperationErrorGenerator.kt:269 */
  275    302   
impl ::std::error::Error for MalformedAcceptWithPayloadError {
         303  +
    /* OperationErrorGenerator.kt:270 */
  276    304   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         305  +
        /* OperationErrorGenerator.kt:318 */
  277    306   
        match self {
  278         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         307  +
            /* OperationErrorGenerator.kt:326 */
         308  +
            Self::Unhandled(_inner) => {
         309  +
                /* OperationErrorGenerator.kt:279 */
         310  +
                ::std::option::Option::Some(&*_inner.source)
         311  +
                /* OperationErrorGenerator.kt:326 */
         312  +
            } /* OperationErrorGenerator.kt:318 */
  279    313   
        }
         314  +
        /* OperationErrorGenerator.kt:270 */
  280    315   
    }
         316  +
    /* OperationErrorGenerator.kt:269 */
  281    317   
}
         318  +
/* OperationErrorGenerator.kt:133 */
  282    319   
impl ::std::fmt::Display for MalformedAcceptWithPayloadError {
         320  +
    /* OperationErrorGenerator.kt:134 */
  283    321   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         322  +
        /* OperationErrorGenerator.kt:318 */
  284    323   
        match self {
         324  +
            /* OperationErrorGenerator.kt:326 */
  285    325   
            Self::Unhandled(_inner) => {
         326  +
                /* OperationErrorGenerator.kt:139 */
  286    327   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  287    328   
                    write!(f, "unhandled error ({code})")
  288    329   
                } else {
  289    330   
                    f.write_str("unhandled error")
  290    331   
                }
  291         -
            }
         332  +
                /* OperationErrorGenerator.kt:326 */
         333  +
            } /* OperationErrorGenerator.kt:318 */
  292    334   
        }
         335  +
        /* OperationErrorGenerator.kt:134 */
  293    336   
    }
         337  +
    /* OperationErrorGenerator.kt:133 */
  294    338   
}
         339  +
/* OperationErrorGenerator.kt:182 */
  295    340   
impl ::aws_smithy_types::retry::ProvideErrorKind for MalformedAcceptWithPayloadError {
         341  +
    /* OperationErrorGenerator.kt:186 */
  296    342   
    fn code(&self) -> ::std::option::Option<&str> {
         343  +
        /* OperationErrorGenerator.kt:187 */
  297    344   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         345  +
        /* OperationErrorGenerator.kt:186 */
  298    346   
    }
         347  +
    /* OperationErrorGenerator.kt:190 */
  299    348   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         349  +
        /* OperationErrorGenerator.kt:197 */
  300    350   
        ::std::option::Option::None
         351  +
        /* OperationErrorGenerator.kt:190 */
  301    352   
    }
         353  +
    /* OperationErrorGenerator.kt:182 */
  302    354   
}
         355  +
/* OperationErrorGenerator.kt:163 */
  303    356   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MalformedAcceptWithPayloadError {
         357  +
    /* OperationErrorGenerator.kt:164 */
  304    358   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         359  +
        /* OperationErrorGenerator.kt:318 */
  305    360   
        match self {
  306         -
            Self::Unhandled(_inner) => &_inner.meta,
         361  +
            /* OperationErrorGenerator.kt:326 */
         362  +
            Self::Unhandled(_inner) => {
         363  +
                /* OperationErrorGenerator.kt:168 */
         364  +
                &_inner.meta
         365  +
                /* OperationErrorGenerator.kt:326 */
         366  +
            } /* OperationErrorGenerator.kt:318 */
  307    367   
        }
         368  +
        /* OperationErrorGenerator.kt:164 */
  308    369   
    }
         370  +
    /* OperationErrorGenerator.kt:163 */
  309    371   
}
         372  +
/* OperationErrorGenerator.kt:109 */
  310    373   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MalformedAcceptWithPayloadError {
         374  +
    /* OperationErrorGenerator.kt:110 */
  311    375   
    fn create_unhandled_error(
  312    376   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  313    377   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  314    378   
    ) -> Self {
         379  +
        /* OperationErrorGenerator.kt:121 */
  315    380   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  316    381   
            source,
  317    382   
            meta: meta.unwrap_or_default(),
  318    383   
        })
         384  +
        /* OperationErrorGenerator.kt:110 */
  319    385   
    }
         386  +
    /* OperationErrorGenerator.kt:109 */
  320    387   
}
  321    388   
         389  +
/* CodegenDelegator.kt:255 */
  322    390   
pub use crate::operation::malformed_accept_with_payload::_malformed_accept_with_payload_output::MalformedAcceptWithPayloadOutput;
  323    391   
         392  +
/* CodegenDelegator.kt:255 */
  324    393   
pub use crate::operation::malformed_accept_with_payload::_malformed_accept_with_payload_input::MalformedAcceptWithPayloadInput;
  325    394   
         395  +
/* RustModule.kt:172 */
  326    396   
mod _malformed_accept_with_payload_input;
  327    397   
         398  +
/* RustModule.kt:172 */
  328    399   
mod _malformed_accept_with_payload_output;
  329    400   
  330         -
/// Builders
         401  +
/// /* CodegenDelegator.kt:51 */Builders
  331    402   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_payload/_malformed_accept_with_payload_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/malformed_accept_with_payload/_malformed_accept_with_payload_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 MalformedAcceptWithPayloadOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MalformedAcceptWithPayloadOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub payload: ::std::option::Option<::aws_smithy_types::Blob>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MalformedAcceptWithPayloadOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn payload(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.payload.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MalformedAcceptWithPayloadOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::malformed_accept_with_payload::builders::MalformedAcceptWithPayloadOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
          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 MalformedAcceptWithPayloadOutputBuilder {
   26         -
    pub(crate) payload: ::std::option::Option<::aws_smithy_types::Blob>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) payload: ::std::option::Option<::aws_smithy_types::Blob>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl MalformedAcceptWithPayloadOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn payload(mut self, input: ::aws_smithy_types::Blob) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.payload = ::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_payload(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.payload = 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_payload(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.payload
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MalformedAcceptWithPayloadOutput`](crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput {
   45         -
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput { payload: self.payload }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::malformed_accept_with_payload::MalformedAcceptWithPayloadOutput {
          82  +
            /* BuilderGenerator.kt:481 */ payload: self.payload,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}