Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +138,162 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::put_with_content_encoding::_put_with_content_encoding_output::PutWithContentEncodingOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::put_with_content_encoding::_put_with_content_encoding_input::PutWithContentEncodingInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder {
    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::put_with_content_encoding::PutWithContentEncodingOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.put_with_content_encoding();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `PutWithContentEncoding`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `PutWithContentEncoding`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct PutWithContentEncodingFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder,
   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::put_with_content_encoding::PutWithContentEncodingOutput,
   34     40   
        crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   35     41   
    > for PutWithContentEncodingFluentBuilder
   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::put_with_content_encoding::PutWithContentEncodingOutput,
   43     49   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   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 PutWithContentEncodingFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `PutWithContentEncodingFluentBuilder`.
   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 PutWithContentEncoding as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::put_with_content_encoding::builders::PutWithContentEncodingInputBuilder {
   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::put_with_content_encoding::PutWithContentEncodingOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   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::put_with_content_encoding::PutWithContentEncoding::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::put_with_content_encoding::PutWithContentEncoding::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::put_with_content_encoding::PutWithContentEncodingOutput,
   96    106   
        crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn encoding(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.encoding(input.into());
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_encoding(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_encoding(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_encoding(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_encoding()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:498 */
  124    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:500 */
  125    144   
    pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  126    145   
        self.inner = self.inner.data(input.into());
  127    146   
        self
  128    147   
    }
         148  +
    /* FluentBuilderGenerator.kt:498 */
  129    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* FluentBuilderGenerator.kt:500 */
  130    151   
    pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  131    152   
        self.inner = self.inner.set_data(input);
  132    153   
        self
  133    154   
    }
         155  +
    /* FluentBuilderGenerator.kt:518 */
  134    156   
    #[allow(missing_docs)] // documentation missing in model
         157  +
                           /* FluentBuilderGenerator.kt:520 */
  135    158   
    pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
  136    159   
        self.inner.get_data()
  137    160   
    }
         161  +
    /* FluentBuilderGenerator.kt:282 */
  138    162   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_idempotency_token_auto_fill.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 `QueryIdempotencyTokenAutoFill`.
           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 QueryIdempotencyTokenAutoFill;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl QueryIdempotencyTokenAutoFill {
    7         -
    /// Creates a new `QueryIdempotencyTokenAutoFill`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `QueryIdempotencyTokenAutoFill`
          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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -73,82 +407,483 @@
   93    102   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   94    103   
            }
   95    104   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   96    105   
                config_override,
   97    106   
                client_config.config.clone(),
   98    107   
                &client_config.runtime_components,
   99    108   
            ));
  100    109   
        }
  101    110   
        runtime_plugins
  102    111   
    }
         112  +
    /* OperationGenerator.kt:85 */
  103    113   
}
         114  +
/* OperationRuntimePluginGenerator.kt:55 */
  104    115   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for QueryIdempotencyTokenAutoFill {
  105    116   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
  106    117   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("QueryIdempotencyTokenAutoFill");
  107    118   
  108    119   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
  109    120   
            QueryIdempotencyTokenAutoFillRequestSerializer,
  110    121   
        ));
  111    122   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  112    123   
            QueryIdempotencyTokenAutoFillResponseDeserializer,
  113    124   
        ));
  114    125   
  115    126   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  116    127   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  117    128   
        ));
  118    129   
  119    130   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  120    131   
            "QueryIdempotencyTokenAutoFill",
  121    132   
            "Rest Json Protocol",
  122    133   
        ));
  123    134   
  124    135   
        ::std::option::Option::Some(cfg.freeze())
  125    136   
    }
  126    137   
  127    138   
    fn runtime_components(
  128    139   
        &self,
  129    140   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  130    141   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  131    142   
        #[allow(unused_mut)]
  132    143   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("QueryIdempotencyTokenAutoFill")
  133    144   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  134    145   
            .with_interceptor(QueryIdempotencyTokenAutoFillEndpointParamsInterceptor)
  135    146   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  136    147   
                crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
  137    148   
            >::new())
  138    149   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  139    150   
                crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
  140    151   
            >::new());
  141    152   
  142    153   
        ::std::borrow::Cow::Owned(rcb)
  143    154   
    }
  144    155   
}
  145    156   
         157  +
/* ResponseDeserializerGenerator.kt:64 */
  146    158   
#[derive(Debug)]
  147    159   
struct QueryIdempotencyTokenAutoFillResponseDeserializer;
  148    160   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryIdempotencyTokenAutoFillResponseDeserializer {
  149    161   
    fn deserialize_nonstreaming(
  150    162   
        &self,
  151    163   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  152    164   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  153    165   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  154    166   
        let headers = response.headers();
  155    167   
        let body = response.body().bytes().expect("body loaded");
  156    168   
        #[allow(unused_mut)]
  157    169   
        let mut force_error = false;
  158    170   
  159    171   
        let parse_result = if !success && status != 200 || force_error {
  160    172   
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_error(status, headers, body)
  161    173   
        } else {
  162    174   
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_response(status, headers, body)
  163    175   
        };
  164    176   
        crate::protocol_serde::type_erase_result(parse_result)
  165    177   
    }
  166    178   
}
         179  +
/* RequestSerializerGenerator.kt:67 */
  167    180   
#[derive(Debug)]
  168    181   
struct QueryIdempotencyTokenAutoFillRequestSerializer;
  169    182   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryIdempotencyTokenAutoFillRequestSerializer {
  170    183   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  171    184   
    fn serialize_input(
  172    185   
        &self,
  173    186   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  174    187   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  175    188   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  176    189   
        let input = input
  177    190   
            .downcast::<crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput>()
  178    191   
            .expect("correct type");
  179    192   
        let _header_serialization_settings = _cfg
  180    193   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  181    194   
            .cloned()
  182    195   
            .unwrap_or_default();
  183    196   
        let mut request_builder = {
  184    197   
            fn uri_base(
  185    198   
                _input: &crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
  186    199   
                output: &mut ::std::string::String,
  187    200   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  188    201   
                use ::std::fmt::Write as _;
  189    202   
                ::std::write!(output, "/QueryIdempotencyTokenAutoFill").expect("formatting should succeed");
  190    203   
                ::std::result::Result::Ok(())
  191    204   
            }
  192    205   
            fn uri_query(
  193    206   
                _input: &crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
  194    207   
                mut output: &mut ::std::string::String,
  195    208   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  196    209   
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  197    210   
                if let ::std::option::Option::Some(inner_1) = &_input.token {
  198    211   
                    {
  199    212   
                        query.push_kv("token", &::aws_smithy_http::query::fmt_string(inner_1));
  200    213   
                    }
  201    214   
                }
  202    215   
                ::std::result::Result::Ok(())
  203    216   
            }
  204    217   
            #[allow(clippy::unnecessary_wraps)]
  205    218   
            fn update_http_builder(
  206    219   
                input: &crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
  207    220   
                builder: ::http::request::Builder,
  208    221   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  209    222   
                let mut uri = ::std::string::String::new();
  210    223   
                uri_base(input, &mut uri)?;
  211    224   
                uri_query(input, &mut uri)?;
  212    225   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  213    226   
            }
  214    227   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  215    228   
            builder
  216    229   
        };
  217    230   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  218    231   
  219    232   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  220    233   
    }
  221    234   
}
         235  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  222    236   
#[derive(Debug)]
  223    237   
struct QueryIdempotencyTokenAutoFillEndpointParamsInterceptor;
  224    238   
  225    239   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryIdempotencyTokenAutoFillEndpointParamsInterceptor {
  226    240   
    fn name(&self) -> &'static str {
  227    241   
        "QueryIdempotencyTokenAutoFillEndpointParamsInterceptor"
  228    242   
    }
  229    243   
  230    244   
    fn read_before_execution(
  231    245   
        &self,
  232    246   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  233    247   
            '_,
  234    248   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  235    249   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  236    250   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  237    251   
        >,
  238    252   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  239    253   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  240    254   
        let _input = context
  241    255   
            .input()
  242    256   
            .downcast_ref::<QueryIdempotencyTokenAutoFillInput>()
  243    257   
            .ok_or("failed to downcast to QueryIdempotencyTokenAutoFillInput")?;
  244    258   
  245    259   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  246    260   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  247    261   
        })?;
  248    262   
        cfg.interceptor_state()
  249    263   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  250    264   
        ::std::result::Result::Ok(())
  251    265   
    }
  252    266   
}
  253    267   
  254    268   
// The get_* functions below are generated from JMESPath expressions in the
  255    269   
// operationContextParams trait. They target the operation's input shape.
  256    270   
         271  +
/* RustType.kt:516 */
  257    272   
#[allow(unreachable_code, unused_variables)]
         273  +
/* RustType.kt:516 */
  258    274   
#[cfg(test)]
         275  +
/* ProtocolTestGenerator.kt:98 */
  259    276   
mod query_idempotency_token_auto_fill_test {
  260    277   
  261    278   
    /// Automatically adds idempotency token when not set
  262    279   
    /// Test ID: RestJsonQueryIdempotencyTokenAutoFill
  263    280   
    #[::tokio::test]
  264    281   
    #[::tracing_test::traced_test]
  265    282   
    async fn rest_json_query_idempotency_token_auto_fill_request() {
  266    283   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  267    284   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  268    285   
  269    286   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  270    287   
        let result = client.query_idempotency_token_auto_fill().send().await;
  271    288   
        let _ = dbg!(result);
  272    289   
        let http_request = request_receiver.expect_request();
  273    290   
        let expected_query_params = &["token=00000000-0000-4000-8000-000000000000"];
  274    291   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  275    292   
        let body = http_request.body().bytes().expect("body should be strict");
  276    293   
        // No body.
  277    294   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  278    295   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  279    296   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  280    297   
        ::pretty_assertions::assert_eq!(uri.path(), "/QueryIdempotencyTokenAutoFill", "path was incorrect");
  281    298   
    }
  282    299   
  283    300   
    /// Uses the given idempotency token as-is
  284    301   
    /// Test ID: RestJsonQueryIdempotencyTokenAutoFillIsSet
  285    302   
    #[::tokio::test]
  286    303   
    #[::tracing_test::traced_test]
  287    304   
    async fn rest_json_query_idempotency_token_auto_fill_is_set_request() {
  288    305   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  289    306   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  290    307   
  291    308   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  292    309   
        let result = client
  293    310   
            .query_idempotency_token_auto_fill()
  294    311   
            .set_token(::std::option::Option::Some("00000000-0000-4000-8000-000000000000".to_owned()))
  295    312   
            .send()
  296    313   
            .await;
  297    314   
        let _ = dbg!(result);
  298    315   
        let http_request = request_receiver.expect_request();
  299    316   
        let expected_query_params = &["token=00000000-0000-4000-8000-000000000000"];
  300    317   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  301    318   
        let body = http_request.body().bytes().expect("body should be strict");
  302    319   
        // No body.
  303    320   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  304    321   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  305    322   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  306    323   
        ::pretty_assertions::assert_eq!(uri.path(), "/QueryIdempotencyTokenAutoFill", "path was incorrect");
  307    324   
    }
         325  +
         326  +
    /* ProtocolTestGenerator.kt:98 */
  308    327   
}
  309    328   
         329  +
/* OperationErrorGenerator.kt:79 */
  310    330   
/// Error type for the `QueryIdempotencyTokenAutoFillError` operation.
         331  +
/* RustType.kt:516 */
  311    332   
#[non_exhaustive]
         333  +
/* RustType.kt:516 */
  312    334   
#[derive(::std::fmt::Debug)]
  313         -
pub enum QueryIdempotencyTokenAutoFillError {
         335  +
pub /* OperationErrorGenerator.kt:81 */ enum QueryIdempotencyTokenAutoFillError {
         336  +
    /* OperationErrorGenerator.kt:88 */
  314    337   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  315    338   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  316    339   
    variable wildcard pattern and check `.code()`:
  317    340   
     \
  318    341   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  319    342   
     \
  320    343   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-QueryIdempotencyTokenAutoFillError) for what information is available for the error.")]
  321    344   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         345  +
    /* OperationErrorGenerator.kt:81 */
  322    346   
}
         347  +
/* OperationErrorGenerator.kt:218 */
  323    348   
impl QueryIdempotencyTokenAutoFillError {
         349  +
    /* OperationErrorGenerator.kt:219 */
  324    350   
    /// Creates the `QueryIdempotencyTokenAutoFillError::Unhandled` variant from any error type.
  325    351   
    pub fn unhandled(
  326    352   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  327    353   
    ) -> Self {
  328    354   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  329    355   
            source: err.into(),
  330    356   
            meta: ::std::default::Default::default(),
  331    357   
        })
  332    358   
    }
  333    359   
  334    360   
    /// Creates the `QueryIdempotencyTokenAutoFillError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  335    361   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  336    362   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  337    363   
            source: err.clone().into(),
  338    364   
            meta: err,
  339    365   
        })
  340    366   
    }
  341         -
    ///
         367  +
    /// /* OperationErrorGenerator.kt:236 */
  342    368   
    /// Returns error metadata, which includes the error code, message,
  343    369   
    /// request ID, and potentially additional information.
  344    370   
    ///
         371  +
    /* OperationErrorGenerator.kt:242 */
  345    372   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         373  +
        /* OperationErrorGenerator.kt:243 */
  346    374   
        match self {
  347         -
            Self::Unhandled(e) => &e.meta,
         375  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         376  +
            /* OperationErrorGenerator.kt:243 */
  348    377   
        }
         378  +
        /* OperationErrorGenerator.kt:242 */
  349    379   
    }
         380  +
    /* OperationErrorGenerator.kt:218 */
  350    381   
}
         382  +
/* OperationErrorGenerator.kt:269 */
  351    383   
impl ::std::error::Error for QueryIdempotencyTokenAutoFillError {
         384  +
    /* OperationErrorGenerator.kt:270 */
  352    385   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         386  +
        /* OperationErrorGenerator.kt:318 */
  353    387   
        match self {
  354         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         388  +
            /* OperationErrorGenerator.kt:326 */
         389  +
            Self::Unhandled(_inner) => {
         390  +
                /* OperationErrorGenerator.kt:279 */
         391  +
                ::std::option::Option::Some(&*_inner.source)
         392  +
                /* OperationErrorGenerator.kt:326 */
         393  +
            } /* OperationErrorGenerator.kt:318 */
  355    394   
        }
         395  +
        /* OperationErrorGenerator.kt:270 */
  356    396   
    }
         397  +
    /* OperationErrorGenerator.kt:269 */
  357    398   
}
         399  +
/* OperationErrorGenerator.kt:133 */
  358    400   
impl ::std::fmt::Display for QueryIdempotencyTokenAutoFillError {
         401  +
    /* OperationErrorGenerator.kt:134 */
  359    402   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         403  +
        /* OperationErrorGenerator.kt:318 */
  360    404   
        match self {
         405  +
            /* OperationErrorGenerator.kt:326 */
  361    406   
            Self::Unhandled(_inner) => {
         407  +
                /* OperationErrorGenerator.kt:139 */
  362    408   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  363    409   
                    write!(f, "unhandled error ({code})")
  364    410   
                } else {
  365    411   
                    f.write_str("unhandled error")
  366    412   
                }
         413  +
                /* OperationErrorGenerator.kt:326 */
         414  +
            } /* OperationErrorGenerator.kt:318 */
  367    415   
        }
         416  +
        /* OperationErrorGenerator.kt:134 */
  368    417   
    }
  369         -
    }
         418  +
    /* OperationErrorGenerator.kt:133 */
  370    419   
}
         420  +
/* OperationErrorGenerator.kt:182 */
  371    421   
impl ::aws_smithy_types::retry::ProvideErrorKind for QueryIdempotencyTokenAutoFillError {
         422  +
    /* OperationErrorGenerator.kt:186 */
  372    423   
    fn code(&self) -> ::std::option::Option<&str> {
         424  +
        /* OperationErrorGenerator.kt:187 */
  373    425   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         426  +
        /* OperationErrorGenerator.kt:186 */
  374    427   
    }
         428  +
    /* OperationErrorGenerator.kt:190 */
  375    429   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         430  +
        /* OperationErrorGenerator.kt:197 */
  376    431   
        ::std::option::Option::None
         432  +
        /* OperationErrorGenerator.kt:190 */
  377    433   
    }
         434  +
    /* OperationErrorGenerator.kt:182 */
  378    435   
}
         436  +
/* OperationErrorGenerator.kt:163 */
  379    437   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for QueryIdempotencyTokenAutoFillError {
         438  +
    /* OperationErrorGenerator.kt:164 */
  380    439   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         440  +
        /* OperationErrorGenerator.kt:318 */
  381    441   
        match self {
  382         -
            Self::Unhandled(_inner) => &_inner.meta,
         442  +
            /* OperationErrorGenerator.kt:326 */
         443  +
            Self::Unhandled(_inner) => {
         444  +
                /* OperationErrorGenerator.kt:168 */
         445  +
                &_inner.meta
         446  +
                /* OperationErrorGenerator.kt:326 */
         447  +
            } /* OperationErrorGenerator.kt:318 */
  383    448   
        }
         449  +
        /* OperationErrorGenerator.kt:164 */
  384    450   
    }
         451  +
    /* OperationErrorGenerator.kt:163 */
  385    452   
}
         453  +
/* OperationErrorGenerator.kt:109 */
  386    454   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for QueryIdempotencyTokenAutoFillError {
         455  +
    /* OperationErrorGenerator.kt:110 */
  387    456   
    fn create_unhandled_error(
  388    457   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  389    458   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  390    459   
    ) -> Self {
         460  +
        /* OperationErrorGenerator.kt:121 */
  391    461   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  392    462   
            source,
  393    463   
            meta: meta.unwrap_or_default(),
  394    464   
        })
         465  +
        /* OperationErrorGenerator.kt:110 */
  395    466   
    }
         467  +
    /* OperationErrorGenerator.kt:109 */
  396    468   
}
  397    469   
         470  +
/* CodegenDelegator.kt:255 */
  398    471   
pub use crate::operation::query_idempotency_token_auto_fill::_query_idempotency_token_auto_fill_output::QueryIdempotencyTokenAutoFillOutput;
  399    472   
         473  +
/* CodegenDelegator.kt:255 */
  400    474   
pub use crate::operation::query_idempotency_token_auto_fill::_query_idempotency_token_auto_fill_input::QueryIdempotencyTokenAutoFillInput;
  401    475   
         476  +
/* RustModule.kt:172 */
  402    477   
mod _query_idempotency_token_auto_fill_input;
  403    478   
         479  +
/* RustModule.kt:172 */
  404    480   
mod _query_idempotency_token_auto_fill_output;
  405    481   
  406         -
/// Builders
         482  +
/// /* CodegenDelegator.kt:51 */Builders
  407    483   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_idempotency_token_auto_fill/_query_idempotency_token_auto_fill_input.rs

@@ -1,1 +52,96 @@
    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 QueryIdempotencyTokenAutoFillInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct QueryIdempotencyTokenAutoFillInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub token: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl QueryIdempotencyTokenAutoFillInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn token(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.token.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl QueryIdempotencyTokenAutoFillInput {
   16         -
    /// Creates a new builder-style object to manufacture [`QueryIdempotencyTokenAutoFillInput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`QueryIdempotencyTokenAutoFillInput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`QueryIdempotencyTokenAutoFillInput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`QueryIdempotencyTokenAutoFillInput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput).
          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 QueryIdempotencyTokenAutoFillInputBuilder {
   26         -
    pub(crate) token: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) token: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl QueryIdempotencyTokenAutoFillInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.token = ::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_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.token = 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_token(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.token
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`QueryIdempotencyTokenAutoFillInput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`QueryIdempotencyTokenAutoFillInput`](crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<
   47     82   
        crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput,
   48     83   
        ::aws_smithy_types::error::operation::BuildError,
   49     84   
    > {
   50         -
        ::std::result::Result::Ok(crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput { token: self.token })
          85  +
        /* BuilderGenerator.kt:254 */
          86  +
        ::std::result::Result::Ok(
          87  +
            /* BuilderGenerator.kt:477 */
          88  +
            crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillInput {
          89  +
                /* BuilderGenerator.kt:481 */ token: self.token,
          90  +
                /* BuilderGenerator.kt:477 */
          91  +
            }, /* BuilderGenerator.kt:254 */
          92  +
        )
          93  +
        /* BuilderGenerator.kt:253 */
   51     94   
    }
          95  +
    /* BuilderGenerator.kt:355 */
   52     96   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_idempotency_token_auto_fill/_query_idempotency_token_auto_fill_output.rs

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

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

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::query_idempotency_token_auto_fill::_query_idempotency_token_auto_fill_output::QueryIdempotencyTokenAutoFillOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::query_idempotency_token_auto_fill::_query_idempotency_token_auto_fill_input::QueryIdempotencyTokenAutoFillInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillInputBuilder {
    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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.query_idempotency_token_auto_fill();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `QueryIdempotencyTokenAutoFill`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `QueryIdempotencyTokenAutoFill`.
   24     27   
///
   25         -
/// Automatically adds idempotency tokens.
          28  +
/// /* FluentBuilderGenerator.kt:130 */Automatically adds idempotency tokens.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct QueryIdempotencyTokenAutoFillFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillInputBuilder,
   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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   35     41   
        crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   36     42   
    > for QueryIdempotencyTokenAutoFillFluentBuilder
   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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   44     50   
            crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   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 QueryIdempotencyTokenAutoFillFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `QueryIdempotencyTokenAutoFillFluentBuilder`.
   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 QueryIdempotencyTokenAutoFill as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::query_idempotency_token_auto_fill::builders::QueryIdempotencyTokenAutoFillInputBuilder {
   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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFill::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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFill::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::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillOutput,
   97    107   
        crate::operation::query_idempotency_token_auto_fill::QueryIdempotencyTokenAutoFillError,
   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 token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.token(input.into());
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_token(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_token(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_token()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_params_as_string_list_map.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 `QueryParamsAsStringListMap`.
           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 QueryParamsAsStringListMap;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl QueryParamsAsStringListMap {
    7         -
    /// Creates a new `QueryParamsAsStringListMap`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `QueryParamsAsStringListMap`
          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::query_params_as_string_list_map::QueryParamsAsStringListMapInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +186,199 @@
   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 QueryParamsAsStringListMap {
   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("QueryParamsAsStringListMap");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            QueryParamsAsStringListMapRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            QueryParamsAsStringListMapResponseDeserializer,
  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   
            "QueryParamsAsStringListMap",
  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("QueryParamsAsStringListMap")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(QueryParamsAsStringListMapEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
  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 QueryParamsAsStringListMapResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryParamsAsStringListMapResponseDeserializer {
  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_query_params_as_string_list_map::de_query_params_as_string_list_map_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_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 QueryParamsAsStringListMapRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryParamsAsStringListMapRequestSerializer {
  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
@@ -194,207 +392,468 @@
  214    227   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  215    228   
            }
  216    229   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  217    230   
            builder
  218    231   
        };
  219    232   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  220    233   
  221    234   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  222    235   
    }
  223    236   
}
         237  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  224    238   
#[derive(Debug)]
  225    239   
struct QueryParamsAsStringListMapEndpointParamsInterceptor;
  226    240   
  227    241   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryParamsAsStringListMapEndpointParamsInterceptor {
  228    242   
    fn name(&self) -> &'static str {
  229    243   
        "QueryParamsAsStringListMapEndpointParamsInterceptor"
  230    244   
    }
  231    245   
  232    246   
    fn read_before_execution(
  233    247   
        &self,
  234    248   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  235    249   
            '_,
  236    250   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  237    251   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  238    252   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  239    253   
        >,
  240    254   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  241    255   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  242    256   
        let _input = context
  243    257   
            .input()
  244    258   
            .downcast_ref::<QueryParamsAsStringListMapInput>()
  245    259   
            .ok_or("failed to downcast to QueryParamsAsStringListMapInput")?;
  246    260   
  247    261   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  248    262   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  249    263   
        })?;
  250    264   
        cfg.interceptor_state()
  251    265   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  252    266   
        ::std::result::Result::Ok(())
  253    267   
    }
  254    268   
}
  255    269   
  256    270   
// The get_* functions below are generated from JMESPath expressions in the
  257    271   
// operationContextParams trait. They target the operation's input shape.
  258    272   
         273  +
/* RustType.kt:516 */
  259    274   
#[allow(unreachable_code, unused_variables)]
         275  +
/* RustType.kt:516 */
  260    276   
#[cfg(test)]
         277  +
/* ProtocolTestGenerator.kt:98 */
  261    278   
mod query_params_as_string_list_map_test {
  262    279   
  263    280   
    /// Serialize query params from map of list strings
  264    281   
    /// Test ID: RestJsonQueryParamsStringListMap
  265    282   
    #[::tokio::test]
  266    283   
    #[::tracing_test::traced_test]
  267    284   
    async fn rest_json_query_params_string_list_map_request() {
  268    285   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  269    286   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  270    287   
  271    288   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  272    289   
        let result = client
  273    290   
            .query_params_as_string_list_map()
  274    291   
            .set_qux(::std::option::Option::Some("named".to_owned()))
  275    292   
            .set_foo(::std::option::Option::Some({
  276    293   
                let mut ret = ::std::collections::HashMap::new();
  277    294   
                ret.insert("baz".to_owned(), vec!["bar".to_owned(), "qux".to_owned()]);
  278    295   
                ret
  279    296   
            }))
  280    297   
            .send()
  281    298   
            .await;
  282    299   
        let _ = dbg!(result);
  283    300   
        let http_request = request_receiver.expect_request();
  284    301   
        let expected_query_params = &["corge=named", "baz=bar", "baz=qux"];
  285    302   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  286    303   
        let body = http_request.body().bytes().expect("body should be strict");
  287    304   
        // No body.
  288    305   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  289    306   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  290    307   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  291    308   
        ::pretty_assertions::assert_eq!(uri.path(), "/StringListMap", "path was incorrect");
  292    309   
    }
         310  +
         311  +
    /* ProtocolTestGenerator.kt:98 */
  293    312   
}
  294    313   
         314  +
/* OperationErrorGenerator.kt:79 */
  295    315   
/// Error type for the `QueryParamsAsStringListMapError` operation.
         316  +
/* RustType.kt:516 */
  296    317   
#[non_exhaustive]
         318  +
/* RustType.kt:516 */
  297    319   
#[derive(::std::fmt::Debug)]
  298         -
pub enum QueryParamsAsStringListMapError {
         320  +
pub /* OperationErrorGenerator.kt:81 */ enum QueryParamsAsStringListMapError {
         321  +
    /* OperationErrorGenerator.kt:88 */
  299    322   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  300    323   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  301    324   
    variable wildcard pattern and check `.code()`:
  302    325   
     \
  303    326   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  304    327   
     \
  305    328   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-QueryParamsAsStringListMapError) for what information is available for the error.")]
  306    329   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         330  +
    /* OperationErrorGenerator.kt:81 */
  307    331   
}
         332  +
/* OperationErrorGenerator.kt:218 */
  308    333   
impl QueryParamsAsStringListMapError {
         334  +
    /* OperationErrorGenerator.kt:219 */
  309    335   
    /// Creates the `QueryParamsAsStringListMapError::Unhandled` variant from any error type.
  310    336   
    pub fn unhandled(
  311    337   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  312    338   
    ) -> Self {
  313    339   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  314    340   
            source: err.into(),
  315    341   
            meta: ::std::default::Default::default(),
  316    342   
        })
  317    343   
    }
  318    344   
  319    345   
    /// Creates the `QueryParamsAsStringListMapError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  320    346   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  321    347   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  322    348   
            source: err.clone().into(),
  323    349   
            meta: err,
  324    350   
        })
  325    351   
    }
  326         -
    ///
         352  +
    /// /* OperationErrorGenerator.kt:236 */
  327    353   
    /// Returns error metadata, which includes the error code, message,
  328    354   
    /// request ID, and potentially additional information.
  329    355   
    ///
         356  +
    /* OperationErrorGenerator.kt:242 */
  330    357   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         358  +
        /* OperationErrorGenerator.kt:243 */
  331    359   
        match self {
  332         -
            Self::Unhandled(e) => &e.meta,
         360  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         361  +
            /* OperationErrorGenerator.kt:243 */
  333    362   
        }
         363  +
        /* OperationErrorGenerator.kt:242 */
  334    364   
    }
         365  +
    /* OperationErrorGenerator.kt:218 */
  335    366   
}
         367  +
/* OperationErrorGenerator.kt:269 */
  336    368   
impl ::std::error::Error for QueryParamsAsStringListMapError {
         369  +
    /* OperationErrorGenerator.kt:270 */
  337    370   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         371  +
        /* OperationErrorGenerator.kt:318 */
  338    372   
        match self {
  339         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         373  +
            /* OperationErrorGenerator.kt:326 */
         374  +
            Self::Unhandled(_inner) => {
         375  +
                /* OperationErrorGenerator.kt:279 */
         376  +
                ::std::option::Option::Some(&*_inner.source)
         377  +
                /* OperationErrorGenerator.kt:326 */
         378  +
            } /* OperationErrorGenerator.kt:318 */
  340    379   
        }
         380  +
        /* OperationErrorGenerator.kt:270 */
  341    381   
    }
         382  +
    /* OperationErrorGenerator.kt:269 */
  342    383   
}
         384  +
/* OperationErrorGenerator.kt:133 */
  343    385   
impl ::std::fmt::Display for QueryParamsAsStringListMapError {
         386  +
    /* OperationErrorGenerator.kt:134 */
  344    387   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         388  +
        /* OperationErrorGenerator.kt:318 */
  345    389   
        match self {
         390  +
            /* OperationErrorGenerator.kt:326 */
  346    391   
            Self::Unhandled(_inner) => {
         392  +
                /* OperationErrorGenerator.kt:139 */
  347    393   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  348    394   
                    write!(f, "unhandled error ({code})")
  349    395   
                } else {
  350    396   
                    f.write_str("unhandled error")
  351    397   
                }
         398  +
                /* OperationErrorGenerator.kt:326 */
         399  +
            } /* OperationErrorGenerator.kt:318 */
  352    400   
        }
         401  +
        /* OperationErrorGenerator.kt:134 */
  353    402   
    }
  354         -
    }
         403  +
    /* OperationErrorGenerator.kt:133 */
  355    404   
}
         405  +
/* OperationErrorGenerator.kt:182 */
  356    406   
impl ::aws_smithy_types::retry::ProvideErrorKind for QueryParamsAsStringListMapError {
         407  +
    /* OperationErrorGenerator.kt:186 */
  357    408   
    fn code(&self) -> ::std::option::Option<&str> {
         409  +
        /* OperationErrorGenerator.kt:187 */
  358    410   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         411  +
        /* OperationErrorGenerator.kt:186 */
  359    412   
    }
         413  +
    /* OperationErrorGenerator.kt:190 */
  360    414   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         415  +
        /* OperationErrorGenerator.kt:197 */
  361    416   
        ::std::option::Option::None
         417  +
        /* OperationErrorGenerator.kt:190 */
  362    418   
    }
         419  +
    /* OperationErrorGenerator.kt:182 */
  363    420   
}
         421  +
/* OperationErrorGenerator.kt:163 */
  364    422   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for QueryParamsAsStringListMapError {
         423  +
    /* OperationErrorGenerator.kt:164 */
  365    424   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         425  +
        /* OperationErrorGenerator.kt:318 */
  366    426   
        match self {
  367         -
            Self::Unhandled(_inner) => &_inner.meta,
         427  +
            /* OperationErrorGenerator.kt:326 */
         428  +
            Self::Unhandled(_inner) => {
         429  +
                /* OperationErrorGenerator.kt:168 */
         430  +
                &_inner.meta
         431  +
                /* OperationErrorGenerator.kt:326 */
         432  +
            } /* OperationErrorGenerator.kt:318 */
  368    433   
        }
         434  +
        /* OperationErrorGenerator.kt:164 */
  369    435   
    }
         436  +
    /* OperationErrorGenerator.kt:163 */
  370    437   
}
         438  +
/* OperationErrorGenerator.kt:109 */
  371    439   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for QueryParamsAsStringListMapError {
         440  +
    /* OperationErrorGenerator.kt:110 */
  372    441   
    fn create_unhandled_error(
  373    442   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  374    443   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  375    444   
    ) -> Self {
         445  +
        /* OperationErrorGenerator.kt:121 */
  376    446   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  377    447   
            source,
  378    448   
            meta: meta.unwrap_or_default(),
  379    449   
        })
         450  +
        /* OperationErrorGenerator.kt:110 */
  380    451   
    }
         452  +
    /* OperationErrorGenerator.kt:109 */
  381    453   
}
  382    454   
         455  +
/* CodegenDelegator.kt:255 */
  383    456   
pub use crate::operation::query_params_as_string_list_map::_query_params_as_string_list_map_output::QueryParamsAsStringListMapOutput;
  384    457   
         458  +
/* CodegenDelegator.kt:255 */
  385    459   
pub use crate::operation::query_params_as_string_list_map::_query_params_as_string_list_map_input::QueryParamsAsStringListMapInput;
  386    460   
         461  +
/* RustModule.kt:172 */
  387    462   
mod _query_params_as_string_list_map_input;
  388    463   
         464  +
/* RustModule.kt:172 */
  389    465   
mod _query_params_as_string_list_map_output;
  390    466   
  391         -
/// Builders
         467  +
/// /* CodegenDelegator.kt:51 */Builders
  392    468   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_params_as_string_list_map/_query_params_as_string_list_map_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_params_as_string_list_map/_query_params_as_string_list_map_output.rs

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

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

@@ -1,1 +146,170 @@
    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::query_params_as_string_list_map::_query_params_as_string_list_map_output::QueryParamsAsStringListMapOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::query_params_as_string_list_map::_query_params_as_string_list_map_input::QueryParamsAsStringListMapInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder {
    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::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.query_params_as_string_list_map();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `QueryParamsAsStringListMap`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `QueryParamsAsStringListMap`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct QueryParamsAsStringListMapFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder,
   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::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   34     40   
        crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   35     41   
    > for QueryParamsAsStringListMapFluentBuilder
   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::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   43     49   
            crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   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 QueryParamsAsStringListMapFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `QueryParamsAsStringListMapFluentBuilder`.
   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 QueryParamsAsStringListMap as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder {
   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::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   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::query_params_as_string_list_map::QueryParamsAsStringListMap::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::query_params_as_string_list_map::QueryParamsAsStringListMap::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::query_params_as_string_list_map::QueryParamsAsStringListMapOutput,
   96    106   
        crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn qux(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.qux(input.into());
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_qux(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_qux(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_qux(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_qux()
  123    140   
    }
  124         -
    ///
         141  +
    /// /* FluentBuilderGenerator.kt:466 */
  125    142   
    /// Adds a key-value pair to `foo`.
  126    143   
    ///
  127    144   
    /// To override the contents of this collection use [`set_foo`](Self::set_foo).
  128    145   
    ///
         146  +
    /* FluentBuilderGenerator.kt:473 */
  129    147   
    #[allow(missing_docs)] // documentation missing in model
         148  +
                           /* FluentBuilderGenerator.kt:475 */
  130    149   
    pub fn foo(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
  131    150   
        self.inner = self.inner.foo(k.into(), v);
  132    151   
        self
  133    152   
    }
         153  +
    /* FluentBuilderGenerator.kt:498 */
  134    154   
    #[allow(missing_docs)] // documentation missing in model
         155  +
                           /* FluentBuilderGenerator.kt:500 */
  135    156   
    pub fn set_foo(
  136    157   
        mut self,
  137    158   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
  138    159   
    ) -> Self {
  139    160   
        self.inner = self.inner.set_foo(input);
  140    161   
        self
  141    162   
    }
         163  +
    /* FluentBuilderGenerator.kt:518 */
  142    164   
    #[allow(missing_docs)] // documentation missing in model
         165  +
                           /* FluentBuilderGenerator.kt:520 */
  143    166   
    pub fn get_foo(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
  144    167   
        self.inner.get_foo()
  145    168   
    }
         169  +
    /* FluentBuilderGenerator.kt:282 */
  146    170   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_precedence.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 `QueryPrecedence`.
           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 QueryPrecedence;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl QueryPrecedence {
    7         -
    /// Creates a new `QueryPrecedence`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `QueryPrecedence`
          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::query_precedence::QueryPrecedenceInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::query_precedence::QueryPrecedenceOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::query_precedence::QueryPrecedenceError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +186,199 @@
   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 QueryPrecedence {
   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("QueryPrecedence");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            QueryPrecedenceRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            QueryPrecedenceResponseDeserializer,
  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   
            "QueryPrecedence",
  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("QueryPrecedence")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(QueryPrecedenceEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::query_precedence::QueryPrecedenceError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::query_precedence::QueryPrecedenceError,
  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 QueryPrecedenceResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryPrecedenceResponseDeserializer {
  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_query_precedence::de_query_precedence_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_query_precedence::de_query_precedence_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 QueryPrecedenceRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryPrecedenceRequestSerializer {
  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
@@ -192,205 +391,467 @@
  212    225   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  213    226   
            }
  214    227   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  215    228   
            builder
  216    229   
        };
  217    230   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  218    231   
  219    232   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  220    233   
    }
  221    234   
}
         235  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  222    236   
#[derive(Debug)]
  223    237   
struct QueryPrecedenceEndpointParamsInterceptor;
  224    238   
  225    239   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryPrecedenceEndpointParamsInterceptor {
  226    240   
    fn name(&self) -> &'static str {
  227    241   
        "QueryPrecedenceEndpointParamsInterceptor"
  228    242   
    }
  229    243   
  230    244   
    fn read_before_execution(
  231    245   
        &self,
  232    246   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  233    247   
            '_,
  234    248   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  235    249   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  236    250   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  237    251   
        >,
  238    252   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  239    253   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  240    254   
        let _input = context
  241    255   
            .input()
  242    256   
            .downcast_ref::<QueryPrecedenceInput>()
  243    257   
            .ok_or("failed to downcast to QueryPrecedenceInput")?;
  244    258   
  245    259   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  246    260   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  247    261   
        })?;
  248    262   
        cfg.interceptor_state()
  249    263   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  250    264   
        ::std::result::Result::Ok(())
  251    265   
    }
  252    266   
}
  253    267   
  254    268   
// The get_* functions below are generated from JMESPath expressions in the
  255    269   
// operationContextParams trait. They target the operation's input shape.
  256    270   
         271  +
/* RustType.kt:516 */
  257    272   
#[allow(unreachable_code, unused_variables)]
         273  +
/* RustType.kt:516 */
  258    274   
#[cfg(test)]
         275  +
/* ProtocolTestGenerator.kt:98 */
  259    276   
mod query_precedence_test {
  260    277   
  261    278   
    /// Prefer named query parameters when serializing
  262    279   
    /// Test ID: RestJsonQueryPrecedence
  263    280   
    #[::tokio::test]
  264    281   
    #[::tracing_test::traced_test]
  265    282   
    async fn rest_json_query_precedence_request() {
  266    283   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  267    284   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  268    285   
  269    286   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  270    287   
        let result = client
  271    288   
            .query_precedence()
  272    289   
            .set_foo(::std::option::Option::Some("named".to_owned()))
  273    290   
            .set_baz(::std::option::Option::Some({
  274    291   
                let mut ret = ::std::collections::HashMap::new();
  275    292   
                ret.insert("bar".to_owned(), "fromMap".to_owned());
  276    293   
                ret.insert("qux".to_owned(), "alsoFromMap".to_owned());
  277    294   
                ret
  278    295   
            }))
  279    296   
            .send()
  280    297   
            .await;
  281    298   
        let _ = dbg!(result);
  282    299   
        let http_request = request_receiver.expect_request();
  283    300   
        let expected_query_params = &["bar=named", "qux=alsoFromMap"];
  284    301   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  285    302   
        let body = http_request.body().bytes().expect("body should be strict");
  286    303   
        // No body.
  287    304   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  288    305   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  289    306   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  290    307   
        ::pretty_assertions::assert_eq!(uri.path(), "/Precedence", "path was incorrect");
  291    308   
    }
         309  +
         310  +
    /* ProtocolTestGenerator.kt:98 */
  292    311   
}
  293    312   
         313  +
/* OperationErrorGenerator.kt:79 */
  294    314   
/// Error type for the `QueryPrecedenceError` operation.
         315  +
/* RustType.kt:516 */
  295    316   
#[non_exhaustive]
         317  +
/* RustType.kt:516 */
  296    318   
#[derive(::std::fmt::Debug)]
  297         -
pub enum QueryPrecedenceError {
         319  +
pub /* OperationErrorGenerator.kt:81 */ enum QueryPrecedenceError {
         320  +
    /* OperationErrorGenerator.kt:88 */
  298    321   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  299    322   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  300    323   
    variable wildcard pattern and check `.code()`:
  301    324   
     \
  302    325   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  303    326   
     \
  304    327   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-QueryPrecedenceError) for what information is available for the error.")]
  305    328   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         329  +
    /* OperationErrorGenerator.kt:81 */
  306    330   
}
         331  +
/* OperationErrorGenerator.kt:218 */
  307    332   
impl QueryPrecedenceError {
         333  +
    /* OperationErrorGenerator.kt:219 */
  308    334   
    /// Creates the `QueryPrecedenceError::Unhandled` variant from any error type.
  309    335   
    pub fn unhandled(
  310    336   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  311    337   
    ) -> Self {
  312    338   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  313    339   
            source: err.into(),
  314    340   
            meta: ::std::default::Default::default(),
  315    341   
        })
  316    342   
    }
  317    343   
  318    344   
    /// Creates the `QueryPrecedenceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  319    345   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  320    346   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  321    347   
            source: err.clone().into(),
  322    348   
            meta: err,
  323    349   
        })
  324    350   
    }
  325         -
    ///
         351  +
    /// /* OperationErrorGenerator.kt:236 */
  326    352   
    /// Returns error metadata, which includes the error code, message,
  327    353   
    /// request ID, and potentially additional information.
  328    354   
    ///
         355  +
    /* OperationErrorGenerator.kt:242 */
  329    356   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         357  +
        /* OperationErrorGenerator.kt:243 */
  330    358   
        match self {
  331         -
            Self::Unhandled(e) => &e.meta,
         359  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         360  +
            /* OperationErrorGenerator.kt:243 */
  332    361   
        }
         362  +
        /* OperationErrorGenerator.kt:242 */
  333    363   
    }
         364  +
    /* OperationErrorGenerator.kt:218 */
  334    365   
}
         366  +
/* OperationErrorGenerator.kt:269 */
  335    367   
impl ::std::error::Error for QueryPrecedenceError {
         368  +
    /* OperationErrorGenerator.kt:270 */
  336    369   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         370  +
        /* OperationErrorGenerator.kt:318 */
  337    371   
        match self {
  338         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         372  +
            /* OperationErrorGenerator.kt:326 */
         373  +
            Self::Unhandled(_inner) => {
         374  +
                /* OperationErrorGenerator.kt:279 */
         375  +
                ::std::option::Option::Some(&*_inner.source)
         376  +
                /* OperationErrorGenerator.kt:326 */
         377  +
            } /* OperationErrorGenerator.kt:318 */
  339    378   
        }
         379  +
        /* OperationErrorGenerator.kt:270 */
  340    380   
    }
         381  +
    /* OperationErrorGenerator.kt:269 */
  341    382   
}
         383  +
/* OperationErrorGenerator.kt:133 */
  342    384   
impl ::std::fmt::Display for QueryPrecedenceError {
         385  +
    /* OperationErrorGenerator.kt:134 */
  343    386   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         387  +
        /* OperationErrorGenerator.kt:318 */
  344    388   
        match self {
         389  +
            /* OperationErrorGenerator.kt:326 */
  345    390   
            Self::Unhandled(_inner) => {
         391  +
                /* OperationErrorGenerator.kt:139 */
  346    392   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  347    393   
                    write!(f, "unhandled error ({code})")
  348    394   
                } else {
  349    395   
                    f.write_str("unhandled error")
  350    396   
                }
         397  +
                /* OperationErrorGenerator.kt:326 */
         398  +
            } /* OperationErrorGenerator.kt:318 */
  351    399   
        }
         400  +
        /* OperationErrorGenerator.kt:134 */
  352    401   
    }
  353         -
    }
         402  +
    /* OperationErrorGenerator.kt:133 */
  354    403   
}
         404  +
/* OperationErrorGenerator.kt:182 */
  355    405   
impl ::aws_smithy_types::retry::ProvideErrorKind for QueryPrecedenceError {
         406  +
    /* OperationErrorGenerator.kt:186 */
  356    407   
    fn code(&self) -> ::std::option::Option<&str> {
         408  +
        /* OperationErrorGenerator.kt:187 */
  357    409   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         410  +
        /* OperationErrorGenerator.kt:186 */
  358    411   
    }
         412  +
    /* OperationErrorGenerator.kt:190 */
  359    413   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         414  +
        /* OperationErrorGenerator.kt:197 */
  360    415   
        ::std::option::Option::None
         416  +
        /* OperationErrorGenerator.kt:190 */
  361    417   
    }
         418  +
    /* OperationErrorGenerator.kt:182 */
  362    419   
}
         420  +
/* OperationErrorGenerator.kt:163 */
  363    421   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for QueryPrecedenceError {
         422  +
    /* OperationErrorGenerator.kt:164 */
  364    423   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         424  +
        /* OperationErrorGenerator.kt:318 */
  365    425   
        match self {
  366         -
            Self::Unhandled(_inner) => &_inner.meta,
         426  +
            /* OperationErrorGenerator.kt:326 */
         427  +
            Self::Unhandled(_inner) => {
         428  +
                /* OperationErrorGenerator.kt:168 */
         429  +
                &_inner.meta
         430  +
                /* OperationErrorGenerator.kt:326 */
         431  +
            } /* OperationErrorGenerator.kt:318 */
  367    432   
        }
         433  +
        /* OperationErrorGenerator.kt:164 */
  368    434   
    }
         435  +
    /* OperationErrorGenerator.kt:163 */
  369    436   
}
         437  +
/* OperationErrorGenerator.kt:109 */
  370    438   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for QueryPrecedenceError {
         439  +
    /* OperationErrorGenerator.kt:110 */
  371    440   
    fn create_unhandled_error(
  372    441   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  373    442   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  374    443   
    ) -> Self {
         444  +
        /* OperationErrorGenerator.kt:121 */
  375    445   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  376    446   
            source,
  377    447   
            meta: meta.unwrap_or_default(),
  378    448   
        })
         449  +
        /* OperationErrorGenerator.kt:110 */
  379    450   
    }
         451  +
    /* OperationErrorGenerator.kt:109 */
  380    452   
}
  381    453   
         454  +
/* CodegenDelegator.kt:255 */
  382    455   
pub use crate::operation::query_precedence::_query_precedence_output::QueryPrecedenceOutput;
  383    456   
         457  +
/* CodegenDelegator.kt:255 */
  384    458   
pub use crate::operation::query_precedence::_query_precedence_input::QueryPrecedenceInput;
  385    459   
         460  +
/* RustModule.kt:172 */
  386    461   
mod _query_precedence_input;
  387    462   
         463  +
/* RustModule.kt:172 */
  388    464   
mod _query_precedence_output;
  389    465   
  390         -
/// Builders
         466  +
/// /* CodegenDelegator.kt:51 */Builders
  391    467   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_precedence/_query_precedence_input.rs

@@ -1,1 +78,140 @@
    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 QueryPrecedenceInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct QueryPrecedenceInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub baz: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl QueryPrecedenceInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn baz(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
          31  +
        /* StructureGenerator.kt:170 */
   18     32   
        self.baz.as_ref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl QueryPrecedenceInput {
   22         -
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct QueryPrecedenceInputBuilder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */
   33     58   
    pub(crate) baz: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          59  +
    /* BuilderGenerator.kt:345 */
   34     60   
}
          61  +
/* BuilderGenerator.kt:355 */
   35     62   
impl QueryPrecedenceInputBuilder {
          63  +
    /* BuilderGenerator.kt:286 */
   36     64   
    #[allow(missing_docs)] // documentation missing in model
          65  +
                           /* BuilderGenerator.kt:291 */
   37     66   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          67  +
        /* BuilderGenerator.kt:292 */
   38     68   
        self.foo = ::std::option::Option::Some(input.into());
          69  +
        /* BuilderGenerator.kt:293 */
   39     70   
        self
          71  +
        /* BuilderGenerator.kt:291 */
   40     72   
    }
          73  +
    /* BuilderGenerator.kt:312 */
   41     74   
    #[allow(missing_docs)] // documentation missing in model
          75  +
                           /* BuilderGenerator.kt:314 */
   42     76   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          77  +
        /* BuilderGenerator.kt:315 */
   43     78   
        self.foo = input;
   44     79   
        self
          80  +
        /* BuilderGenerator.kt:314 */
   45     81   
    }
          82  +
    /* BuilderGenerator.kt:334 */
   46     83   
    #[allow(missing_docs)] // documentation missing in model
          84  +
                           /* BuilderGenerator.kt:336 */
   47     85   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          86  +
        /* BuilderGenerator.kt:337 */
   48     87   
        &self.foo
          88  +
        /* BuilderGenerator.kt:336 */
   49     89   
    }
   50         -
    /// Adds a key-value pair to `baz`.
          90  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `baz`.
          91  +
    /* BuilderGenerator.kt:437 */
   51     92   
    ///
   52         -
    /// To override the contents of this collection use [`set_baz`](Self::set_baz).
          93  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_baz`](Self::set_baz).
          94  +
    /* BuilderGenerator.kt:439 */
   53     95   
    ///
          96  +
    /* BuilderGenerator.kt:445 */
   54     97   
    pub fn baz(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
          98  +
        /* BuilderGenerator.kt:448 */
   55     99   
        let mut hash_map = self.baz.unwrap_or_default();
   56    100   
        hash_map.insert(k.into(), v.into());
   57    101   
        self.baz = ::std::option::Option::Some(hash_map);
   58    102   
        self
         103  +
        /* BuilderGenerator.kt:445 */
   59    104   
    }
         105  +
    /* BuilderGenerator.kt:312 */
   60    106   
    #[allow(missing_docs)] // documentation missing in model
         107  +
                           /* BuilderGenerator.kt:314 */
   61    108   
    pub fn set_baz(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
         109  +
        /* BuilderGenerator.kt:315 */
   62    110   
        self.baz = input;
   63    111   
        self
         112  +
        /* BuilderGenerator.kt:314 */
   64    113   
    }
         114  +
    /* BuilderGenerator.kt:334 */
   65    115   
    #[allow(missing_docs)] // documentation missing in model
         116  +
                           /* BuilderGenerator.kt:336 */
   66    117   
    pub fn get_baz(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         118  +
        /* BuilderGenerator.kt:337 */
   67    119   
        &self.baz
         120  +
        /* BuilderGenerator.kt:336 */
   68    121   
    }
   69         -
    /// Consumes the builder and constructs a [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
         122  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
         123  +
    /* BuilderGenerator.kt:253 */
   70    124   
    pub fn build(
   71    125   
        self,
   72    126   
    ) -> ::std::result::Result<crate::operation::query_precedence::QueryPrecedenceInput, ::aws_smithy_types::error::operation::BuildError> {
   73         -
        ::std::result::Result::Ok(crate::operation::query_precedence::QueryPrecedenceInput {
   74         -
            foo: self.foo,
         127  +
        /* BuilderGenerator.kt:254 */
         128  +
        ::std::result::Result::Ok(
         129  +
            /* BuilderGenerator.kt:477 */
         130  +
            crate::operation::query_precedence::QueryPrecedenceInput {
         131  +
                /* BuilderGenerator.kt:481 */ foo: self.foo,
         132  +
                /* BuilderGenerator.kt:481 */
   75    133   
                baz: self.baz,
   76         -
        })
         134  +
                /* BuilderGenerator.kt:477 */
         135  +
            }, /* BuilderGenerator.kt:254 */
         136  +
        )
         137  +
        /* BuilderGenerator.kt:253 */
   77    138   
    }
         139  +
    /* BuilderGenerator.kt:355 */
   78    140   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/query_precedence/_query_precedence_output.rs

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

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

@@ -1,1 +143,167 @@
    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::query_precedence::_query_precedence_output::QueryPrecedenceOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::query_precedence::_query_precedence_input::QueryPrecedenceInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
    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::query_precedence::QueryPrecedenceOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::query_precedence::QueryPrecedenceError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.query_precedence();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `QueryPrecedence`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `QueryPrecedence`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct QueryPrecedenceFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder,
   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::query_precedence::QueryPrecedenceOutput,
   34     40   
        crate::operation::query_precedence::QueryPrecedenceError,
   35     41   
    > for QueryPrecedenceFluentBuilder
   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::query_precedence::QueryPrecedenceOutput,
   43     49   
            crate::operation::query_precedence::QueryPrecedenceError,
   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 QueryPrecedenceFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `QueryPrecedenceFluentBuilder`.
   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 QueryPrecedence as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
   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::query_precedence::QueryPrecedenceOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::query_precedence::QueryPrecedenceError,
   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::query_precedence::QueryPrecedence::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::query_precedence::QueryPrecedence::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::query_precedence::QueryPrecedenceOutput,
   96    106   
        crate::operation::query_precedence::QueryPrecedenceError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.foo(input.into());
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_foo(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_foo()
  123    140   
    }
  124         -
    ///
         141  +
    /// /* FluentBuilderGenerator.kt:466 */
  125    142   
    /// Adds a key-value pair to `baz`.
  126    143   
    ///
  127    144   
    /// To override the contents of this collection use [`set_baz`](Self::set_baz).
  128    145   
    ///
         146  +
    /* FluentBuilderGenerator.kt:473 */
  129    147   
    #[allow(missing_docs)] // documentation missing in model
         148  +
                           /* FluentBuilderGenerator.kt:475 */
  130    149   
    pub fn baz(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
  131    150   
        self.inner = self.inner.baz(k.into(), v.into());
  132    151   
        self
  133    152   
    }
         153  +
    /* FluentBuilderGenerator.kt:498 */
  134    154   
    #[allow(missing_docs)] // documentation missing in model
         155  +
                           /* FluentBuilderGenerator.kt:500 */
  135    156   
    pub fn set_baz(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
  136    157   
        self.inner = self.inner.set_baz(input);
  137    158   
        self
  138    159   
    }
         160  +
    /* FluentBuilderGenerator.kt:518 */
  139    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* FluentBuilderGenerator.kt:520 */
  140    163   
    pub fn get_baz(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  141    164   
        self.inner.get_baz()
  142    165   
    }
         166  +
    /* FluentBuilderGenerator.kt:282 */
  143    167   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/recursive_shapes.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 `RecursiveShapes`.
           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 RecursiveShapes;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl RecursiveShapes {
    7         -
    /// Creates a new `RecursiveShapes`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `RecursiveShapes`
          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::recursive_shapes::RecursiveShapesInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::recursive_shapes::RecursiveShapesOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::recursive_shapes::RecursiveShapesError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +269,286 @@
   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 RecursiveShapes {
   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("RecursiveShapes");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            RecursiveShapesRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            RecursiveShapesResponseDeserializer,
  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   
            "RecursiveShapes",
  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("RecursiveShapes")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(RecursiveShapesEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::recursive_shapes::RecursiveShapesError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::recursive_shapes::RecursiveShapesError,
  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 RecursiveShapesResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RecursiveShapesResponseDeserializer {
  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_recursive_shapes::de_recursive_shapes_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_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 RecursiveShapesRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RecursiveShapesRequestSerializer {
  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::recursive_shapes::RecursiveShapesInput>()
  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::recursive_shapes::RecursiveShapesInput,
  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, "/RecursiveShapes").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::recursive_shapes::RecursiveShapesInput,
  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("PUT").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_recursive_shapes::ser_recursive_shapes_input(&input)?);
  196    209   
        if let Some(content_length) = body.content_length() {
  197    210   
            let content_length = content_length.to_string();
  198    211   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  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 RecursiveShapesEndpointParamsInterceptor;
  205    219   
  206    220   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RecursiveShapesEndpointParamsInterceptor {
  207    221   
    fn name(&self) -> &'static str {
  208    222   
        "RecursiveShapesEndpointParamsInterceptor"
  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::<RecursiveShapesInput>()
  224    238   
            .ok_or("failed to downcast to RecursiveShapesInput")?;
  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  +
/* RustType.kt:516 */
  238    253   
#[allow(unreachable_code, unused_variables)]
         254  +
/* RustType.kt:516 */
  239    255   
#[cfg(test)]
         256  +
/* ProtocolTestGenerator.kt:98 */
  240    257   
mod recursive_shapes_test {
  241    258   
  242    259   
    /// Serializes recursive structures
  243    260   
    /// Test ID: RestJsonRecursiveShapes
  244    261   
    #[::tokio::test]
  245    262   
    #[::tracing_test::traced_test]
  246    263   
    async fn rest_json_recursive_shapes_request() {
  247    264   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    265   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  249    266   
@@ -316,333 +445,521 @@
  336    353   
                )))
  337    354   
            });
  338    355   
            de.deserialize_nonstreaming(&http_response)
  339    356   
        });
  340    357   
        let parsed = parsed
  341    358   
            .expect("should be successful response")
  342    359   
            .downcast::<crate::operation::recursive_shapes::RecursiveShapesOutput>()
  343    360   
            .unwrap();
  344    361   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  345    362   
    }
         363  +
         364  +
    /* ProtocolTestGenerator.kt:98 */
  346    365   
}
  347    366   
         367  +
/* OperationErrorGenerator.kt:79 */
  348    368   
/// Error type for the `RecursiveShapesError` operation.
         369  +
/* RustType.kt:516 */
  349    370   
#[non_exhaustive]
         371  +
/* RustType.kt:516 */
  350    372   
#[derive(::std::fmt::Debug)]
  351         -
pub enum RecursiveShapesError {
         373  +
pub /* OperationErrorGenerator.kt:81 */ enum RecursiveShapesError {
         374  +
    /* OperationErrorGenerator.kt:88 */
  352    375   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  353    376   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  354    377   
    variable wildcard pattern and check `.code()`:
  355    378   
     \
  356    379   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  357    380   
     \
  358    381   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RecursiveShapesError) for what information is available for the error.")]
  359    382   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         383  +
    /* OperationErrorGenerator.kt:81 */
  360    384   
}
         385  +
/* OperationErrorGenerator.kt:218 */
  361    386   
impl RecursiveShapesError {
         387  +
    /* OperationErrorGenerator.kt:219 */
  362    388   
    /// Creates the `RecursiveShapesError::Unhandled` variant from any error type.
  363    389   
    pub fn unhandled(
  364    390   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  365    391   
    ) -> Self {
  366    392   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  367    393   
            source: err.into(),
  368    394   
            meta: ::std::default::Default::default(),
  369    395   
        })
  370    396   
    }
  371    397   
  372    398   
    /// Creates the `RecursiveShapesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  373    399   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  374    400   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  375    401   
            source: err.clone().into(),
  376    402   
            meta: err,
  377    403   
        })
  378    404   
    }
  379         -
    ///
         405  +
    /// /* OperationErrorGenerator.kt:236 */
  380    406   
    /// Returns error metadata, which includes the error code, message,
  381    407   
    /// request ID, and potentially additional information.
  382    408   
    ///
         409  +
    /* OperationErrorGenerator.kt:242 */
  383    410   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         411  +
        /* OperationErrorGenerator.kt:243 */
  384    412   
        match self {
  385         -
            Self::Unhandled(e) => &e.meta,
         413  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         414  +
            /* OperationErrorGenerator.kt:243 */
  386    415   
        }
         416  +
        /* OperationErrorGenerator.kt:242 */
  387    417   
    }
         418  +
    /* OperationErrorGenerator.kt:218 */
  388    419   
}
         420  +
/* OperationErrorGenerator.kt:269 */
  389    421   
impl ::std::error::Error for RecursiveShapesError {
         422  +
    /* OperationErrorGenerator.kt:270 */
  390    423   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         424  +
        /* OperationErrorGenerator.kt:318 */
  391    425   
        match self {
  392         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         426  +
            /* OperationErrorGenerator.kt:326 */
         427  +
            Self::Unhandled(_inner) => {
         428  +
                /* OperationErrorGenerator.kt:279 */
         429  +
                ::std::option::Option::Some(&*_inner.source)
         430  +
                /* OperationErrorGenerator.kt:326 */
         431  +
            } /* OperationErrorGenerator.kt:318 */
  393    432   
        }
         433  +
        /* OperationErrorGenerator.kt:270 */
  394    434   
    }
         435  +
    /* OperationErrorGenerator.kt:269 */
  395    436   
}
         437  +
/* OperationErrorGenerator.kt:133 */
  396    438   
impl ::std::fmt::Display for RecursiveShapesError {
         439  +
    /* OperationErrorGenerator.kt:134 */
  397    440   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         441  +
        /* OperationErrorGenerator.kt:318 */
  398    442   
        match self {
         443  +
            /* OperationErrorGenerator.kt:326 */
  399    444   
            Self::Unhandled(_inner) => {
         445  +
                /* OperationErrorGenerator.kt:139 */
  400    446   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  401    447   
                    write!(f, "unhandled error ({code})")
  402    448   
                } else {
  403    449   
                    f.write_str("unhandled error")
  404    450   
                }
         451  +
                /* OperationErrorGenerator.kt:326 */
         452  +
            } /* OperationErrorGenerator.kt:318 */
  405    453   
        }
         454  +
        /* OperationErrorGenerator.kt:134 */
  406    455   
    }
  407         -
    }
         456  +
    /* OperationErrorGenerator.kt:133 */
  408    457   
}
         458  +
/* OperationErrorGenerator.kt:182 */
  409    459   
impl ::aws_smithy_types::retry::ProvideErrorKind for RecursiveShapesError {
         460  +
    /* OperationErrorGenerator.kt:186 */
  410    461   
    fn code(&self) -> ::std::option::Option<&str> {
         462  +
        /* OperationErrorGenerator.kt:187 */
  411    463   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         464  +
        /* OperationErrorGenerator.kt:186 */
  412    465   
    }
         466  +
    /* OperationErrorGenerator.kt:190 */
  413    467   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         468  +
        /* OperationErrorGenerator.kt:197 */
  414    469   
        ::std::option::Option::None
         470  +
        /* OperationErrorGenerator.kt:190 */
  415    471   
    }
         472  +
    /* OperationErrorGenerator.kt:182 */
  416    473   
}
         474  +
/* OperationErrorGenerator.kt:163 */
  417    475   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RecursiveShapesError {
         476  +
    /* OperationErrorGenerator.kt:164 */
  418    477   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         478  +
        /* OperationErrorGenerator.kt:318 */
  419    479   
        match self {
  420         -
            Self::Unhandled(_inner) => &_inner.meta,
         480  +
            /* OperationErrorGenerator.kt:326 */
         481  +
            Self::Unhandled(_inner) => {
         482  +
                /* OperationErrorGenerator.kt:168 */
         483  +
                &_inner.meta
         484  +
                /* OperationErrorGenerator.kt:326 */
         485  +
            } /* OperationErrorGenerator.kt:318 */
  421    486   
        }
         487  +
        /* OperationErrorGenerator.kt:164 */
  422    488   
    }
         489  +
    /* OperationErrorGenerator.kt:163 */
  423    490   
}
         491  +
/* OperationErrorGenerator.kt:109 */
  424    492   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RecursiveShapesError {
         493  +
    /* OperationErrorGenerator.kt:110 */
  425    494   
    fn create_unhandled_error(
  426    495   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  427    496   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  428    497   
    ) -> Self {
         498  +
        /* OperationErrorGenerator.kt:121 */
  429    499   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  430    500   
            source,
  431    501   
            meta: meta.unwrap_or_default(),
  432    502   
        })
         503  +
        /* OperationErrorGenerator.kt:110 */
  433    504   
    }
         505  +
    /* OperationErrorGenerator.kt:109 */
  434    506   
}
  435    507   
         508  +
/* CodegenDelegator.kt:255 */
  436    509   
pub use crate::operation::recursive_shapes::_recursive_shapes_output::RecursiveShapesOutput;
  437    510   
         511  +
/* CodegenDelegator.kt:255 */
  438    512   
pub use crate::operation::recursive_shapes::_recursive_shapes_input::RecursiveShapesInput;
  439    513   
         514  +
/* RustModule.kt:172 */
  440    515   
mod _recursive_shapes_input;
  441    516   
         517  +
/* RustModule.kt:172 */
  442    518   
mod _recursive_shapes_output;
  443    519   
  444         -
/// Builders
         520  +
/// /* CodegenDelegator.kt:51 */Builders
  445    521   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/recursive_shapes/_recursive_shapes_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/recursive_shapes/_recursive_shapes_output.rs

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