Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

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

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

@@ -1,1 +111,123 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::no_input_and_output::_no_input_and_output_output::NoInputAndOutputOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::no_input_and_output::_no_input_and_output_input::NoInputAndOutputInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.no_input_and_output();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `NoInputAndOutput`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `NoInputAndOutput`.
   24     27   
///
   25         -
/// The example tests how requests and responses are serialized when there's no request or response payload because the operation has no input and the output is empty. While this should be rare, code generators must support this.
          28  +
/// /* FluentBuilderGenerator.kt:130 */The example tests how requests and responses are serialized when there's no request or response payload because the operation has no input and the output is empty. While this should be rare, code generators must support this.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct NoInputAndOutputFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder,
   30     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   31     36   
}
          37  +
/* FluentBuilderGenerator.kt:381 */
   32     38   
impl
   33     39   
    crate::client::customize::internal::CustomizableSend<
   34     40   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   35     41   
        crate::operation::no_input_and_output::NoInputAndOutputError,
   36     42   
    > for NoInputAndOutputFluentBuilder
   37     43   
{
   38     44   
    fn send(
   39     45   
        self,
   40     46   
        config_override: crate::config::Builder,
   41     47   
    ) -> crate::client::customize::internal::BoxFuture<
   42     48   
        crate::client::customize::internal::SendResult<
   43     49   
            crate::operation::no_input_and_output::NoInputAndOutputOutput,
   44     50   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   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 NoInputAndOutputFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `NoInputAndOutputFluentBuilder`.
   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 NoInputAndOutput as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder {
   61     70   
        &self.inner
   62     71   
    }
          72  +
    /* FluentBuilderGenerator.kt:145 */
   63     73   
    /// Sends the request and returns the response.
   64     74   
    ///
   65     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66     76   
    /// can be matched against.
   67     77   
    ///
   68     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   69     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70     80   
    /// set when configuring the client.
   71     81   
    pub async fn send(
   72     82   
        self,
   73     83   
    ) -> ::std::result::Result<
   74     84   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   77     87   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78     88   
        >,
   79     89   
    > {
   80     90   
        let input = self
   81     91   
            .inner
   82     92   
            .build()
   83     93   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     94   
        let runtime_plugins = crate::operation::no_input_and_output::NoInputAndOutput::operation_runtime_plugins(
   85     95   
            self.handle.runtime_plugins.clone(),
   86     96   
            &self.handle.conf,
   87     97   
            self.config_override,
   88     98   
        );
   89     99   
        crate::operation::no_input_and_output::NoInputAndOutput::orchestrate(&runtime_plugins, input).await
   90    100   
    }
   91    101   
   92    102   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93    103   
    pub fn customize(
   94    104   
        self,
   95    105   
    ) -> crate::client::customize::CustomizableOperation<
   96    106   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   97    107   
        crate::operation::no_input_and_output::NoInputAndOutputError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:282 */
  111    123   
}

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/null_and_empty_headers_client/_null_and_empty_headers_client_input.rs

@@ -1,1 +105,189 @@
    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 NullAndEmptyHeadersClientInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct NullAndEmptyHeadersClientInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub a: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub b: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          18  +
    /* StructureGenerator.kt:201 */
   12     19   
}
          20  +
/* StructureGenerator.kt:135 */
   13     21   
impl NullAndEmptyHeadersClientInput {
          22  +
    /* StructureGenerator.kt:231 */
   14     23   
    #[allow(missing_docs)] // documentation missing in model
          24  +
                           /* StructureGenerator.kt:166 */
   15     25   
    pub fn a(&self) -> ::std::option::Option<&str> {
          26  +
        /* StructureGenerator.kt:169 */
   16     27   
        self.a.as_deref()
          28  +
        /* StructureGenerator.kt:166 */
   17     29   
    }
          30  +
    /* StructureGenerator.kt:231 */
   18     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
                           /* StructureGenerator.kt:166 */
   19     33   
    pub fn b(&self) -> ::std::option::Option<&str> {
          34  +
        /* StructureGenerator.kt:169 */
   20     35   
        self.b.as_deref()
          36  +
        /* StructureGenerator.kt:166 */
   21     37   
    }
          38  +
    /* StructureGenerator.kt:231 */
   22     39   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          40  +
    /// /* StructureGenerator.kt:162 */
          41  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          42  +
    /* StructureGenerator.kt:166 */
   25     43   
    pub fn c(&self) -> &[::std::string::String] {
   26         -
        self.c.as_deref().unwrap_or_default()
          44  +
        /* StructureGenerator.kt:169 */
          45  +
        self.c
          46  +
            .as_deref()
          47  +
            /* StructureGenerator.kt:175 */
          48  +
            .unwrap_or_default()
          49  +
        /* StructureGenerator.kt:166 */
   27     50   
    }
          51  +
    /* StructureGenerator.kt:135 */
   28     52   
}
          53  +
/* ClientCodegenVisitor.kt:237 */
   29     54   
impl NullAndEmptyHeadersClientInput {
   30         -
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersClientInput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput).
          55  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NullAndEmptyHeadersClientInput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput).
          56  +
    /* BuilderGenerator.kt:175 */
   31     57   
    pub fn builder() -> crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientInputBuilder {
          58  +
        /* BuilderGenerator.kt:176 */
   32     59   
        crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientInputBuilder::default()
          60  +
        /* BuilderGenerator.kt:175 */
   33     61   
    }
          62  +
    /* ClientCodegenVisitor.kt:237 */
   34     63   
}
   35     64   
   36         -
/// A builder for [`NullAndEmptyHeadersClientInput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput).
          65  +
/// /* BuilderGenerator.kt:342 */A builder for [`NullAndEmptyHeadersClientInput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput).
          66  +
/* RustType.kt:516 */
   37     67   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          68  +
/* RustType.kt:516 */
   38     69   
#[non_exhaustive]
          70  +
/* BuilderGenerator.kt:345 */
   39     71   
pub struct NullAndEmptyHeadersClientInputBuilder {
   40         -
    pub(crate) a: ::std::option::Option<::std::string::String>,
   41         -
    pub(crate) b: ::std::option::Option<::std::string::String>,
          72  +
    /* BuilderGenerator.kt:275 */ pub(crate) a: ::std::option::Option<::std::string::String>,
          73  +
    /* BuilderGenerator.kt:275 */ pub(crate) b: ::std::option::Option<::std::string::String>,
          74  +
    /* BuilderGenerator.kt:275 */
   42     75   
    pub(crate) c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          76  +
    /* BuilderGenerator.kt:345 */
   43     77   
}
          78  +
/* BuilderGenerator.kt:355 */
   44     79   
impl NullAndEmptyHeadersClientInputBuilder {
          80  +
    /* BuilderGenerator.kt:286 */
   45     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:291 */
   46     83   
    pub fn a(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          84  +
        /* BuilderGenerator.kt:292 */
   47     85   
        self.a = ::std::option::Option::Some(input.into());
          86  +
        /* BuilderGenerator.kt:293 */
   48     87   
        self
          88  +
        /* BuilderGenerator.kt:291 */
   49     89   
    }
          90  +
    /* BuilderGenerator.kt:312 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:314 */
   51     93   
    pub fn set_a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          94  +
        /* BuilderGenerator.kt:315 */
   52     95   
        self.a = input;
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:314 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:334 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:336 */
   56    102   
    pub fn get_a(&self) -> &::std::option::Option<::std::string::String> {
         103  +
        /* BuilderGenerator.kt:337 */
   57    104   
        &self.a
         105  +
        /* BuilderGenerator.kt:336 */
   58    106   
    }
         107  +
    /* BuilderGenerator.kt:286 */
   59    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:291 */
   60    110   
    pub fn b(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         111  +
        /* BuilderGenerator.kt:292 */
   61    112   
        self.b = ::std::option::Option::Some(input.into());
         113  +
        /* BuilderGenerator.kt:293 */
   62    114   
        self
         115  +
        /* BuilderGenerator.kt:291 */
   63    116   
    }
         117  +
    /* BuilderGenerator.kt:312 */
   64    118   
    #[allow(missing_docs)] // documentation missing in model
         119  +
                           /* BuilderGenerator.kt:314 */
   65    120   
    pub fn set_b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        /* BuilderGenerator.kt:315 */
   66    122   
        self.b = input;
   67    123   
        self
         124  +
        /* BuilderGenerator.kt:314 */
   68    125   
    }
         126  +
    /* BuilderGenerator.kt:334 */
   69    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* BuilderGenerator.kt:336 */
   70    129   
    pub fn get_b(&self) -> &::std::option::Option<::std::string::String> {
         130  +
        /* BuilderGenerator.kt:337 */
   71    131   
        &self.b
         132  +
        /* BuilderGenerator.kt:336 */
   72    133   
    }
   73         -
    /// Appends an item to `c`.
         134  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `c`.
         135  +
    /* BuilderGenerator.kt:411 */
   74    136   
    ///
   75         -
    /// To override the contents of this collection use [`set_c`](Self::set_c).
         137  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_c`](Self::set_c).
         138  +
    /* BuilderGenerator.kt:413 */
   76    139   
    ///
         140  +
    /* BuilderGenerator.kt:418 */
   77    141   
    pub fn c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        /* BuilderGenerator.kt:419 */
   78    143   
        let mut v = self.c.unwrap_or_default();
   79    144   
        v.push(input.into());
   80    145   
        self.c = ::std::option::Option::Some(v);
   81    146   
        self
         147  +
        /* BuilderGenerator.kt:418 */
   82    148   
    }
         149  +
    /* BuilderGenerator.kt:312 */
   83    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* BuilderGenerator.kt:314 */
   84    152   
    pub fn set_c(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         153  +
        /* BuilderGenerator.kt:315 */
   85    154   
        self.c = input;
   86    155   
        self
         156  +
        /* BuilderGenerator.kt:314 */
   87    157   
    }
         158  +
    /* BuilderGenerator.kt:334 */
   88    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:336 */
   89    161   
    pub fn get_c(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         162  +
        /* BuilderGenerator.kt:337 */
   90    163   
        &self.c
         164  +
        /* BuilderGenerator.kt:336 */
   91    165   
    }
   92         -
    /// Consumes the builder and constructs a [`NullAndEmptyHeadersClientInput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput).
         166  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NullAndEmptyHeadersClientInput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput).
         167  +
    /* BuilderGenerator.kt:253 */
   93    168   
    pub fn build(
   94    169   
        self,
   95    170   
    ) -> ::std::result::Result<
   96    171   
        crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput,
   97    172   
        ::aws_smithy_types::error::operation::BuildError,
   98    173   
    > {
   99         -
        ::std::result::Result::Ok(crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput {
  100         -
            a: self.a,
  101         -
            b: self.b,
  102         -
            c: self.c,
  103         -
        })
         174  +
        /* BuilderGenerator.kt:254 */
         175  +
        ::std::result::Result::Ok(
         176  +
            /* BuilderGenerator.kt:477 */
         177  +
            crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientInput {
         178  +
                /* BuilderGenerator.kt:481 */ a: self.a,
         179  +
                /* BuilderGenerator.kt:481 */
         180  +
                b: self.b,
         181  +
                /* BuilderGenerator.kt:481 */
         182  +
                c: self.c,
         183  +
                /* BuilderGenerator.kt:477 */
         184  +
            }, /* BuilderGenerator.kt:254 */
         185  +
        )
         186  +
        /* BuilderGenerator.kt:253 */
  104    187   
    }
         188  +
    /* BuilderGenerator.kt:355 */
  105    189   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/null_and_empty_headers_client/_null_and_empty_headers_client_output.rs

@@ -1,1 +100,181 @@
    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 NullAndEmptyHeadersClientOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct NullAndEmptyHeadersClientOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub a: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub b: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          18  +
    /* StructureGenerator.kt:201 */
   12     19   
}
          20  +
/* StructureGenerator.kt:135 */
   13     21   
impl NullAndEmptyHeadersClientOutput {
          22  +
    /* StructureGenerator.kt:231 */
   14     23   
    #[allow(missing_docs)] // documentation missing in model
          24  +
                           /* StructureGenerator.kt:166 */
   15     25   
    pub fn a(&self) -> ::std::option::Option<&str> {
          26  +
        /* StructureGenerator.kt:169 */
   16     27   
        self.a.as_deref()
          28  +
        /* StructureGenerator.kt:166 */
   17     29   
    }
          30  +
    /* StructureGenerator.kt:231 */
   18     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
                           /* StructureGenerator.kt:166 */
   19     33   
    pub fn b(&self) -> ::std::option::Option<&str> {
          34  +
        /* StructureGenerator.kt:169 */
   20     35   
        self.b.as_deref()
          36  +
        /* StructureGenerator.kt:166 */
   21     37   
    }
          38  +
    /* StructureGenerator.kt:231 */
   22     39   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          40  +
    /// /* StructureGenerator.kt:162 */
          41  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          42  +
    /* StructureGenerator.kt:166 */
   25     43   
    pub fn c(&self) -> &[::std::string::String] {
   26         -
        self.c.as_deref().unwrap_or_default()
          44  +
        /* StructureGenerator.kt:169 */
          45  +
        self.c
          46  +
            .as_deref()
          47  +
            /* StructureGenerator.kt:175 */
          48  +
            .unwrap_or_default()
          49  +
        /* StructureGenerator.kt:166 */
   27     50   
    }
          51  +
    /* StructureGenerator.kt:135 */
   28     52   
}
          53  +
/* ClientCodegenVisitor.kt:237 */
   29     54   
impl NullAndEmptyHeadersClientOutput {
   30         -
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
          55  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
          56  +
    /* BuilderGenerator.kt:175 */
   31     57   
    pub fn builder() -> crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientOutputBuilder {
          58  +
        /* BuilderGenerator.kt:176 */
   32     59   
        crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientOutputBuilder::default()
          60  +
        /* BuilderGenerator.kt:175 */
   33     61   
    }
          62  +
    /* ClientCodegenVisitor.kt:237 */
   34     63   
}
   35     64   
   36         -
/// A builder for [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
          65  +
/// /* BuilderGenerator.kt:342 */A builder for [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
          66  +
/* RustType.kt:516 */
   37     67   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          68  +
/* RustType.kt:516 */
   38     69   
#[non_exhaustive]
          70  +
/* BuilderGenerator.kt:345 */
   39     71   
pub struct NullAndEmptyHeadersClientOutputBuilder {
   40         -
    pub(crate) a: ::std::option::Option<::std::string::String>,
   41         -
    pub(crate) b: ::std::option::Option<::std::string::String>,
          72  +
    /* BuilderGenerator.kt:275 */ pub(crate) a: ::std::option::Option<::std::string::String>,
          73  +
    /* BuilderGenerator.kt:275 */ pub(crate) b: ::std::option::Option<::std::string::String>,
          74  +
    /* BuilderGenerator.kt:275 */
   42     75   
    pub(crate) c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          76  +
    /* BuilderGenerator.kt:345 */
   43     77   
}
          78  +
/* BuilderGenerator.kt:355 */
   44     79   
impl NullAndEmptyHeadersClientOutputBuilder {
          80  +
    /* BuilderGenerator.kt:286 */
   45     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:291 */
   46     83   
    pub fn a(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          84  +
        /* BuilderGenerator.kt:292 */
   47     85   
        self.a = ::std::option::Option::Some(input.into());
          86  +
        /* BuilderGenerator.kt:293 */
   48     87   
        self
          88  +
        /* BuilderGenerator.kt:291 */
   49     89   
    }
          90  +
    /* BuilderGenerator.kt:312 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:314 */
   51     93   
    pub fn set_a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          94  +
        /* BuilderGenerator.kt:315 */
   52     95   
        self.a = input;
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:314 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:334 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:336 */
   56    102   
    pub fn get_a(&self) -> &::std::option::Option<::std::string::String> {
         103  +
        /* BuilderGenerator.kt:337 */
   57    104   
        &self.a
         105  +
        /* BuilderGenerator.kt:336 */
   58    106   
    }
         107  +
    /* BuilderGenerator.kt:286 */
   59    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:291 */
   60    110   
    pub fn b(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         111  +
        /* BuilderGenerator.kt:292 */
   61    112   
        self.b = ::std::option::Option::Some(input.into());
         113  +
        /* BuilderGenerator.kt:293 */
   62    114   
        self
         115  +
        /* BuilderGenerator.kt:291 */
   63    116   
    }
         117  +
    /* BuilderGenerator.kt:312 */
   64    118   
    #[allow(missing_docs)] // documentation missing in model
         119  +
                           /* BuilderGenerator.kt:314 */
   65    120   
    pub fn set_b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        /* BuilderGenerator.kt:315 */
   66    122   
        self.b = input;
   67    123   
        self
         124  +
        /* BuilderGenerator.kt:314 */
   68    125   
    }
         126  +
    /* BuilderGenerator.kt:334 */
   69    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* BuilderGenerator.kt:336 */
   70    129   
    pub fn get_b(&self) -> &::std::option::Option<::std::string::String> {
         130  +
        /* BuilderGenerator.kt:337 */
   71    131   
        &self.b
         132  +
        /* BuilderGenerator.kt:336 */
   72    133   
    }
   73         -
    /// Appends an item to `c`.
         134  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `c`.
         135  +
    /* BuilderGenerator.kt:411 */
   74    136   
    ///
   75         -
    /// To override the contents of this collection use [`set_c`](Self::set_c).
         137  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_c`](Self::set_c).
         138  +
    /* BuilderGenerator.kt:413 */
   76    139   
    ///
         140  +
    /* BuilderGenerator.kt:418 */
   77    141   
    pub fn c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        /* BuilderGenerator.kt:419 */
   78    143   
        let mut v = self.c.unwrap_or_default();
   79    144   
        v.push(input.into());
   80    145   
        self.c = ::std::option::Option::Some(v);
   81    146   
        self
         147  +
        /* BuilderGenerator.kt:418 */
   82    148   
    }
         149  +
    /* BuilderGenerator.kt:312 */
   83    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* BuilderGenerator.kt:314 */
   84    152   
    pub fn set_c(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         153  +
        /* BuilderGenerator.kt:315 */
   85    154   
        self.c = input;
   86    155   
        self
         156  +
        /* BuilderGenerator.kt:314 */
   87    157   
    }
         158  +
    /* BuilderGenerator.kt:334 */
   88    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:336 */
   89    161   
    pub fn get_c(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         162  +
        /* BuilderGenerator.kt:337 */
   90    163   
        &self.c
         164  +
        /* BuilderGenerator.kt:336 */
   91    165   
    }
   92         -
    /// Consumes the builder and constructs a [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
         166  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NullAndEmptyHeadersClientOutput`](crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput).
         167  +
    /* BuilderGenerator.kt:253 */
   93    168   
    pub fn build(self) -> crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput {
         169  +
        /* BuilderGenerator.kt:477 */
   94    170   
        crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput {
   95         -
            a: self.a,
         171  +
            /* BuilderGenerator.kt:481 */ a: self.a,
         172  +
            /* BuilderGenerator.kt:481 */
   96    173   
            b: self.b,
         174  +
            /* BuilderGenerator.kt:481 */
   97    175   
            c: self.c,
         176  +
            /* BuilderGenerator.kt:477 */
   98    177   
        }
         178  +
        /* BuilderGenerator.kt:253 */
   99    179   
    }
         180  +
    /* BuilderGenerator.kt:355 */
  100    181   
}

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

@@ -1,1 +158,188 @@
    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::null_and_empty_headers_client::_null_and_empty_headers_client_output::NullAndEmptyHeadersClientOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::null_and_empty_headers_client::_null_and_empty_headers_client_input::NullAndEmptyHeadersClientInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientInputBuilder {
    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::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.null_and_empty_headers_client();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `NullAndEmptyHeadersClient`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `NullAndEmptyHeadersClient`.
   24     27   
///
   25         -
/// Null and empty headers are not sent over the wire.
          28  +
/// /* FluentBuilderGenerator.kt:130 */Null and empty headers are not sent over the wire.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct NullAndEmptyHeadersClientFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientInputBuilder,
   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::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
   35     41   
        crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   36     42   
    > for NullAndEmptyHeadersClientFluentBuilder
   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::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
   44     50   
            crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   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 NullAndEmptyHeadersClientFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `NullAndEmptyHeadersClientFluentBuilder`.
   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 NullAndEmptyHeadersClient as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::null_and_empty_headers_client::builders::NullAndEmptyHeadersClientInputBuilder {
   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::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   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::null_and_empty_headers_client::NullAndEmptyHeadersClient::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::null_and_empty_headers_client::NullAndEmptyHeadersClient::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::null_and_empty_headers_client::NullAndEmptyHeadersClientOutput,
   97    107   
        crate::operation::null_and_empty_headers_client::NullAndEmptyHeadersClientError,
   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 a(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.a(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_a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_a(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_a(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_a()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn b(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  127    146   
        self.inner = self.inner.b(input.into());
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  132    153   
        self.inner = self.inner.set_b(input);
  133    154   
        self
  134    155   
    }
         156  +
    /* FluentBuilderGenerator.kt:518 */
  135    157   
    #[allow(missing_docs)] // documentation missing in model
         158  +
                           /* FluentBuilderGenerator.kt:520 */
  136    159   
    pub fn get_b(&self) -> &::std::option::Option<::std::string::String> {
  137    160   
        self.inner.get_b()
  138    161   
    }
  139         -
    ///
         162  +
    /// /* FluentBuilderGenerator.kt:436 */
  140    163   
    /// Appends an item to `c`.
  141    164   
    ///
  142    165   
    /// To override the contents of this collection use [`set_c`](Self::set_c).
  143    166   
    ///
         167  +
    /* FluentBuilderGenerator.kt:443 */
  144    168   
    #[allow(missing_docs)] // documentation missing in model
         169  +
                           /* FluentBuilderGenerator.kt:446 */
  145    170   
    pub fn c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  146    171   
        self.inner = self.inner.c(input.into());
  147    172   
        self
  148    173   
    }
         174  +
    /* FluentBuilderGenerator.kt:498 */
  149    175   
    #[allow(missing_docs)] // documentation missing in model
         176  +
                           /* FluentBuilderGenerator.kt:500 */
  150    177   
    pub fn set_c(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  151    178   
        self.inner = self.inner.set_c(input);
  152    179   
        self
  153    180   
    }
         181  +
    /* FluentBuilderGenerator.kt:518 */
  154    182   
    #[allow(missing_docs)] // documentation missing in model
         183  +
                           /* FluentBuilderGenerator.kt:520 */
  155    184   
    pub fn get_c(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  156    185   
        self.inner.get_c()
  157    186   
    }
         187  +
    /* FluentBuilderGenerator.kt:282 */
  158    188   
}

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/null_and_empty_headers_server/_null_and_empty_headers_server_input.rs

@@ -1,1 +105,189 @@
    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 NullAndEmptyHeadersServerInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct NullAndEmptyHeadersServerInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub a: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub b: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          18  +
    /* StructureGenerator.kt:201 */
   12     19   
}
          20  +
/* StructureGenerator.kt:135 */
   13     21   
impl NullAndEmptyHeadersServerInput {
          22  +
    /* StructureGenerator.kt:231 */
   14     23   
    #[allow(missing_docs)] // documentation missing in model
          24  +
                           /* StructureGenerator.kt:166 */
   15     25   
    pub fn a(&self) -> ::std::option::Option<&str> {
          26  +
        /* StructureGenerator.kt:169 */
   16     27   
        self.a.as_deref()
          28  +
        /* StructureGenerator.kt:166 */
   17     29   
    }
          30  +
    /* StructureGenerator.kt:231 */
   18     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
                           /* StructureGenerator.kt:166 */
   19     33   
    pub fn b(&self) -> ::std::option::Option<&str> {
          34  +
        /* StructureGenerator.kt:169 */
   20     35   
        self.b.as_deref()
          36  +
        /* StructureGenerator.kt:166 */
   21     37   
    }
          38  +
    /* StructureGenerator.kt:231 */
   22     39   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          40  +
    /// /* StructureGenerator.kt:162 */
          41  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          42  +
    /* StructureGenerator.kt:166 */
   25     43   
    pub fn c(&self) -> &[::std::string::String] {
   26         -
        self.c.as_deref().unwrap_or_default()
          44  +
        /* StructureGenerator.kt:169 */
          45  +
        self.c
          46  +
            .as_deref()
          47  +
            /* StructureGenerator.kt:175 */
          48  +
            .unwrap_or_default()
          49  +
        /* StructureGenerator.kt:166 */
   27     50   
    }
          51  +
    /* StructureGenerator.kt:135 */
   28     52   
}
          53  +
/* ClientCodegenVisitor.kt:237 */
   29     54   
impl NullAndEmptyHeadersServerInput {
   30         -
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
          55  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
          56  +
    /* BuilderGenerator.kt:175 */
   31     57   
    pub fn builder() -> crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder {
          58  +
        /* BuilderGenerator.kt:176 */
   32     59   
        crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder::default()
          60  +
        /* BuilderGenerator.kt:175 */
   33     61   
    }
          62  +
    /* ClientCodegenVisitor.kt:237 */
   34     63   
}
   35     64   
   36         -
/// A builder for [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
          65  +
/// /* BuilderGenerator.kt:342 */A builder for [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
          66  +
/* RustType.kt:516 */
   37     67   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          68  +
/* RustType.kt:516 */
   38     69   
#[non_exhaustive]
          70  +
/* BuilderGenerator.kt:345 */
   39     71   
pub struct NullAndEmptyHeadersServerInputBuilder {
   40         -
    pub(crate) a: ::std::option::Option<::std::string::String>,
   41         -
    pub(crate) b: ::std::option::Option<::std::string::String>,
          72  +
    /* BuilderGenerator.kt:275 */ pub(crate) a: ::std::option::Option<::std::string::String>,
          73  +
    /* BuilderGenerator.kt:275 */ pub(crate) b: ::std::option::Option<::std::string::String>,
          74  +
    /* BuilderGenerator.kt:275 */
   42     75   
    pub(crate) c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          76  +
    /* BuilderGenerator.kt:345 */
   43     77   
}
          78  +
/* BuilderGenerator.kt:355 */
   44     79   
impl NullAndEmptyHeadersServerInputBuilder {
          80  +
    /* BuilderGenerator.kt:286 */
   45     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:291 */
   46     83   
    pub fn a(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          84  +
        /* BuilderGenerator.kt:292 */
   47     85   
        self.a = ::std::option::Option::Some(input.into());
          86  +
        /* BuilderGenerator.kt:293 */
   48     87   
        self
          88  +
        /* BuilderGenerator.kt:291 */
   49     89   
    }
          90  +
    /* BuilderGenerator.kt:312 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:314 */
   51     93   
    pub fn set_a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          94  +
        /* BuilderGenerator.kt:315 */
   52     95   
        self.a = input;
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:314 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:334 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:336 */
   56    102   
    pub fn get_a(&self) -> &::std::option::Option<::std::string::String> {
         103  +
        /* BuilderGenerator.kt:337 */
   57    104   
        &self.a
         105  +
        /* BuilderGenerator.kt:336 */
   58    106   
    }
         107  +
    /* BuilderGenerator.kt:286 */
   59    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:291 */
   60    110   
    pub fn b(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         111  +
        /* BuilderGenerator.kt:292 */
   61    112   
        self.b = ::std::option::Option::Some(input.into());
         113  +
        /* BuilderGenerator.kt:293 */
   62    114   
        self
         115  +
        /* BuilderGenerator.kt:291 */
   63    116   
    }
         117  +
    /* BuilderGenerator.kt:312 */
   64    118   
    #[allow(missing_docs)] // documentation missing in model
         119  +
                           /* BuilderGenerator.kt:314 */
   65    120   
    pub fn set_b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        /* BuilderGenerator.kt:315 */
   66    122   
        self.b = input;
   67    123   
        self
         124  +
        /* BuilderGenerator.kt:314 */
   68    125   
    }
         126  +
    /* BuilderGenerator.kt:334 */
   69    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* BuilderGenerator.kt:336 */
   70    129   
    pub fn get_b(&self) -> &::std::option::Option<::std::string::String> {
         130  +
        /* BuilderGenerator.kt:337 */
   71    131   
        &self.b
         132  +
        /* BuilderGenerator.kt:336 */
   72    133   
    }
   73         -
    /// Appends an item to `c`.
         134  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `c`.
         135  +
    /* BuilderGenerator.kt:411 */
   74    136   
    ///
   75         -
    /// To override the contents of this collection use [`set_c`](Self::set_c).
         137  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_c`](Self::set_c).
         138  +
    /* BuilderGenerator.kt:413 */
   76    139   
    ///
         140  +
    /* BuilderGenerator.kt:418 */
   77    141   
    pub fn c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        /* BuilderGenerator.kt:419 */
   78    143   
        let mut v = self.c.unwrap_or_default();
   79    144   
        v.push(input.into());
   80    145   
        self.c = ::std::option::Option::Some(v);
   81    146   
        self
         147  +
        /* BuilderGenerator.kt:418 */
   82    148   
    }
         149  +
    /* BuilderGenerator.kt:312 */
   83    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* BuilderGenerator.kt:314 */
   84    152   
    pub fn set_c(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         153  +
        /* BuilderGenerator.kt:315 */
   85    154   
        self.c = input;
   86    155   
        self
         156  +
        /* BuilderGenerator.kt:314 */
   87    157   
    }
         158  +
    /* BuilderGenerator.kt:334 */
   88    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:336 */
   89    161   
    pub fn get_c(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         162  +
        /* BuilderGenerator.kt:337 */
   90    163   
        &self.c
         164  +
        /* BuilderGenerator.kt:336 */
   91    165   
    }
   92         -
    /// Consumes the builder and constructs a [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
         166  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NullAndEmptyHeadersServerInput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput).
         167  +
    /* BuilderGenerator.kt:253 */
   93    168   
    pub fn build(
   94    169   
        self,
   95    170   
    ) -> ::std::result::Result<
   96    171   
        crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput,
   97    172   
        ::aws_smithy_types::error::operation::BuildError,
   98    173   
    > {
   99         -
        ::std::result::Result::Ok(crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput {
  100         -
            a: self.a,
  101         -
            b: self.b,
  102         -
            c: self.c,
  103         -
        })
         174  +
        /* BuilderGenerator.kt:254 */
         175  +
        ::std::result::Result::Ok(
         176  +
            /* BuilderGenerator.kt:477 */
         177  +
            crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerInput {
         178  +
                /* BuilderGenerator.kt:481 */ a: self.a,
         179  +
                /* BuilderGenerator.kt:481 */
         180  +
                b: self.b,
         181  +
                /* BuilderGenerator.kt:481 */
         182  +
                c: self.c,
         183  +
                /* BuilderGenerator.kt:477 */
         184  +
            }, /* BuilderGenerator.kt:254 */
         185  +
        )
         186  +
        /* BuilderGenerator.kt:253 */
  104    187   
    }
         188  +
    /* BuilderGenerator.kt:355 */
  105    189   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/null_and_empty_headers_server/_null_and_empty_headers_server_output.rs

@@ -1,1 +100,181 @@
    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 NullAndEmptyHeadersServerOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct NullAndEmptyHeadersServerOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub a: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub b: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          18  +
    /* StructureGenerator.kt:201 */
   12     19   
}
          20  +
/* StructureGenerator.kt:135 */
   13     21   
impl NullAndEmptyHeadersServerOutput {
          22  +
    /* StructureGenerator.kt:231 */
   14     23   
    #[allow(missing_docs)] // documentation missing in model
          24  +
                           /* StructureGenerator.kt:166 */
   15     25   
    pub fn a(&self) -> ::std::option::Option<&str> {
          26  +
        /* StructureGenerator.kt:169 */
   16     27   
        self.a.as_deref()
          28  +
        /* StructureGenerator.kt:166 */
   17     29   
    }
          30  +
    /* StructureGenerator.kt:231 */
   18     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
                           /* StructureGenerator.kt:166 */
   19     33   
    pub fn b(&self) -> ::std::option::Option<&str> {
          34  +
        /* StructureGenerator.kt:169 */
   20     35   
        self.b.as_deref()
          36  +
        /* StructureGenerator.kt:166 */
   21     37   
    }
          38  +
    /* StructureGenerator.kt:231 */
   22     39   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          40  +
    /// /* StructureGenerator.kt:162 */
          41  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.c.is_none()`.
          42  +
    /* StructureGenerator.kt:166 */
   25     43   
    pub fn c(&self) -> &[::std::string::String] {
   26         -
        self.c.as_deref().unwrap_or_default()
          44  +
        /* StructureGenerator.kt:169 */
          45  +
        self.c
          46  +
            .as_deref()
          47  +
            /* StructureGenerator.kt:175 */
          48  +
            .unwrap_or_default()
          49  +
        /* StructureGenerator.kt:166 */
   27     50   
    }
          51  +
    /* StructureGenerator.kt:135 */
   28     52   
}
          53  +
/* ClientCodegenVisitor.kt:237 */
   29     54   
impl NullAndEmptyHeadersServerOutput {
   30         -
    /// Creates a new builder-style object to manufacture [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
          55  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
          56  +
    /* BuilderGenerator.kt:175 */
   31     57   
    pub fn builder() -> crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerOutputBuilder {
          58  +
        /* BuilderGenerator.kt:176 */
   32     59   
        crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerOutputBuilder::default()
          60  +
        /* BuilderGenerator.kt:175 */
   33     61   
    }
          62  +
    /* ClientCodegenVisitor.kt:237 */
   34     63   
}
   35     64   
   36         -
/// A builder for [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
          65  +
/// /* BuilderGenerator.kt:342 */A builder for [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
          66  +
/* RustType.kt:516 */
   37     67   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          68  +
/* RustType.kt:516 */
   38     69   
#[non_exhaustive]
          70  +
/* BuilderGenerator.kt:345 */
   39     71   
pub struct NullAndEmptyHeadersServerOutputBuilder {
   40         -
    pub(crate) a: ::std::option::Option<::std::string::String>,
   41         -
    pub(crate) b: ::std::option::Option<::std::string::String>,
          72  +
    /* BuilderGenerator.kt:275 */ pub(crate) a: ::std::option::Option<::std::string::String>,
          73  +
    /* BuilderGenerator.kt:275 */ pub(crate) b: ::std::option::Option<::std::string::String>,
          74  +
    /* BuilderGenerator.kt:275 */
   42     75   
    pub(crate) c: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          76  +
    /* BuilderGenerator.kt:345 */
   43     77   
}
          78  +
/* BuilderGenerator.kt:355 */
   44     79   
impl NullAndEmptyHeadersServerOutputBuilder {
          80  +
    /* BuilderGenerator.kt:286 */
   45     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:291 */
   46     83   
    pub fn a(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          84  +
        /* BuilderGenerator.kt:292 */
   47     85   
        self.a = ::std::option::Option::Some(input.into());
          86  +
        /* BuilderGenerator.kt:293 */
   48     87   
        self
          88  +
        /* BuilderGenerator.kt:291 */
   49     89   
    }
          90  +
    /* BuilderGenerator.kt:312 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:314 */
   51     93   
    pub fn set_a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          94  +
        /* BuilderGenerator.kt:315 */
   52     95   
        self.a = input;
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:314 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:334 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:336 */
   56    102   
    pub fn get_a(&self) -> &::std::option::Option<::std::string::String> {
         103  +
        /* BuilderGenerator.kt:337 */
   57    104   
        &self.a
         105  +
        /* BuilderGenerator.kt:336 */
   58    106   
    }
         107  +
    /* BuilderGenerator.kt:286 */
   59    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:291 */
   60    110   
    pub fn b(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         111  +
        /* BuilderGenerator.kt:292 */
   61    112   
        self.b = ::std::option::Option::Some(input.into());
         113  +
        /* BuilderGenerator.kt:293 */
   62    114   
        self
         115  +
        /* BuilderGenerator.kt:291 */
   63    116   
    }
         117  +
    /* BuilderGenerator.kt:312 */
   64    118   
    #[allow(missing_docs)] // documentation missing in model
         119  +
                           /* BuilderGenerator.kt:314 */
   65    120   
    pub fn set_b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        /* BuilderGenerator.kt:315 */
   66    122   
        self.b = input;
   67    123   
        self
         124  +
        /* BuilderGenerator.kt:314 */
   68    125   
    }
         126  +
    /* BuilderGenerator.kt:334 */
   69    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* BuilderGenerator.kt:336 */
   70    129   
    pub fn get_b(&self) -> &::std::option::Option<::std::string::String> {
         130  +
        /* BuilderGenerator.kt:337 */
   71    131   
        &self.b
         132  +
        /* BuilderGenerator.kt:336 */
   72    133   
    }
   73         -
    /// Appends an item to `c`.
         134  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `c`.
         135  +
    /* BuilderGenerator.kt:411 */
   74    136   
    ///
   75         -
    /// To override the contents of this collection use [`set_c`](Self::set_c).
         137  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_c`](Self::set_c).
         138  +
    /* BuilderGenerator.kt:413 */
   76    139   
    ///
         140  +
    /* BuilderGenerator.kt:418 */
   77    141   
    pub fn c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        /* BuilderGenerator.kt:419 */
   78    143   
        let mut v = self.c.unwrap_or_default();
   79    144   
        v.push(input.into());
   80    145   
        self.c = ::std::option::Option::Some(v);
   81    146   
        self
         147  +
        /* BuilderGenerator.kt:418 */
   82    148   
    }
         149  +
    /* BuilderGenerator.kt:312 */
   83    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* BuilderGenerator.kt:314 */
   84    152   
    pub fn set_c(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         153  +
        /* BuilderGenerator.kt:315 */
   85    154   
        self.c = input;
   86    155   
        self
         156  +
        /* BuilderGenerator.kt:314 */
   87    157   
    }
         158  +
    /* BuilderGenerator.kt:334 */
   88    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:336 */
   89    161   
    pub fn get_c(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         162  +
        /* BuilderGenerator.kt:337 */
   90    163   
        &self.c
         164  +
        /* BuilderGenerator.kt:336 */
   91    165   
    }
   92         -
    /// Consumes the builder and constructs a [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
         166  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NullAndEmptyHeadersServerOutput`](crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput).
         167  +
    /* BuilderGenerator.kt:253 */
   93    168   
    pub fn build(self) -> crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput {
         169  +
        /* BuilderGenerator.kt:477 */
   94    170   
        crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput {
   95         -
            a: self.a,
         171  +
            /* BuilderGenerator.kt:481 */ a: self.a,
         172  +
            /* BuilderGenerator.kt:481 */
   96    173   
            b: self.b,
         174  +
            /* BuilderGenerator.kt:481 */
   97    175   
            c: self.c,
         176  +
            /* BuilderGenerator.kt:477 */
   98    177   
        }
         178  +
        /* BuilderGenerator.kt:253 */
   99    179   
    }
         180  +
    /* BuilderGenerator.kt:355 */
  100    181   
}

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

@@ -1,1 +158,188 @@
    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::null_and_empty_headers_server::_null_and_empty_headers_server_output::NullAndEmptyHeadersServerOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::null_and_empty_headers_server::_null_and_empty_headers_server_input::NullAndEmptyHeadersServerInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder {
    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::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.null_and_empty_headers_server();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `NullAndEmptyHeadersServer`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `NullAndEmptyHeadersServer`.
   24     27   
///
   25         -
/// Null and empty headers are not sent over the wire.
          28  +
/// /* FluentBuilderGenerator.kt:130 */Null and empty headers are not sent over the wire.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct NullAndEmptyHeadersServerFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder,
   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::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
   35     41   
        crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   36     42   
    > for NullAndEmptyHeadersServerFluentBuilder
   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::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
   44     50   
            crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   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 NullAndEmptyHeadersServerFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `NullAndEmptyHeadersServerFluentBuilder`.
   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 NullAndEmptyHeadersServer as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::null_and_empty_headers_server::builders::NullAndEmptyHeadersServerInputBuilder {
   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::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   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::null_and_empty_headers_server::NullAndEmptyHeadersServer::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::null_and_empty_headers_server::NullAndEmptyHeadersServer::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::null_and_empty_headers_server::NullAndEmptyHeadersServerOutput,
   97    107   
        crate::operation::null_and_empty_headers_server::NullAndEmptyHeadersServerError,
   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 a(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.a(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_a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_a(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_a(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_a()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn b(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  127    146   
        self.inner = self.inner.b(input.into());
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  132    153   
        self.inner = self.inner.set_b(input);
  133    154   
        self
  134    155   
    }
         156  +
    /* FluentBuilderGenerator.kt:518 */
  135    157   
    #[allow(missing_docs)] // documentation missing in model
         158  +
                           /* FluentBuilderGenerator.kt:520 */
  136    159   
    pub fn get_b(&self) -> &::std::option::Option<::std::string::String> {
  137    160   
        self.inner.get_b()
  138    161   
    }
  139         -
    ///
         162  +
    /// /* FluentBuilderGenerator.kt:436 */
  140    163   
    /// Appends an item to `c`.
  141    164   
    ///
  142    165   
    /// To override the contents of this collection use [`set_c`](Self::set_c).
  143    166   
    ///
         167  +
    /* FluentBuilderGenerator.kt:443 */
  144    168   
    #[allow(missing_docs)] // documentation missing in model
         169  +
                           /* FluentBuilderGenerator.kt:446 */
  145    170   
    pub fn c(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  146    171   
        self.inner = self.inner.c(input.into());
  147    172   
        self
  148    173   
    }
         174  +
    /* FluentBuilderGenerator.kt:498 */
  149    175   
    #[allow(missing_docs)] // documentation missing in model
         176  +
                           /* FluentBuilderGenerator.kt:500 */
  150    177   
    pub fn set_c(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  151    178   
        self.inner = self.inner.set_c(input);
  152    179   
        self
  153    180   
    }
         181  +
    /* FluentBuilderGenerator.kt:518 */
  154    182   
    #[allow(missing_docs)] // documentation missing in model
         183  +
                           /* FluentBuilderGenerator.kt:520 */
  155    184   
    pub fn get_c(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  156    185   
        self.inner.get_c()
  157    186   
    }
         187  +
    /* FluentBuilderGenerator.kt:282 */
  158    188   
}

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/omits_null_serializes_empty_string/_omits_null_serializes_empty_string_input.rs

@@ -1,1 +78,137 @@
    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 OmitsNullSerializesEmptyStringInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct OmitsNullSerializesEmptyStringInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub null_value: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub empty_string: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl OmitsNullSerializesEmptyStringInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn null_value(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.null_value.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 empty_string(&self) -> ::std::option::Option<&str> {
          31  +
        /* StructureGenerator.kt:169 */
   18     32   
        self.empty_string.as_deref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl OmitsNullSerializesEmptyStringInput {
   22         -
    /// Creates a new builder-style object to manufacture [`OmitsNullSerializesEmptyStringInput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`OmitsNullSerializesEmptyStringInput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`OmitsNullSerializesEmptyStringInput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`OmitsNullSerializesEmptyStringInput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput).
          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 OmitsNullSerializesEmptyStringInputBuilder {
   32         -
    pub(crate) null_value: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) empty_string: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) null_value: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) empty_string: ::std::option::Option<::std::string::String>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl OmitsNullSerializesEmptyStringInputBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn null_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.null_value = ::std::option::Option::Some(input.into());
          68  +
        /* BuilderGenerator.kt:293 */
   39     69   
        self
          70  +
        /* BuilderGenerator.kt:291 */
   40     71   
    }
          72  +
    /* BuilderGenerator.kt:312 */
   41     73   
    #[allow(missing_docs)] // documentation missing in model
          74  +
                           /* BuilderGenerator.kt:314 */
   42     75   
    pub fn set_null_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.null_value = input;
   44     78   
        self
          79  +
        /* BuilderGenerator.kt:314 */
   45     80   
    }
          81  +
    /* BuilderGenerator.kt:334 */
   46     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:336 */
   47     84   
    pub fn get_null_value(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.null_value
          87  +
        /* BuilderGenerator.kt:336 */
   49     88   
    }
          89  +
    /* BuilderGenerator.kt:286 */
   50     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:291 */
   51     92   
    pub fn empty_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.empty_string = ::std::option::Option::Some(input.into());
          95  +
        /* BuilderGenerator.kt:293 */
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:291 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:312 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:314 */
   56    102   
    pub fn set_empty_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.empty_string = input;
   58    105   
        self
         106  +
        /* BuilderGenerator.kt:314 */
   59    107   
    }
         108  +
    /* BuilderGenerator.kt:334 */
   60    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:336 */
   61    111   
    pub fn get_empty_string(&self) -> &::std::option::Option<::std::string::String> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.empty_string
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`OmitsNullSerializesEmptyStringInput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`OmitsNullSerializesEmptyStringInput`](crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(
   66    119   
        self,
   67    120   
    ) -> ::std::result::Result<
   68    121   
        crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput,
   69    122   
        ::aws_smithy_types::error::operation::BuildError,
   70    123   
    > {
         124  +
        /* BuilderGenerator.kt:254 */
   71    125   
        ::std::result::Result::Ok(
         126  +
            /* BuilderGenerator.kt:477 */
   72    127   
            crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringInput {
   73         -
                null_value: self.null_value,
         128  +
                /* BuilderGenerator.kt:481 */ null_value: self.null_value,
         129  +
                /* BuilderGenerator.kt:481 */
   74    130   
                empty_string: self.empty_string,
   75         -
            },
         131  +
                /* BuilderGenerator.kt:477 */
         132  +
            }, /* BuilderGenerator.kt:254 */
   76    133   
        )
         134  +
        /* BuilderGenerator.kt:253 */
   77    135   
    }
         136  +
    /* BuilderGenerator.kt:355 */
   78    137   
}

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

@@ -1,1 +139,163 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::omits_null_serializes_empty_string::_omits_null_serializes_empty_string_output::OmitsNullSerializesEmptyStringOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::omits_null_serializes_empty_string::_omits_null_serializes_empty_string_input::OmitsNullSerializesEmptyStringInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringInputBuilder {
    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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.omits_null_serializes_empty_string();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `OmitsNullSerializesEmptyString`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `OmitsNullSerializesEmptyString`.
   24     27   
///
   25         -
/// Omits null, but serializes empty string value.
          28  +
/// /* FluentBuilderGenerator.kt:130 */Omits null, but serializes empty string value.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct OmitsNullSerializesEmptyStringFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringInputBuilder,
   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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
   35     41   
        crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   36     42   
    > for OmitsNullSerializesEmptyStringFluentBuilder
   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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
   44     50   
            crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   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 OmitsNullSerializesEmptyStringFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `OmitsNullSerializesEmptyStringFluentBuilder`.
   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 OmitsNullSerializesEmptyString as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::omits_null_serializes_empty_string::builders::OmitsNullSerializesEmptyStringInputBuilder {
   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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyString::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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyString::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::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringOutput,
   97    107   
        crate::operation::omits_null_serializes_empty_string::OmitsNullSerializesEmptyStringError,
   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 null_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.null_value(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_null_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_null_value(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_null_value(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_null_value()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn empty_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  127    146   
        self.inner = self.inner.empty_string(input.into());
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_empty_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  132    153   
        self.inner = self.inner.set_empty_string(input);
  133    154   
        self
  134    155   
    }
         156  +
    /* FluentBuilderGenerator.kt:518 */
  135    157   
    #[allow(missing_docs)] // documentation missing in model
         158  +
                           /* FluentBuilderGenerator.kt:520 */
  136    159   
    pub fn get_empty_string(&self) -> &::std::option::Option<::std::string::String> {
  137    160   
        self.inner.get_empty_string()
  138    161   
    }
         162  +
    /* FluentBuilderGenerator.kt:282 */
  139    163   
}

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