Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits/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::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_payload_traits::_http_payload_traits_input::HttpPayloadTraitsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder {
    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::http_payload_traits::HttpPayloadTraitsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_payload_traits();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpPayloadTraits`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpPayloadTraits`.
   24     27   
///
   25         -
/// This example serializes a blob shape in the payload. In this example, no JSON document is synthesized because the payload is not a structure or a union type.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example serializes a blob shape in the payload. In this example, no JSON document is synthesized because the payload is not a structure or a union type.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct HttpPayloadTraitsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder,
   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::http_payload_traits::HttpPayloadTraitsOutput,
   35     41   
        crate::operation::http_payload_traits::HttpPayloadTraitsError,
   36     42   
    > for HttpPayloadTraitsFluentBuilder
   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::http_payload_traits::HttpPayloadTraitsOutput,
   44     50   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   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 HttpPayloadTraitsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `HttpPayloadTraitsFluentBuilder`.
   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 HttpPayloadTraits as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder {
   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::http_payload_traits::HttpPayloadTraitsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   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::http_payload_traits::HttpPayloadTraits::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::http_payload_traits::HttpPayloadTraits::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::http_payload_traits::HttpPayloadTraitsOutput,
   97    107   
        crate::operation::http_payload_traits::HttpPayloadTraitsError,
   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 foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.foo(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_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_foo(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_foo(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_foo()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
  127    146   
        self.inner = self.inner.blob(input);
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  132    153   
        self.inner = self.inner.set_blob(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_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  137    160   
        self.inner.get_blob()
  138    161   
    }
         162  +
    /* FluentBuilderGenerator.kt:282 */
  139    163   
}

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits_with_media_type/_http_payload_traits_with_media_type_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 HttpPayloadTraitsWithMediaTypeInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct HttpPayloadTraitsWithMediaTypeInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl HttpPayloadTraitsWithMediaTypeInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
          31  +
        /* StructureGenerator.kt:170 */
   18     32   
        self.blob.as_ref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl HttpPayloadTraitsWithMediaTypeInput {
   22         -
    /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
          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 HttpPayloadTraitsWithMediaTypeInputBuilder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl HttpPayloadTraitsWithMediaTypeInputBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.foo = ::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_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.foo = 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_foo(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.foo
          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 blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.blob = ::std::option::Option::Some(input);
          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_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.blob = 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_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.blob
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(
   66    119   
        self,
   67    120   
    ) -> ::std::result::Result<
   68    121   
        crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput,
   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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput {
   73         -
                foo: self.foo,
         128  +
                /* BuilderGenerator.kt:481 */ foo: self.foo,
         129  +
                /* BuilderGenerator.kt:481 */
   74    130   
                blob: self.blob,
   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/http_payload_traits_with_media_type/_http_payload_traits_with_media_type_output.rs

@@ -1,1 +71,129 @@
    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 HttpPayloadTraitsWithMediaTypeOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct HttpPayloadTraitsWithMediaTypeOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl HttpPayloadTraitsWithMediaTypeOutput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
          31  +
        /* StructureGenerator.kt:170 */
   18     32   
        self.blob.as_ref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl HttpPayloadTraitsWithMediaTypeOutput {
   22         -
    /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeOutputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeOutputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
          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 HttpPayloadTraitsWithMediaTypeOutputBuilder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl HttpPayloadTraitsWithMediaTypeOutputBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.foo = ::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_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.foo = 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_foo(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.foo
          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 blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.blob = ::std::option::Option::Some(input);
          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_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.blob = 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_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.blob
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`HttpPayloadTraitsWithMediaTypeOutput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(self) -> crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput {
         119  +
        /* BuilderGenerator.kt:477 */
   66    120   
        crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput {
   67         -
            foo: self.foo,
         121  +
            /* BuilderGenerator.kt:481 */ foo: self.foo,
         122  +
            /* BuilderGenerator.kt:481 */
   68    123   
            blob: self.blob,
         124  +
            /* BuilderGenerator.kt:477 */
   69    125   
        }
         126  +
        /* BuilderGenerator.kt:253 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:355 */
   71    129   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits_with_media_type/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::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_output::HttpPayloadTraitsWithMediaTypeOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_input::HttpPayloadTraitsWithMediaTypeInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder {
    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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_payload_traits_with_media_type();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpPayloadTraitsWithMediaType`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpPayloadTraitsWithMediaType`.
   24     27   
///
   25         -
/// This example uses a `@mediaType` trait on the payload to force a custom content-type to be serialized.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example uses a `@mediaType` trait on the payload to force a custom content-type to be serialized.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct HttpPayloadTraitsWithMediaTypeFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder,
   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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   35     41   
        crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   36     42   
    > for HttpPayloadTraitsWithMediaTypeFluentBuilder
   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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   44     50   
            crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   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 HttpPayloadTraitsWithMediaTypeFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `HttpPayloadTraitsWithMediaTypeFluentBuilder`.
   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 HttpPayloadTraitsWithMediaType as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder {
   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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaType::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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaType::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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   97    107   
        crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   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 foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.foo(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_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_foo(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_foo(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_foo()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
  127    146   
        self.inner = self.inner.blob(input);
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  132    153   
        self.inner = self.inner.set_blob(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_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  137    160   
        self.inner.get_blob()
  138    161   
    }
         162  +
    /* FluentBuilderGenerator.kt:282 */
  139    163   
}

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

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

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

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

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

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

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_output::HttpPayloadWithStructureOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_input::HttpPayloadWithStructureInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureInputBuilder {
    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::http_payload_with_structure::HttpPayloadWithStructureOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_payload_with_structure();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpPayloadWithStructure`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpPayloadWithStructure`.
   24     27   
///
   25         -
/// This example serializes a structure in the payload. Note that serializing a structure changes the wrapper element name to match the targeted structure.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example serializes a structure in the payload. Note that serializing a structure changes the wrapper element name to match the targeted structure.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct HttpPayloadWithStructureFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureInputBuilder,
   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::http_payload_with_structure::HttpPayloadWithStructureOutput,
   35     41   
        crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   36     42   
    > for HttpPayloadWithStructureFluentBuilder
   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::http_payload_with_structure::HttpPayloadWithStructureOutput,
   44     50   
            crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   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 HttpPayloadWithStructureFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `HttpPayloadWithStructureFluentBuilder`.
   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 HttpPayloadWithStructure as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureInputBuilder {
   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::http_payload_with_structure::HttpPayloadWithStructureOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   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::http_payload_with_structure::HttpPayloadWithStructure::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::http_payload_with_structure::HttpPayloadWithStructure::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::http_payload_with_structure::HttpPayloadWithStructureOutput,
   97    107   
        crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   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 nested(mut self, input: crate::types::NestedPayload) -> Self {
  113    126   
        self.inner = self.inner.nested(input);
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_nested(mut self, input: ::std::option::Option<crate::types::NestedPayload>) -> Self {
  118    133   
        self.inner = self.inner.set_nested(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_nested(&self) -> &::std::option::Option<crate::types::NestedPayload> {
  123    140   
        self.inner.get_nested()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `HttpPayloadWithUnion`.
           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 HttpPayloadWithUnion;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl HttpPayloadWithUnion {
    7         -
    /// Creates a new `HttpPayloadWithUnion`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `HttpPayloadWithUnion`
          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::http_payload_with_union::HttpPayloadWithUnionInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +271,288 @@
   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 HttpPayloadWithUnion {
   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("HttpPayloadWithUnion");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            HttpPayloadWithUnionRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            HttpPayloadWithUnionResponseDeserializer,
  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   
            "HttpPayloadWithUnion",
  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("HttpPayloadWithUnion")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(HttpPayloadWithUnionEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
  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 HttpPayloadWithUnionResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadWithUnionResponseDeserializer {
  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_http_payload_with_union::de_http_payload_with_union_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_http_payload_with_union::de_http_payload_with_union_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 HttpPayloadWithUnionRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpPayloadWithUnionRequestSerializer {
  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::http_payload_with_union::HttpPayloadWithUnionInput>()
  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::http_payload_with_union::HttpPayloadWithUnionInput,
  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, "/HttpPayloadWithUnion").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::http_payload_with_union::HttpPayloadWithUnionInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_http_payload_with_union_input::ser_nested_http_payload(
  196    209   
            &input.nested,
  197    210   
        )?);
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct HttpPayloadWithUnionEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpPayloadWithUnionEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "HttpPayloadWithUnionEndpointParamsInterceptor"
  211    225   
    }
  212    226   
  213    227   
    fn read_before_execution(
  214    228   
        &self,
  215    229   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  216    230   
            '_,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  220    234   
        >,
  221    235   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  222    236   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  223    237   
        let _input = context
  224    238   
            .input()
  225    239   
            .downcast_ref::<HttpPayloadWithUnionInput>()
  226    240   
            .ok_or("failed to downcast to HttpPayloadWithUnionInput")?;
  227    241   
  228    242   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  229    243   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  230    244   
        })?;
  231    245   
        cfg.interceptor_state()
  232    246   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  233    247   
        ::std::result::Result::Ok(())
  234    248   
    }
  235    249   
}
  236    250   
  237    251   
// The get_* functions below are generated from JMESPath expressions in the
  238    252   
// operationContextParams trait. They target the operation's input shape.
  239    253   
         254  +
/* RustType.kt:516 */
  240    255   
#[allow(unreachable_code, unused_variables)]
         256  +
/* RustType.kt:516 */
  241    257   
#[cfg(test)]
         258  +
/* ProtocolTestGenerator.kt:98 */
  242    259   
mod http_payload_with_union_test {
  243    260   
  244    261   
    /// Serializes a union in the payload.
  245    262   
    /// Test ID: RestJsonHttpPayloadWithUnion
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn rest_json_http_payload_with_union_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
@@ -346,363 +475,551 @@
  366    383   
                )))
  367    384   
            });
  368    385   
            de.deserialize_nonstreaming(&http_response)
  369    386   
        });
  370    387   
        let parsed = parsed
  371    388   
            .expect("should be successful response")
  372    389   
            .downcast::<crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput>()
  373    390   
            .unwrap();
  374    391   
        ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  375    392   
    }
         393  +
         394  +
    /* ProtocolTestGenerator.kt:98 */
  376    395   
}
  377    396   
         397  +
/* OperationErrorGenerator.kt:79 */
  378    398   
/// Error type for the `HttpPayloadWithUnionError` operation.
         399  +
/* RustType.kt:516 */
  379    400   
#[non_exhaustive]
         401  +
/* RustType.kt:516 */
  380    402   
#[derive(::std::fmt::Debug)]
  381         -
pub enum HttpPayloadWithUnionError {
         403  +
pub /* OperationErrorGenerator.kt:81 */ enum HttpPayloadWithUnionError {
         404  +
    /* OperationErrorGenerator.kt:88 */
  382    405   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  383    406   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  384    407   
    variable wildcard pattern and check `.code()`:
  385    408   
     \
  386    409   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  387    410   
     \
  388    411   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpPayloadWithUnionError) for what information is available for the error.")]
  389    412   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         413  +
    /* OperationErrorGenerator.kt:81 */
  390    414   
}
         415  +
/* OperationErrorGenerator.kt:218 */
  391    416   
impl HttpPayloadWithUnionError {
         417  +
    /* OperationErrorGenerator.kt:219 */
  392    418   
    /// Creates the `HttpPayloadWithUnionError::Unhandled` variant from any error type.
  393    419   
    pub fn unhandled(
  394    420   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  395    421   
    ) -> Self {
  396    422   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  397    423   
            source: err.into(),
  398    424   
            meta: ::std::default::Default::default(),
  399    425   
        })
  400    426   
    }
  401    427   
  402    428   
    /// Creates the `HttpPayloadWithUnionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  403    429   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  404    430   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  405    431   
            source: err.clone().into(),
  406    432   
            meta: err,
  407    433   
        })
  408    434   
    }
  409         -
    ///
         435  +
    /// /* OperationErrorGenerator.kt:236 */
  410    436   
    /// Returns error metadata, which includes the error code, message,
  411    437   
    /// request ID, and potentially additional information.
  412    438   
    ///
         439  +
    /* OperationErrorGenerator.kt:242 */
  413    440   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         441  +
        /* OperationErrorGenerator.kt:243 */
  414    442   
        match self {
  415         -
            Self::Unhandled(e) => &e.meta,
         443  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         444  +
            /* OperationErrorGenerator.kt:243 */
  416    445   
        }
         446  +
        /* OperationErrorGenerator.kt:242 */
  417    447   
    }
         448  +
    /* OperationErrorGenerator.kt:218 */
  418    449   
}
         450  +
/* OperationErrorGenerator.kt:269 */
  419    451   
impl ::std::error::Error for HttpPayloadWithUnionError {
         452  +
    /* OperationErrorGenerator.kt:270 */
  420    453   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         454  +
        /* OperationErrorGenerator.kt:318 */
  421    455   
        match self {
  422         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         456  +
            /* OperationErrorGenerator.kt:326 */
         457  +
            Self::Unhandled(_inner) => {
         458  +
                /* OperationErrorGenerator.kt:279 */
         459  +
                ::std::option::Option::Some(&*_inner.source)
         460  +
                /* OperationErrorGenerator.kt:326 */
         461  +
            } /* OperationErrorGenerator.kt:318 */
  423    462   
        }
         463  +
        /* OperationErrorGenerator.kt:270 */
  424    464   
    }
         465  +
    /* OperationErrorGenerator.kt:269 */
  425    466   
}
         467  +
/* OperationErrorGenerator.kt:133 */
  426    468   
impl ::std::fmt::Display for HttpPayloadWithUnionError {
         469  +
    /* OperationErrorGenerator.kt:134 */
  427    470   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         471  +
        /* OperationErrorGenerator.kt:318 */
  428    472   
        match self {
         473  +
            /* OperationErrorGenerator.kt:326 */
  429    474   
            Self::Unhandled(_inner) => {
         475  +
                /* OperationErrorGenerator.kt:139 */
  430    476   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  431    477   
                    write!(f, "unhandled error ({code})")
  432    478   
                } else {
  433    479   
                    f.write_str("unhandled error")
  434    480   
                }
  435         -
            }
         481  +
                /* OperationErrorGenerator.kt:326 */
         482  +
            } /* OperationErrorGenerator.kt:318 */
  436    483   
        }
         484  +
        /* OperationErrorGenerator.kt:134 */
  437    485   
    }
         486  +
    /* OperationErrorGenerator.kt:133 */
  438    487   
}
         488  +
/* OperationErrorGenerator.kt:182 */
  439    489   
impl ::aws_smithy_types::retry::ProvideErrorKind for HttpPayloadWithUnionError {
         490  +
    /* OperationErrorGenerator.kt:186 */
  440    491   
    fn code(&self) -> ::std::option::Option<&str> {
         492  +
        /* OperationErrorGenerator.kt:187 */
  441    493   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         494  +
        /* OperationErrorGenerator.kt:186 */
  442    495   
    }
         496  +
    /* OperationErrorGenerator.kt:190 */
  443    497   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         498  +
        /* OperationErrorGenerator.kt:197 */
  444    499   
        ::std::option::Option::None
         500  +
        /* OperationErrorGenerator.kt:190 */
  445    501   
    }
         502  +
    /* OperationErrorGenerator.kt:182 */
  446    503   
}
         504  +
/* OperationErrorGenerator.kt:163 */
  447    505   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpPayloadWithUnionError {
         506  +
    /* OperationErrorGenerator.kt:164 */
  448    507   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         508  +
        /* OperationErrorGenerator.kt:318 */
  449    509   
        match self {
  450         -
            Self::Unhandled(_inner) => &_inner.meta,
         510  +
            /* OperationErrorGenerator.kt:326 */
         511  +
            Self::Unhandled(_inner) => {
         512  +
                /* OperationErrorGenerator.kt:168 */
         513  +
                &_inner.meta
         514  +
                /* OperationErrorGenerator.kt:326 */
         515  +
            } /* OperationErrorGenerator.kt:318 */
  451    516   
        }
         517  +
        /* OperationErrorGenerator.kt:164 */
  452    518   
    }
         519  +
    /* OperationErrorGenerator.kt:163 */
  453    520   
}
         521  +
/* OperationErrorGenerator.kt:109 */
  454    522   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpPayloadWithUnionError {
         523  +
    /* OperationErrorGenerator.kt:110 */
  455    524   
    fn create_unhandled_error(
  456    525   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  457    526   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  458    527   
    ) -> Self {
         528  +
        /* OperationErrorGenerator.kt:121 */
  459    529   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  460    530   
            source,
  461    531   
            meta: meta.unwrap_or_default(),
  462    532   
        })
         533  +
        /* OperationErrorGenerator.kt:110 */
  463    534   
    }
         535  +
    /* OperationErrorGenerator.kt:109 */
  464    536   
}
  465    537   
         538  +
/* CodegenDelegator.kt:255 */
  466    539   
pub use crate::operation::http_payload_with_union::_http_payload_with_union_output::HttpPayloadWithUnionOutput;
  467    540   
         541  +
/* CodegenDelegator.kt:255 */
  468    542   
pub use crate::operation::http_payload_with_union::_http_payload_with_union_input::HttpPayloadWithUnionInput;
  469    543   
         544  +
/* RustModule.kt:172 */
  470    545   
mod _http_payload_with_union_input;
  471    546   
         547  +
/* RustModule.kt:172 */
  472    548   
mod _http_payload_with_union_output;
  473    549   
  474         -
/// Builders
         550  +
/// /* CodegenDelegator.kt:51 */Builders
  475    551   
pub mod builders;

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

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

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

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

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

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::http_payload_with_union::_http_payload_with_union_output::HttpPayloadWithUnionOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_payload_with_union::_http_payload_with_union_input::HttpPayloadWithUnionInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionInputBuilder {
    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::http_payload_with_union::HttpPayloadWithUnionOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_payload_with_union();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpPayloadWithUnion`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpPayloadWithUnion`.
   24     27   
///
   25         -
/// This example serializes a union in the payload.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example serializes a union in the payload.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct HttpPayloadWithUnionFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionInputBuilder,
   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::http_payload_with_union::HttpPayloadWithUnionOutput,
   35     41   
        crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   36     42   
    > for HttpPayloadWithUnionFluentBuilder
   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::http_payload_with_union::HttpPayloadWithUnionOutput,
   44     50   
            crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   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 HttpPayloadWithUnionFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `HttpPayloadWithUnionFluentBuilder`.
   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 HttpPayloadWithUnion as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionInputBuilder {
   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::http_payload_with_union::HttpPayloadWithUnionOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   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::http_payload_with_union::HttpPayloadWithUnion::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::http_payload_with_union::HttpPayloadWithUnion::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::http_payload_with_union::HttpPayloadWithUnionOutput,
   97    107   
        crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   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 nested(mut self, input: crate::types::UnionPayload) -> Self {
  113    126   
        self.inner = self.inner.nested(input);
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_nested(mut self, input: ::std::option::Option<crate::types::UnionPayload>) -> Self {
  118    133   
        self.inner = self.inner.set_nested(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_nested(&self) -> &::std::option::Option<crate::types::UnionPayload> {
  123    140   
        self.inner.get_nested()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_prefix_headers.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 `HttpPrefixHeaders`.
           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 HttpPrefixHeaders;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl HttpPrefixHeaders {
    7         -
    /// Creates a new `HttpPrefixHeaders`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `HttpPrefixHeaders`
          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::http_prefix_headers::HttpPrefixHeadersInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::http_prefix_headers::HttpPrefixHeadersOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::http_prefix_headers::HttpPrefixHeadersError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +266,283 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for HttpPrefixHeaders {
   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("HttpPrefixHeaders");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            HttpPrefixHeadersRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            HttpPrefixHeadersResponseDeserializer,
  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   
            "HttpPrefixHeaders",
  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("HttpPrefixHeaders")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(HttpPrefixHeadersEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::http_prefix_headers::HttpPrefixHeadersError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::http_prefix_headers::HttpPrefixHeadersError,
  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 HttpPrefixHeadersResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPrefixHeadersResponseDeserializer {
  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_http_prefix_headers::de_http_prefix_headers_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_http_prefix_headers::de_http_prefix_headers_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 HttpPrefixHeadersRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpPrefixHeadersRequestSerializer {
  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::http_prefix_headers::HttpPrefixHeadersInput>()
  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::http_prefix_headers::HttpPrefixHeadersInput,
  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, "/HttpPrefixHeaders").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::http_prefix_headers::HttpPrefixHeadersInput,
  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_http_prefix_headers::ser_http_prefix_headers_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 HttpPrefixHeadersEndpointParamsInterceptor;
  202    216   
  203    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpPrefixHeadersEndpointParamsInterceptor {
  204    218   
    fn name(&self) -> &'static str {
  205    219   
        "HttpPrefixHeadersEndpointParamsInterceptor"
  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::<HttpPrefixHeadersInput>()
  221    235   
            .ok_or("failed to downcast to HttpPrefixHeadersInput")?;
  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 http_prefix_headers_test {
  238    255   
  239    256   
    /// Adds headers by prefix
  240    257   
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
  241    258   
    #[::tokio::test]
  242    259   
    #[::tracing_test::traced_test]
  243    260   
    async fn rest_json_http_prefix_headers_are_present_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   
@@ -348,365 +477,553 @@
  368    385   
            });
  369    386   
            de.deserialize_nonstreaming(&http_response)
  370    387   
        });
  371    388   
        let parsed = parsed
  372    389   
            .expect("should be successful response")
  373    390   
            .downcast::<crate::operation::http_prefix_headers::HttpPrefixHeadersOutput>()
  374    391   
            .unwrap();
  375    392   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  376    393   
        ::pretty_assertions::assert_eq!(parsed.foo_map, expected_output.foo_map, "Unexpected value for `foo_map`");
  377    394   
    }
         395  +
         396  +
    /* ProtocolTestGenerator.kt:98 */
  378    397   
}
  379    398   
         399  +
/* OperationErrorGenerator.kt:79 */
  380    400   
/// Error type for the `HttpPrefixHeadersError` operation.
         401  +
/* RustType.kt:516 */
  381    402   
#[non_exhaustive]
         403  +
/* RustType.kt:516 */
  382    404   
#[derive(::std::fmt::Debug)]
  383         -
pub enum HttpPrefixHeadersError {
         405  +
pub /* OperationErrorGenerator.kt:81 */ enum HttpPrefixHeadersError {
         406  +
    /* OperationErrorGenerator.kt:88 */
  384    407   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  385    408   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  386    409   
    variable wildcard pattern and check `.code()`:
  387    410   
     \
  388    411   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  389    412   
     \
  390    413   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpPrefixHeadersError) for what information is available for the error.")]
  391    414   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         415  +
    /* OperationErrorGenerator.kt:81 */
  392    416   
}
         417  +
/* OperationErrorGenerator.kt:218 */
  393    418   
impl HttpPrefixHeadersError {
         419  +
    /* OperationErrorGenerator.kt:219 */
  394    420   
    /// Creates the `HttpPrefixHeadersError::Unhandled` variant from any error type.
  395    421   
    pub fn unhandled(
  396    422   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  397    423   
    ) -> Self {
  398    424   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  399    425   
            source: err.into(),
  400    426   
            meta: ::std::default::Default::default(),
  401    427   
        })
  402    428   
    }
  403    429   
  404    430   
    /// Creates the `HttpPrefixHeadersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  405    431   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  406    432   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  407    433   
            source: err.clone().into(),
  408    434   
            meta: err,
  409    435   
        })
  410    436   
    }
  411         -
    ///
         437  +
    /// /* OperationErrorGenerator.kt:236 */
  412    438   
    /// Returns error metadata, which includes the error code, message,
  413    439   
    /// request ID, and potentially additional information.
  414    440   
    ///
         441  +
    /* OperationErrorGenerator.kt:242 */
  415    442   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         443  +
        /* OperationErrorGenerator.kt:243 */
  416    444   
        match self {
  417         -
            Self::Unhandled(e) => &e.meta,
         445  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         446  +
            /* OperationErrorGenerator.kt:243 */
  418    447   
        }
         448  +
        /* OperationErrorGenerator.kt:242 */
  419    449   
    }
         450  +
    /* OperationErrorGenerator.kt:218 */
  420    451   
}
         452  +
/* OperationErrorGenerator.kt:269 */
  421    453   
impl ::std::error::Error for HttpPrefixHeadersError {
         454  +
    /* OperationErrorGenerator.kt:270 */
  422    455   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         456  +
        /* OperationErrorGenerator.kt:318 */
  423    457   
        match self {
  424         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         458  +
            /* OperationErrorGenerator.kt:326 */
         459  +
            Self::Unhandled(_inner) => {
         460  +
                /* OperationErrorGenerator.kt:279 */
         461  +
                ::std::option::Option::Some(&*_inner.source)
         462  +
                /* OperationErrorGenerator.kt:326 */
         463  +
            } /* OperationErrorGenerator.kt:318 */
  425    464   
        }
         465  +
        /* OperationErrorGenerator.kt:270 */
  426    466   
    }
         467  +
    /* OperationErrorGenerator.kt:269 */
  427    468   
}
         469  +
/* OperationErrorGenerator.kt:133 */
  428    470   
impl ::std::fmt::Display for HttpPrefixHeadersError {
         471  +
    /* OperationErrorGenerator.kt:134 */
  429    472   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         473  +
        /* OperationErrorGenerator.kt:318 */
  430    474   
        match self {
         475  +
            /* OperationErrorGenerator.kt:326 */
  431    476   
            Self::Unhandled(_inner) => {
         477  +
                /* OperationErrorGenerator.kt:139 */
  432    478   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  433    479   
                    write!(f, "unhandled error ({code})")
  434    480   
                } else {
  435    481   
                    f.write_str("unhandled error")
  436    482   
                }
  437         -
            }
         483  +
                /* OperationErrorGenerator.kt:326 */
         484  +
            } /* OperationErrorGenerator.kt:318 */
  438    485   
        }
         486  +
        /* OperationErrorGenerator.kt:134 */
  439    487   
    }
         488  +
    /* OperationErrorGenerator.kt:133 */
  440    489   
}
         490  +
/* OperationErrorGenerator.kt:182 */
  441    491   
impl ::aws_smithy_types::retry::ProvideErrorKind for HttpPrefixHeadersError {
         492  +
    /* OperationErrorGenerator.kt:186 */
  442    493   
    fn code(&self) -> ::std::option::Option<&str> {
         494  +
        /* OperationErrorGenerator.kt:187 */
  443    495   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         496  +
        /* OperationErrorGenerator.kt:186 */
  444    497   
    }
         498  +
    /* OperationErrorGenerator.kt:190 */
  445    499   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         500  +
        /* OperationErrorGenerator.kt:197 */
  446    501   
        ::std::option::Option::None
         502  +
        /* OperationErrorGenerator.kt:190 */
  447    503   
    }
         504  +
    /* OperationErrorGenerator.kt:182 */
  448    505   
}
         506  +
/* OperationErrorGenerator.kt:163 */
  449    507   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpPrefixHeadersError {
         508  +
    /* OperationErrorGenerator.kt:164 */
  450    509   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         510  +
        /* OperationErrorGenerator.kt:318 */
  451    511   
        match self {
  452         -
            Self::Unhandled(_inner) => &_inner.meta,
         512  +
            /* OperationErrorGenerator.kt:326 */
         513  +
            Self::Unhandled(_inner) => {
         514  +
                /* OperationErrorGenerator.kt:168 */
         515  +
                &_inner.meta
         516  +
                /* OperationErrorGenerator.kt:326 */
         517  +
            } /* OperationErrorGenerator.kt:318 */
  453    518   
        }
         519  +
        /* OperationErrorGenerator.kt:164 */
  454    520   
    }
         521  +
    /* OperationErrorGenerator.kt:163 */
  455    522   
}
         523  +
/* OperationErrorGenerator.kt:109 */
  456    524   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpPrefixHeadersError {
         525  +
    /* OperationErrorGenerator.kt:110 */
  457    526   
    fn create_unhandled_error(
  458    527   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  459    528   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  460    529   
    ) -> Self {
         530  +
        /* OperationErrorGenerator.kt:121 */
  461    531   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  462    532   
            source,
  463    533   
            meta: meta.unwrap_or_default(),
  464    534   
        })
         535  +
        /* OperationErrorGenerator.kt:110 */
  465    536   
    }
         537  +
    /* OperationErrorGenerator.kt:109 */
  466    538   
}
  467    539   
         540  +
/* CodegenDelegator.kt:255 */
  468    541   
pub use crate::operation::http_prefix_headers::_http_prefix_headers_output::HttpPrefixHeadersOutput;
  469    542   
         543  +
/* CodegenDelegator.kt:255 */
  470    544   
pub use crate::operation::http_prefix_headers::_http_prefix_headers_input::HttpPrefixHeadersInput;
  471    545   
         546  +
/* RustModule.kt:172 */
  472    547   
mod _http_prefix_headers_input;
  473    548   
         549  +
/* RustModule.kt:172 */
  474    550   
mod _http_prefix_headers_output;
  475    551   
  476         -
/// Builders
         552  +
/// /* CodegenDelegator.kt:51 */Builders
  477    553   
pub mod builders;

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

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

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

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