Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/sparse_json_maps.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 `SparseJsonMaps`.
           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 SparseJsonMaps;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl SparseJsonMaps {
    7         -
    /// Creates a new `SparseJsonMaps`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `SparseJsonMaps`
          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::sparse_json_maps::SparseJsonMapsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::sparse_json_maps::SparseJsonMapsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::sparse_json_maps::SparseJsonMapsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +263,280 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SparseJsonMaps {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SparseJsonMaps");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            SparseJsonMapsRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            SparseJsonMapsResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "SparseJsonMaps",
  105    116   
            "Rest Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("SparseJsonMaps")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(SparseJsonMapsEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::sparse_json_maps::SparseJsonMapsError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::sparse_json_maps::SparseJsonMapsError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct SparseJsonMapsResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SparseJsonMapsResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct SparseJsonMapsRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SparseJsonMapsRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input
  161    174   
            .downcast::<crate::operation::sparse_json_maps::SparseJsonMapsInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/SparseJsonMaps").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_input(&input)?);
  190    203   
        if let Some(content_length) = body.content_length() {
  191    204   
            let content_length = content_length.to_string();
  192    205   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  193    206   
        }
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct SparseJsonMapsEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SparseJsonMapsEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "SparseJsonMapsEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<SparseJsonMapsInput>()
  218    232   
            .ok_or("failed to downcast to SparseJsonMapsInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* RustType.kt:516 */
  232    247   
#[allow(unreachable_code, unused_variables)]
         248  +
/* RustType.kt:516 */
  233    249   
#[cfg(test)]
         250  +
/* ProtocolTestGenerator.kt:98 */
  234    251   
mod sparse_json_maps_test {
  235    252   
  236    253   
    /// Serializes JSON maps
  237    254   
    /// Test ID: RestJsonSparseJsonMaps
  238    255   
    #[::tokio::test]
  239    256   
    #[::tracing_test::traced_test]
  240    257   
    async fn rest_json_sparse_json_maps_request() {
  241    258   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    259   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  243    260   
@@ -794,811 +923,999 @@
  814    831   
            parsed.sparse_string_map,
  815    832   
            expected_output.sparse_string_map,
  816    833   
            "Unexpected value for `sparse_string_map`"
  817    834   
        );
  818    835   
        ::pretty_assertions::assert_eq!(
  819    836   
            parsed.sparse_set_map,
  820    837   
            expected_output.sparse_set_map,
  821    838   
            "Unexpected value for `sparse_set_map`"
  822    839   
        );
  823    840   
    }
         841  +
         842  +
    /* ProtocolTestGenerator.kt:98 */
  824    843   
}
  825    844   
         845  +
/* OperationErrorGenerator.kt:79 */
  826    846   
/// Error type for the `SparseJsonMapsError` operation.
         847  +
/* RustType.kt:516 */
  827    848   
#[non_exhaustive]
         849  +
/* RustType.kt:516 */
  828    850   
#[derive(::std::fmt::Debug)]
  829         -
pub enum SparseJsonMapsError {
         851  +
pub /* OperationErrorGenerator.kt:81 */ enum SparseJsonMapsError {
         852  +
    /* OperationErrorGenerator.kt:88 */
  830    853   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  831    854   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  832    855   
    variable wildcard pattern and check `.code()`:
  833    856   
     \
  834    857   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  835    858   
     \
  836    859   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SparseJsonMapsError) for what information is available for the error.")]
  837    860   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         861  +
    /* OperationErrorGenerator.kt:81 */
  838    862   
}
         863  +
/* OperationErrorGenerator.kt:218 */
  839    864   
impl SparseJsonMapsError {
         865  +
    /* OperationErrorGenerator.kt:219 */
  840    866   
    /// Creates the `SparseJsonMapsError::Unhandled` variant from any error type.
  841    867   
    pub fn unhandled(
  842    868   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  843    869   
    ) -> Self {
  844    870   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  845    871   
            source: err.into(),
  846    872   
            meta: ::std::default::Default::default(),
  847    873   
        })
  848    874   
    }
  849    875   
  850    876   
    /// Creates the `SparseJsonMapsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  851    877   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  852    878   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  853    879   
            source: err.clone().into(),
  854    880   
            meta: err,
  855    881   
        })
  856    882   
    }
  857         -
    ///
         883  +
    /// /* OperationErrorGenerator.kt:236 */
  858    884   
    /// Returns error metadata, which includes the error code, message,
  859    885   
    /// request ID, and potentially additional information.
  860    886   
    ///
         887  +
    /* OperationErrorGenerator.kt:242 */
  861    888   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         889  +
        /* OperationErrorGenerator.kt:243 */
  862    890   
        match self {
  863         -
            Self::Unhandled(e) => &e.meta,
         891  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         892  +
            /* OperationErrorGenerator.kt:243 */
  864    893   
        }
         894  +
        /* OperationErrorGenerator.kt:242 */
  865    895   
    }
         896  +
    /* OperationErrorGenerator.kt:218 */
  866    897   
}
         898  +
/* OperationErrorGenerator.kt:269 */
  867    899   
impl ::std::error::Error for SparseJsonMapsError {
         900  +
    /* OperationErrorGenerator.kt:270 */
  868    901   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         902  +
        /* OperationErrorGenerator.kt:318 */
  869    903   
        match self {
  870         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         904  +
            /* OperationErrorGenerator.kt:326 */
         905  +
            Self::Unhandled(_inner) => {
         906  +
                /* OperationErrorGenerator.kt:279 */
         907  +
                ::std::option::Option::Some(&*_inner.source)
         908  +
                /* OperationErrorGenerator.kt:326 */
         909  +
            } /* OperationErrorGenerator.kt:318 */
  871    910   
        }
         911  +
        /* OperationErrorGenerator.kt:270 */
  872    912   
    }
         913  +
    /* OperationErrorGenerator.kt:269 */
  873    914   
}
         915  +
/* OperationErrorGenerator.kt:133 */
  874    916   
impl ::std::fmt::Display for SparseJsonMapsError {
         917  +
    /* OperationErrorGenerator.kt:134 */
  875    918   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         919  +
        /* OperationErrorGenerator.kt:318 */
  876    920   
        match self {
         921  +
            /* OperationErrorGenerator.kt:326 */
  877    922   
            Self::Unhandled(_inner) => {
         923  +
                /* OperationErrorGenerator.kt:139 */
  878    924   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  879    925   
                    write!(f, "unhandled error ({code})")
  880    926   
                } else {
  881    927   
                    f.write_str("unhandled error")
  882    928   
                }
         929  +
                /* OperationErrorGenerator.kt:326 */
         930  +
            } /* OperationErrorGenerator.kt:318 */
  883    931   
        }
         932  +
        /* OperationErrorGenerator.kt:134 */
  884    933   
    }
  885         -
    }
         934  +
    /* OperationErrorGenerator.kt:133 */
  886    935   
}
         936  +
/* OperationErrorGenerator.kt:182 */
  887    937   
impl ::aws_smithy_types::retry::ProvideErrorKind for SparseJsonMapsError {
         938  +
    /* OperationErrorGenerator.kt:186 */
  888    939   
    fn code(&self) -> ::std::option::Option<&str> {
         940  +
        /* OperationErrorGenerator.kt:187 */
  889    941   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         942  +
        /* OperationErrorGenerator.kt:186 */
  890    943   
    }
         944  +
    /* OperationErrorGenerator.kt:190 */
  891    945   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         946  +
        /* OperationErrorGenerator.kt:197 */
  892    947   
        ::std::option::Option::None
         948  +
        /* OperationErrorGenerator.kt:190 */
  893    949   
    }
         950  +
    /* OperationErrorGenerator.kt:182 */
  894    951   
}
         952  +
/* OperationErrorGenerator.kt:163 */
  895    953   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SparseJsonMapsError {
         954  +
    /* OperationErrorGenerator.kt:164 */
  896    955   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         956  +
        /* OperationErrorGenerator.kt:318 */
  897    957   
        match self {
  898         -
            Self::Unhandled(_inner) => &_inner.meta,
         958  +
            /* OperationErrorGenerator.kt:326 */
         959  +
            Self::Unhandled(_inner) => {
         960  +
                /* OperationErrorGenerator.kt:168 */
         961  +
                &_inner.meta
         962  +
                /* OperationErrorGenerator.kt:326 */
         963  +
            } /* OperationErrorGenerator.kt:318 */
  899    964   
        }
         965  +
        /* OperationErrorGenerator.kt:164 */
  900    966   
    }
         967  +
    /* OperationErrorGenerator.kt:163 */
  901    968   
}
         969  +
/* OperationErrorGenerator.kt:109 */
  902    970   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SparseJsonMapsError {
         971  +
    /* OperationErrorGenerator.kt:110 */
  903    972   
    fn create_unhandled_error(
  904    973   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  905    974   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  906    975   
    ) -> Self {
         976  +
        /* OperationErrorGenerator.kt:121 */
  907    977   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  908    978   
            source,
  909    979   
            meta: meta.unwrap_or_default(),
  910    980   
        })
         981  +
        /* OperationErrorGenerator.kt:110 */
  911    982   
    }
         983  +
    /* OperationErrorGenerator.kt:109 */
  912    984   
}
  913    985   
         986  +
/* CodegenDelegator.kt:255 */
  914    987   
pub use crate::operation::sparse_json_maps::_sparse_json_maps_output::SparseJsonMapsOutput;
  915    988   
         989  +
/* CodegenDelegator.kt:255 */
  916    990   
pub use crate::operation::sparse_json_maps::_sparse_json_maps_input::SparseJsonMapsInput;
  917    991   
         992  +
/* RustModule.kt:172 */
  918    993   
mod _sparse_json_maps_input;
  919    994   
         995  +
/* RustModule.kt:172 */
  920    996   
mod _sparse_json_maps_output;
  921    997   
  922         -
/// Builders
         998  +
/// /* CodegenDelegator.kt:51 */Builders
  923    999   
pub mod builders;

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

@@ -1,1 +208,331 @@
    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 SparseJsonMapsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct SparseJsonMapsInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub sparse_struct_map:
    8     12   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
          13  +
    /* StructureGenerator.kt:231 */
    9     14   
    #[allow(missing_docs)] // documentation missing in model
   10     15   
    pub sparse_number_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
          16  +
    /* StructureGenerator.kt:231 */
   11     17   
    #[allow(missing_docs)] // documentation missing in model
   12     18   
    pub sparse_boolean_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
          19  +
    /* StructureGenerator.kt:231 */
   13     20   
    #[allow(missing_docs)] // documentation missing in model
   14     21   
    pub sparse_string_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
          22  +
    /* StructureGenerator.kt:231 */
   15     23   
    #[allow(missing_docs)] // documentation missing in model
   16     24   
    pub sparse_set_map:
   17     25   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>,
          26  +
    /* StructureGenerator.kt:201 */
   18     27   
}
          28  +
/* StructureGenerator.kt:135 */
   19     29   
impl SparseJsonMapsInput {
          30  +
    /* StructureGenerator.kt:231 */
   20     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
                           /* StructureGenerator.kt:166 */
   21     33   
    pub fn sparse_struct_map(
   22     34   
        &self,
   23     35   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>> {
          36  +
        /* StructureGenerator.kt:170 */
   24     37   
        self.sparse_struct_map.as_ref()
          38  +
        /* StructureGenerator.kt:166 */
   25     39   
    }
          40  +
    /* StructureGenerator.kt:231 */
   26     41   
    #[allow(missing_docs)] // documentation missing in model
          42  +
                           /* StructureGenerator.kt:166 */
   27     43   
    pub fn sparse_number_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>> {
          44  +
        /* StructureGenerator.kt:170 */
   28     45   
        self.sparse_number_map.as_ref()
          46  +
        /* StructureGenerator.kt:166 */
   29     47   
    }
          48  +
    /* StructureGenerator.kt:231 */
   30     49   
    #[allow(missing_docs)] // documentation missing in model
          50  +
                           /* StructureGenerator.kt:166 */
   31     51   
    pub fn sparse_boolean_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>> {
          52  +
        /* StructureGenerator.kt:170 */
   32     53   
        self.sparse_boolean_map.as_ref()
          54  +
        /* StructureGenerator.kt:166 */
   33     55   
    }
          56  +
    /* StructureGenerator.kt:231 */
   34     57   
    #[allow(missing_docs)] // documentation missing in model
          58  +
                           /* StructureGenerator.kt:166 */
   35     59   
    pub fn sparse_string_map(
   36     60   
        &self,
   37     61   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
          62  +
        /* StructureGenerator.kt:170 */
   38     63   
        self.sparse_string_map.as_ref()
          64  +
        /* StructureGenerator.kt:166 */
   39     65   
    }
          66  +
    /* StructureGenerator.kt:231 */
   40     67   
    #[allow(missing_docs)] // documentation missing in model
          68  +
                           /* StructureGenerator.kt:166 */
   41     69   
    pub fn sparse_set_map(
   42     70   
        &self,
   43     71   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>
   44     72   
    {
          73  +
        /* StructureGenerator.kt:170 */
   45     74   
        self.sparse_set_map.as_ref()
          75  +
        /* StructureGenerator.kt:166 */
   46     76   
    }
          77  +
    /* StructureGenerator.kt:135 */
   47     78   
}
          79  +
/* ClientCodegenVisitor.kt:237 */
   48     80   
impl SparseJsonMapsInput {
   49         -
    /// Creates a new builder-style object to manufacture [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
          81  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
          82  +
    /* BuilderGenerator.kt:175 */
   50     83   
    pub fn builder() -> crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder {
          84  +
        /* BuilderGenerator.kt:176 */
   51     85   
        crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder::default()
          86  +
        /* BuilderGenerator.kt:175 */
   52     87   
    }
          88  +
    /* ClientCodegenVisitor.kt:237 */
   53     89   
}
   54     90   
   55         -
/// A builder for [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
          91  +
/// /* BuilderGenerator.kt:342 */A builder for [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
          92  +
/* RustType.kt:516 */
   56     93   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          94  +
/* RustType.kt:516 */
   57     95   
#[non_exhaustive]
          96  +
/* BuilderGenerator.kt:345 */
   58     97   
pub struct SparseJsonMapsInputBuilder {
          98  +
    /* BuilderGenerator.kt:275 */
   59     99   
    pub(crate) sparse_struct_map:
   60    100   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
         101  +
    /* BuilderGenerator.kt:275 */
   61    102   
    pub(crate) sparse_number_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
         103  +
    /* BuilderGenerator.kt:275 */
   62    104   
    pub(crate) sparse_boolean_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
         105  +
    /* BuilderGenerator.kt:275 */
   63    106   
    pub(crate) sparse_string_map:
   64    107   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
         108  +
    /* BuilderGenerator.kt:275 */
   65    109   
    pub(crate) sparse_set_map:
   66    110   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>,
         111  +
    /* BuilderGenerator.kt:345 */
   67    112   
}
         113  +
/* BuilderGenerator.kt:355 */
   68    114   
impl SparseJsonMapsInputBuilder {
   69         -
    /// Adds a key-value pair to `sparse_struct_map`.
         115  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_struct_map`.
         116  +
    /* BuilderGenerator.kt:437 */
   70    117   
    ///
   71         -
    /// To override the contents of this collection use [`set_sparse_struct_map`](Self::set_sparse_struct_map).
         118  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_struct_map`](Self::set_sparse_struct_map).
         119  +
    /* BuilderGenerator.kt:439 */
   72    120   
    ///
         121  +
    /* BuilderGenerator.kt:445 */
   73    122   
    pub fn sparse_struct_map(
   74    123   
        mut self,
   75    124   
        k: impl ::std::convert::Into<::std::string::String>,
   76    125   
        v: ::std::option::Option<crate::types::GreetingStruct>,
   77    126   
    ) -> Self {
         127  +
        /* BuilderGenerator.kt:448 */
   78    128   
        let mut hash_map = self.sparse_struct_map.unwrap_or_default();
   79    129   
        hash_map.insert(k.into(), v);
   80    130   
        self.sparse_struct_map = ::std::option::Option::Some(hash_map);
   81    131   
        self
         132  +
        /* BuilderGenerator.kt:445 */
   82    133   
    }
         134  +
    /* BuilderGenerator.kt:312 */
   83    135   
    #[allow(missing_docs)] // documentation missing in model
         136  +
                           /* BuilderGenerator.kt:314 */
   84    137   
    pub fn set_sparse_struct_map(
   85    138   
        mut self,
   86    139   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
   87    140   
    ) -> Self {
         141  +
        /* BuilderGenerator.kt:315 */
   88    142   
        self.sparse_struct_map = input;
   89    143   
        self
         144  +
        /* BuilderGenerator.kt:314 */
   90    145   
    }
         146  +
    /* BuilderGenerator.kt:334 */
   91    147   
    #[allow(missing_docs)] // documentation missing in model
         148  +
                           /* BuilderGenerator.kt:336 */
   92    149   
    pub fn get_sparse_struct_map(
   93    150   
        &self,
   94    151   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>> {
         152  +
        /* BuilderGenerator.kt:337 */
   95    153   
        &self.sparse_struct_map
         154  +
        /* BuilderGenerator.kt:336 */
   96    155   
    }
   97         -
    /// Adds a key-value pair to `sparse_number_map`.
         156  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_number_map`.
         157  +
    /* BuilderGenerator.kt:437 */
   98    158   
    ///
   99         -
    /// To override the contents of this collection use [`set_sparse_number_map`](Self::set_sparse_number_map).
         159  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_number_map`](Self::set_sparse_number_map).
         160  +
    /* BuilderGenerator.kt:439 */
  100    161   
    ///
         162  +
    /* BuilderGenerator.kt:445 */
  101    163   
    pub fn sparse_number_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<i32>) -> Self {
         164  +
        /* BuilderGenerator.kt:448 */
  102    165   
        let mut hash_map = self.sparse_number_map.unwrap_or_default();
  103    166   
        hash_map.insert(k.into(), v);
  104    167   
        self.sparse_number_map = ::std::option::Option::Some(hash_map);
  105    168   
        self
         169  +
        /* BuilderGenerator.kt:445 */
  106    170   
    }
         171  +
    /* BuilderGenerator.kt:312 */
  107    172   
    #[allow(missing_docs)] // documentation missing in model
         173  +
                           /* BuilderGenerator.kt:314 */
  108    174   
    pub fn set_sparse_number_map(
  109    175   
        mut self,
  110    176   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
  111    177   
    ) -> Self {
         178  +
        /* BuilderGenerator.kt:315 */
  112    179   
        self.sparse_number_map = input;
  113    180   
        self
         181  +
        /* BuilderGenerator.kt:314 */
  114    182   
    }
         183  +
    /* BuilderGenerator.kt:334 */
  115    184   
    #[allow(missing_docs)] // documentation missing in model
         185  +
                           /* BuilderGenerator.kt:336 */
  116    186   
    pub fn get_sparse_number_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>> {
         187  +
        /* BuilderGenerator.kt:337 */
  117    188   
        &self.sparse_number_map
         189  +
        /* BuilderGenerator.kt:336 */
  118    190   
    }
  119         -
    /// Adds a key-value pair to `sparse_boolean_map`.
         191  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_boolean_map`.
         192  +
    /* BuilderGenerator.kt:437 */
  120    193   
    ///
  121         -
    /// To override the contents of this collection use [`set_sparse_boolean_map`](Self::set_sparse_boolean_map).
         194  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_boolean_map`](Self::set_sparse_boolean_map).
         195  +
    /* BuilderGenerator.kt:439 */
  122    196   
    ///
         197  +
    /* BuilderGenerator.kt:445 */
  123    198   
    pub fn sparse_boolean_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<bool>) -> Self {
         199  +
        /* BuilderGenerator.kt:448 */
  124    200   
        let mut hash_map = self.sparse_boolean_map.unwrap_or_default();
  125    201   
        hash_map.insert(k.into(), v);
  126    202   
        self.sparse_boolean_map = ::std::option::Option::Some(hash_map);
  127    203   
        self
         204  +
        /* BuilderGenerator.kt:445 */
  128    205   
    }
         206  +
    /* BuilderGenerator.kt:312 */
  129    207   
    #[allow(missing_docs)] // documentation missing in model
         208  +
                           /* BuilderGenerator.kt:314 */
  130    209   
    pub fn set_sparse_boolean_map(
  131    210   
        mut self,
  132    211   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
  133    212   
    ) -> Self {
         213  +
        /* BuilderGenerator.kt:315 */
  134    214   
        self.sparse_boolean_map = input;
  135    215   
        self
         216  +
        /* BuilderGenerator.kt:314 */
  136    217   
    }
         218  +
    /* BuilderGenerator.kt:334 */
  137    219   
    #[allow(missing_docs)] // documentation missing in model
         220  +
                           /* BuilderGenerator.kt:336 */
  138    221   
    pub fn get_sparse_boolean_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>> {
         222  +
        /* BuilderGenerator.kt:337 */
  139    223   
        &self.sparse_boolean_map
         224  +
        /* BuilderGenerator.kt:336 */
  140    225   
    }
  141         -
    /// Adds a key-value pair to `sparse_string_map`.
         226  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_string_map`.
         227  +
    /* BuilderGenerator.kt:437 */
  142    228   
    ///
  143         -
    /// To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         229  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         230  +
    /* BuilderGenerator.kt:439 */
  144    231   
    ///
         232  +
    /* BuilderGenerator.kt:445 */
  145    233   
    pub fn sparse_string_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
         234  +
        /* BuilderGenerator.kt:448 */
  146    235   
        let mut hash_map = self.sparse_string_map.unwrap_or_default();
  147    236   
        hash_map.insert(k.into(), v);
  148    237   
        self.sparse_string_map = ::std::option::Option::Some(hash_map);
  149    238   
        self
         239  +
        /* BuilderGenerator.kt:445 */
  150    240   
    }
         241  +
    /* BuilderGenerator.kt:312 */
  151    242   
    #[allow(missing_docs)] // documentation missing in model
         243  +
                           /* BuilderGenerator.kt:314 */
  152    244   
    pub fn set_sparse_string_map(
  153    245   
        mut self,
  154    246   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
  155    247   
    ) -> Self {
         248  +
        /* BuilderGenerator.kt:315 */
  156    249   
        self.sparse_string_map = input;
  157    250   
        self
         251  +
        /* BuilderGenerator.kt:314 */
  158    252   
    }
         253  +
    /* BuilderGenerator.kt:334 */
  159    254   
    #[allow(missing_docs)] // documentation missing in model
         255  +
                           /* BuilderGenerator.kt:336 */
  160    256   
    pub fn get_sparse_string_map(
  161    257   
        &self,
  162    258   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
         259  +
        /* BuilderGenerator.kt:337 */
  163    260   
        &self.sparse_string_map
         261  +
        /* BuilderGenerator.kt:336 */
  164    262   
    }
  165         -
    /// Adds a key-value pair to `sparse_set_map`.
         263  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_set_map`.
         264  +
    /* BuilderGenerator.kt:437 */
  166    265   
    ///
  167         -
    /// To override the contents of this collection use [`set_sparse_set_map`](Self::set_sparse_set_map).
         266  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_set_map`](Self::set_sparse_set_map).
         267  +
    /* BuilderGenerator.kt:439 */
  168    268   
    ///
         269  +
    /* BuilderGenerator.kt:445 */
  169    270   
    pub fn sparse_set_map(
  170    271   
        mut self,
  171    272   
        k: impl ::std::convert::Into<::std::string::String>,
  172    273   
        v: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  173    274   
    ) -> Self {
         275  +
        /* BuilderGenerator.kt:448 */
  174    276   
        let mut hash_map = self.sparse_set_map.unwrap_or_default();
  175    277   
        hash_map.insert(k.into(), v);
  176    278   
        self.sparse_set_map = ::std::option::Option::Some(hash_map);
  177    279   
        self
         280  +
        /* BuilderGenerator.kt:445 */
  178    281   
    }
         282  +
    /* BuilderGenerator.kt:312 */
  179    283   
    #[allow(missing_docs)] // documentation missing in model
         284  +
                           /* BuilderGenerator.kt:314 */
  180    285   
    pub fn set_sparse_set_map(
  181    286   
        mut self,
  182    287   
        input: ::std::option::Option<
  183    288   
            ::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>,
  184    289   
        >,
  185    290   
    ) -> Self {
         291  +
        /* BuilderGenerator.kt:315 */
  186    292   
        self.sparse_set_map = input;
  187    293   
        self
         294  +
        /* BuilderGenerator.kt:314 */
  188    295   
    }
         296  +
    /* BuilderGenerator.kt:334 */
  189    297   
    #[allow(missing_docs)] // documentation missing in model
         298  +
                           /* BuilderGenerator.kt:336 */
  190    299   
    pub fn get_sparse_set_map(
  191    300   
        &self,
  192    301   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>
  193    302   
    {
         303  +
        /* BuilderGenerator.kt:337 */
  194    304   
        &self.sparse_set_map
         305  +
        /* BuilderGenerator.kt:336 */
  195    306   
    }
  196         -
    /// Consumes the builder and constructs a [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
         307  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`SparseJsonMapsInput`](crate::operation::sparse_json_maps::SparseJsonMapsInput).
         308  +
    /* BuilderGenerator.kt:253 */
  197    309   
    pub fn build(
  198    310   
        self,
  199    311   
    ) -> ::std::result::Result<crate::operation::sparse_json_maps::SparseJsonMapsInput, ::aws_smithy_types::error::operation::BuildError> {
  200         -
        ::std::result::Result::Ok(crate::operation::sparse_json_maps::SparseJsonMapsInput {
  201         -
            sparse_struct_map: self.sparse_struct_map,
         312  +
        /* BuilderGenerator.kt:254 */
         313  +
        ::std::result::Result::Ok(
         314  +
            /* BuilderGenerator.kt:477 */
         315  +
            crate::operation::sparse_json_maps::SparseJsonMapsInput {
         316  +
                /* BuilderGenerator.kt:481 */ sparse_struct_map: self.sparse_struct_map,
         317  +
                /* BuilderGenerator.kt:481 */
  202    318   
                sparse_number_map: self.sparse_number_map,
         319  +
                /* BuilderGenerator.kt:481 */
  203    320   
                sparse_boolean_map: self.sparse_boolean_map,
         321  +
                /* BuilderGenerator.kt:481 */
  204    322   
                sparse_string_map: self.sparse_string_map,
         323  +
                /* BuilderGenerator.kt:481 */
  205    324   
                sparse_set_map: self.sparse_set_map,
  206         -
        })
         325  +
                /* BuilderGenerator.kt:477 */
         326  +
            }, /* BuilderGenerator.kt:254 */
         327  +
        )
         328  +
        /* BuilderGenerator.kt:253 */
  207    329   
    }
         330  +
    /* BuilderGenerator.kt:355 */
  208    331   
}

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

@@ -1,1 +206,326 @@
    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 SparseJsonMapsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct SparseJsonMapsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub sparse_struct_map:
    8     12   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
          13  +
    /* StructureGenerator.kt:231 */
    9     14   
    #[allow(missing_docs)] // documentation missing in model
   10     15   
    pub sparse_number_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
          16  +
    /* StructureGenerator.kt:231 */
   11     17   
    #[allow(missing_docs)] // documentation missing in model
   12     18   
    pub sparse_boolean_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
          19  +
    /* StructureGenerator.kt:231 */
   13     20   
    #[allow(missing_docs)] // documentation missing in model
   14     21   
    pub sparse_string_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
          22  +
    /* StructureGenerator.kt:231 */
   15     23   
    #[allow(missing_docs)] // documentation missing in model
   16     24   
    pub sparse_set_map:
   17     25   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>,
          26  +
    /* StructureGenerator.kt:201 */
   18     27   
}
          28  +
/* StructureGenerator.kt:135 */
   19     29   
impl SparseJsonMapsOutput {
          30  +
    /* StructureGenerator.kt:231 */
   20     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
                           /* StructureGenerator.kt:166 */
   21     33   
    pub fn sparse_struct_map(
   22     34   
        &self,
   23     35   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>> {
          36  +
        /* StructureGenerator.kt:170 */
   24     37   
        self.sparse_struct_map.as_ref()
          38  +
        /* StructureGenerator.kt:166 */
   25     39   
    }
          40  +
    /* StructureGenerator.kt:231 */
   26     41   
    #[allow(missing_docs)] // documentation missing in model
          42  +
                           /* StructureGenerator.kt:166 */
   27     43   
    pub fn sparse_number_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>> {
          44  +
        /* StructureGenerator.kt:170 */
   28     45   
        self.sparse_number_map.as_ref()
          46  +
        /* StructureGenerator.kt:166 */
   29     47   
    }
          48  +
    /* StructureGenerator.kt:231 */
   30     49   
    #[allow(missing_docs)] // documentation missing in model
          50  +
                           /* StructureGenerator.kt:166 */
   31     51   
    pub fn sparse_boolean_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>> {
          52  +
        /* StructureGenerator.kt:170 */
   32     53   
        self.sparse_boolean_map.as_ref()
          54  +
        /* StructureGenerator.kt:166 */
   33     55   
    }
          56  +
    /* StructureGenerator.kt:231 */
   34     57   
    #[allow(missing_docs)] // documentation missing in model
          58  +
                           /* StructureGenerator.kt:166 */
   35     59   
    pub fn sparse_string_map(
   36     60   
        &self,
   37     61   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
          62  +
        /* StructureGenerator.kt:170 */
   38     63   
        self.sparse_string_map.as_ref()
          64  +
        /* StructureGenerator.kt:166 */
   39     65   
    }
          66  +
    /* StructureGenerator.kt:231 */
   40     67   
    #[allow(missing_docs)] // documentation missing in model
          68  +
                           /* StructureGenerator.kt:166 */
   41     69   
    pub fn sparse_set_map(
   42     70   
        &self,
   43     71   
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>
   44     72   
    {
          73  +
        /* StructureGenerator.kt:170 */
   45     74   
        self.sparse_set_map.as_ref()
          75  +
        /* StructureGenerator.kt:166 */
   46     76   
    }
          77  +
    /* StructureGenerator.kt:135 */
   47     78   
}
          79  +
/* ClientCodegenVisitor.kt:237 */
   48     80   
impl SparseJsonMapsOutput {
   49         -
    /// Creates a new builder-style object to manufacture [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
          81  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
          82  +
    /* BuilderGenerator.kt:175 */
   50     83   
    pub fn builder() -> crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder {
          84  +
        /* BuilderGenerator.kt:176 */
   51     85   
        crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder::default()
          86  +
        /* BuilderGenerator.kt:175 */
   52     87   
    }
          88  +
    /* ClientCodegenVisitor.kt:237 */
   53     89   
}
   54     90   
   55         -
/// A builder for [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
          91  +
/// /* BuilderGenerator.kt:342 */A builder for [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
          92  +
/* RustType.kt:516 */
   56     93   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          94  +
/* RustType.kt:516 */
   57     95   
#[non_exhaustive]
          96  +
/* BuilderGenerator.kt:345 */
   58     97   
pub struct SparseJsonMapsOutputBuilder {
          98  +
    /* BuilderGenerator.kt:275 */
   59     99   
    pub(crate) sparse_struct_map:
   60    100   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
         101  +
    /* BuilderGenerator.kt:275 */
   61    102   
    pub(crate) sparse_number_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
         103  +
    /* BuilderGenerator.kt:275 */
   62    104   
    pub(crate) sparse_boolean_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
         105  +
    /* BuilderGenerator.kt:275 */
   63    106   
    pub(crate) sparse_string_map:
   64    107   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
         108  +
    /* BuilderGenerator.kt:275 */
   65    109   
    pub(crate) sparse_set_map:
   66    110   
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>,
         111  +
    /* BuilderGenerator.kt:345 */
   67    112   
}
         113  +
/* BuilderGenerator.kt:355 */
   68    114   
impl SparseJsonMapsOutputBuilder {
   69         -
    /// Adds a key-value pair to `sparse_struct_map`.
         115  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_struct_map`.
         116  +
    /* BuilderGenerator.kt:437 */
   70    117   
    ///
   71         -
    /// To override the contents of this collection use [`set_sparse_struct_map`](Self::set_sparse_struct_map).
         118  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_struct_map`](Self::set_sparse_struct_map).
         119  +
    /* BuilderGenerator.kt:439 */
   72    120   
    ///
         121  +
    /* BuilderGenerator.kt:445 */
   73    122   
    pub fn sparse_struct_map(
   74    123   
        mut self,
   75    124   
        k: impl ::std::convert::Into<::std::string::String>,
   76    125   
        v: ::std::option::Option<crate::types::GreetingStruct>,
   77    126   
    ) -> Self {
         127  +
        /* BuilderGenerator.kt:448 */
   78    128   
        let mut hash_map = self.sparse_struct_map.unwrap_or_default();
   79    129   
        hash_map.insert(k.into(), v);
   80    130   
        self.sparse_struct_map = ::std::option::Option::Some(hash_map);
   81    131   
        self
         132  +
        /* BuilderGenerator.kt:445 */
   82    133   
    }
         134  +
    /* BuilderGenerator.kt:312 */
   83    135   
    #[allow(missing_docs)] // documentation missing in model
         136  +
                           /* BuilderGenerator.kt:314 */
   84    137   
    pub fn set_sparse_struct_map(
   85    138   
        mut self,
   86    139   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
   87    140   
    ) -> Self {
         141  +
        /* BuilderGenerator.kt:315 */
   88    142   
        self.sparse_struct_map = input;
   89    143   
        self
         144  +
        /* BuilderGenerator.kt:314 */
   90    145   
    }
         146  +
    /* BuilderGenerator.kt:334 */
   91    147   
    #[allow(missing_docs)] // documentation missing in model
         148  +
                           /* BuilderGenerator.kt:336 */
   92    149   
    pub fn get_sparse_struct_map(
   93    150   
        &self,
   94    151   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>> {
         152  +
        /* BuilderGenerator.kt:337 */
   95    153   
        &self.sparse_struct_map
         154  +
        /* BuilderGenerator.kt:336 */
   96    155   
    }
   97         -
    /// Adds a key-value pair to `sparse_number_map`.
         156  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_number_map`.
         157  +
    /* BuilderGenerator.kt:437 */
   98    158   
    ///
   99         -
    /// To override the contents of this collection use [`set_sparse_number_map`](Self::set_sparse_number_map).
         159  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_number_map`](Self::set_sparse_number_map).
         160  +
    /* BuilderGenerator.kt:439 */
  100    161   
    ///
         162  +
    /* BuilderGenerator.kt:445 */
  101    163   
    pub fn sparse_number_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<i32>) -> Self {
         164  +
        /* BuilderGenerator.kt:448 */
  102    165   
        let mut hash_map = self.sparse_number_map.unwrap_or_default();
  103    166   
        hash_map.insert(k.into(), v);
  104    167   
        self.sparse_number_map = ::std::option::Option::Some(hash_map);
  105    168   
        self
         169  +
        /* BuilderGenerator.kt:445 */
  106    170   
    }
         171  +
    /* BuilderGenerator.kt:312 */
  107    172   
    #[allow(missing_docs)] // documentation missing in model
         173  +
                           /* BuilderGenerator.kt:314 */
  108    174   
    pub fn set_sparse_number_map(
  109    175   
        mut self,
  110    176   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
  111    177   
    ) -> Self {
         178  +
        /* BuilderGenerator.kt:315 */
  112    179   
        self.sparse_number_map = input;
  113    180   
        self
         181  +
        /* BuilderGenerator.kt:314 */
  114    182   
    }
         183  +
    /* BuilderGenerator.kt:334 */
  115    184   
    #[allow(missing_docs)] // documentation missing in model
         185  +
                           /* BuilderGenerator.kt:336 */
  116    186   
    pub fn get_sparse_number_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>> {
         187  +
        /* BuilderGenerator.kt:337 */
  117    188   
        &self.sparse_number_map
         189  +
        /* BuilderGenerator.kt:336 */
  118    190   
    }
  119         -
    /// Adds a key-value pair to `sparse_boolean_map`.
         191  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_boolean_map`.
         192  +
    /* BuilderGenerator.kt:437 */
  120    193   
    ///
  121         -
    /// To override the contents of this collection use [`set_sparse_boolean_map`](Self::set_sparse_boolean_map).
         194  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_boolean_map`](Self::set_sparse_boolean_map).
         195  +
    /* BuilderGenerator.kt:439 */
  122    196   
    ///
         197  +
    /* BuilderGenerator.kt:445 */
  123    198   
    pub fn sparse_boolean_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<bool>) -> Self {
         199  +
        /* BuilderGenerator.kt:448 */
  124    200   
        let mut hash_map = self.sparse_boolean_map.unwrap_or_default();
  125    201   
        hash_map.insert(k.into(), v);
  126    202   
        self.sparse_boolean_map = ::std::option::Option::Some(hash_map);
  127    203   
        self
         204  +
        /* BuilderGenerator.kt:445 */
  128    205   
    }
         206  +
    /* BuilderGenerator.kt:312 */
  129    207   
    #[allow(missing_docs)] // documentation missing in model
         208  +
                           /* BuilderGenerator.kt:314 */
  130    209   
    pub fn set_sparse_boolean_map(
  131    210   
        mut self,
  132    211   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
  133    212   
    ) -> Self {
         213  +
        /* BuilderGenerator.kt:315 */
  134    214   
        self.sparse_boolean_map = input;
  135    215   
        self
         216  +
        /* BuilderGenerator.kt:314 */
  136    217   
    }
         218  +
    /* BuilderGenerator.kt:334 */
  137    219   
    #[allow(missing_docs)] // documentation missing in model
         220  +
                           /* BuilderGenerator.kt:336 */
  138    221   
    pub fn get_sparse_boolean_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>> {
         222  +
        /* BuilderGenerator.kt:337 */
  139    223   
        &self.sparse_boolean_map
         224  +
        /* BuilderGenerator.kt:336 */
  140    225   
    }
  141         -
    /// Adds a key-value pair to `sparse_string_map`.
         226  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_string_map`.
         227  +
    /* BuilderGenerator.kt:437 */
  142    228   
    ///
  143         -
    /// To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         229  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
         230  +
    /* BuilderGenerator.kt:439 */
  144    231   
    ///
         232  +
    /* BuilderGenerator.kt:445 */
  145    233   
    pub fn sparse_string_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
         234  +
        /* BuilderGenerator.kt:448 */
  146    235   
        let mut hash_map = self.sparse_string_map.unwrap_or_default();
  147    236   
        hash_map.insert(k.into(), v);
  148    237   
        self.sparse_string_map = ::std::option::Option::Some(hash_map);
  149    238   
        self
         239  +
        /* BuilderGenerator.kt:445 */
  150    240   
    }
         241  +
    /* BuilderGenerator.kt:312 */
  151    242   
    #[allow(missing_docs)] // documentation missing in model
         243  +
                           /* BuilderGenerator.kt:314 */
  152    244   
    pub fn set_sparse_string_map(
  153    245   
        mut self,
  154    246   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
  155    247   
    ) -> Self {
         248  +
        /* BuilderGenerator.kt:315 */
  156    249   
        self.sparse_string_map = input;
  157    250   
        self
         251  +
        /* BuilderGenerator.kt:314 */
  158    252   
    }
         253  +
    /* BuilderGenerator.kt:334 */
  159    254   
    #[allow(missing_docs)] // documentation missing in model
         255  +
                           /* BuilderGenerator.kt:336 */
  160    256   
    pub fn get_sparse_string_map(
  161    257   
        &self,
  162    258   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
         259  +
        /* BuilderGenerator.kt:337 */
  163    260   
        &self.sparse_string_map
         261  +
        /* BuilderGenerator.kt:336 */
  164    262   
    }
  165         -
    /// Adds a key-value pair to `sparse_set_map`.
         263  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `sparse_set_map`.
         264  +
    /* BuilderGenerator.kt:437 */
  166    265   
    ///
  167         -
    /// To override the contents of this collection use [`set_sparse_set_map`](Self::set_sparse_set_map).
         266  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_sparse_set_map`](Self::set_sparse_set_map).
         267  +
    /* BuilderGenerator.kt:439 */
  168    268   
    ///
         269  +
    /* BuilderGenerator.kt:445 */
  169    270   
    pub fn sparse_set_map(
  170    271   
        mut self,
  171    272   
        k: impl ::std::convert::Into<::std::string::String>,
  172    273   
        v: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  173    274   
    ) -> Self {
         275  +
        /* BuilderGenerator.kt:448 */
  174    276   
        let mut hash_map = self.sparse_set_map.unwrap_or_default();
  175    277   
        hash_map.insert(k.into(), v);
  176    278   
        self.sparse_set_map = ::std::option::Option::Some(hash_map);
  177    279   
        self
         280  +
        /* BuilderGenerator.kt:445 */
  178    281   
    }
         282  +
    /* BuilderGenerator.kt:312 */
  179    283   
    #[allow(missing_docs)] // documentation missing in model
         284  +
                           /* BuilderGenerator.kt:314 */
  180    285   
    pub fn set_sparse_set_map(
  181    286   
        mut self,
  182    287   
        input: ::std::option::Option<
  183    288   
            ::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>,
  184    289   
        >,
  185    290   
    ) -> Self {
         291  +
        /* BuilderGenerator.kt:315 */
  186    292   
        self.sparse_set_map = input;
  187    293   
        self
         294  +
        /* BuilderGenerator.kt:314 */
  188    295   
    }
         296  +
    /* BuilderGenerator.kt:334 */
  189    297   
    #[allow(missing_docs)] // documentation missing in model
         298  +
                           /* BuilderGenerator.kt:336 */
  190    299   
    pub fn get_sparse_set_map(
  191    300   
        &self,
  192    301   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>
  193    302   
    {
         303  +
        /* BuilderGenerator.kt:337 */
  194    304   
        &self.sparse_set_map
         305  +
        /* BuilderGenerator.kt:336 */
  195    306   
    }
  196         -
    /// Consumes the builder and constructs a [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
         307  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`SparseJsonMapsOutput`](crate::operation::sparse_json_maps::SparseJsonMapsOutput).
         308  +
    /* BuilderGenerator.kt:253 */
  197    309   
    pub fn build(self) -> crate::operation::sparse_json_maps::SparseJsonMapsOutput {
         310  +
        /* BuilderGenerator.kt:477 */
  198    311   
        crate::operation::sparse_json_maps::SparseJsonMapsOutput {
  199         -
            sparse_struct_map: self.sparse_struct_map,
         312  +
            /* BuilderGenerator.kt:481 */ sparse_struct_map: self.sparse_struct_map,
         313  +
            /* BuilderGenerator.kt:481 */
  200    314   
            sparse_number_map: self.sparse_number_map,
         315  +
            /* BuilderGenerator.kt:481 */
  201    316   
            sparse_boolean_map: self.sparse_boolean_map,
         317  +
            /* BuilderGenerator.kt:481 */
  202    318   
            sparse_string_map: self.sparse_string_map,
         319  +
            /* BuilderGenerator.kt:481 */
  203    320   
            sparse_set_map: self.sparse_set_map,
         321  +
            /* BuilderGenerator.kt:477 */
  204    322   
        }
         323  +
        /* BuilderGenerator.kt:253 */
  205    324   
    }
         325  +
    /* BuilderGenerator.kt:355 */
  206    326   
}

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

@@ -1,1 +238,280 @@
    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::sparse_json_maps::_sparse_json_maps_output::SparseJsonMapsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::sparse_json_maps::_sparse_json_maps_input::SparseJsonMapsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder {
    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::sparse_json_maps::SparseJsonMapsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::sparse_json_maps::SparseJsonMapsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.sparse_json_maps();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `SparseJsonMaps`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `SparseJsonMaps`.
   24     27   
///
   25         -
/// This example tests sparse map serialization.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example tests sparse map serialization.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct SparseJsonMapsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder,
   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::sparse_json_maps::SparseJsonMapsOutput,
   35     41   
        crate::operation::sparse_json_maps::SparseJsonMapsError,
   36     42   
    > for SparseJsonMapsFluentBuilder
   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::sparse_json_maps::SparseJsonMapsOutput,
   44     50   
            crate::operation::sparse_json_maps::SparseJsonMapsError,
   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 SparseJsonMapsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `SparseJsonMapsFluentBuilder`.
   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 SparseJsonMaps as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::sparse_json_maps::builders::SparseJsonMapsInputBuilder {
   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::sparse_json_maps::SparseJsonMapsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::sparse_json_maps::SparseJsonMapsError,
   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::sparse_json_maps::SparseJsonMaps::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::sparse_json_maps::SparseJsonMaps::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::sparse_json_maps::SparseJsonMapsOutput,
   97    107   
        crate::operation::sparse_json_maps::SparseJsonMapsError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
  111         -
    ///
         122  +
    /// /* FluentBuilderGenerator.kt:466 */
  112    123   
    /// Adds a key-value pair to `sparseStructMap`.
  113    124   
    ///
  114    125   
    /// To override the contents of this collection use [`set_sparse_struct_map`](Self::set_sparse_struct_map).
  115    126   
    ///
         127  +
    /* FluentBuilderGenerator.kt:473 */
  116    128   
    #[allow(missing_docs)] // documentation missing in model
         129  +
                           /* FluentBuilderGenerator.kt:475 */
  117    130   
    pub fn sparse_struct_map(
  118    131   
        mut self,
  119    132   
        k: impl ::std::convert::Into<::std::string::String>,
  120    133   
        v: ::std::option::Option<crate::types::GreetingStruct>,
  121    134   
    ) -> Self {
  122    135   
        self.inner = self.inner.sparse_struct_map(k.into(), v);
  123    136   
        self
  124    137   
    }
         138  +
    /* FluentBuilderGenerator.kt:498 */
  125    139   
    #[allow(missing_docs)] // documentation missing in model
         140  +
                           /* FluentBuilderGenerator.kt:500 */
  126    141   
    pub fn set_sparse_struct_map(
  127    142   
        mut self,
  128    143   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>>,
  129    144   
    ) -> Self {
  130    145   
        self.inner = self.inner.set_sparse_struct_map(input);
  131    146   
        self
  132    147   
    }
         148  +
    /* FluentBuilderGenerator.kt:518 */
  133    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* FluentBuilderGenerator.kt:520 */
  134    151   
    pub fn get_sparse_struct_map(
  135    152   
        &self,
  136    153   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<crate::types::GreetingStruct>>> {
  137    154   
        self.inner.get_sparse_struct_map()
  138    155   
    }
  139         -
    ///
         156  +
    /// /* FluentBuilderGenerator.kt:466 */
  140    157   
    /// Adds a key-value pair to `sparseNumberMap`.
  141    158   
    ///
  142    159   
    /// To override the contents of this collection use [`set_sparse_number_map`](Self::set_sparse_number_map).
  143    160   
    ///
         161  +
    /* FluentBuilderGenerator.kt:473 */
  144    162   
    #[allow(missing_docs)] // documentation missing in model
         163  +
                           /* FluentBuilderGenerator.kt:475 */
  145    164   
    pub fn sparse_number_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<i32>) -> Self {
  146    165   
        self.inner = self.inner.sparse_number_map(k.into(), v);
  147    166   
        self
  148    167   
    }
         168  +
    /* FluentBuilderGenerator.kt:498 */
  149    169   
    #[allow(missing_docs)] // documentation missing in model
         170  +
                           /* FluentBuilderGenerator.kt:500 */
  150    171   
    pub fn set_sparse_number_map(
  151    172   
        mut self,
  152    173   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>>,
  153    174   
    ) -> Self {
  154    175   
        self.inner = self.inner.set_sparse_number_map(input);
  155    176   
        self
  156    177   
    }
         178  +
    /* FluentBuilderGenerator.kt:518 */
  157    179   
    #[allow(missing_docs)] // documentation missing in model
         180  +
                           /* FluentBuilderGenerator.kt:520 */
  158    181   
    pub fn get_sparse_number_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>> {
  159    182   
        self.inner.get_sparse_number_map()
  160    183   
    }
  161         -
    ///
         184  +
    /// /* FluentBuilderGenerator.kt:466 */
  162    185   
    /// Adds a key-value pair to `sparseBooleanMap`.
  163    186   
    ///
  164    187   
    /// To override the contents of this collection use [`set_sparse_boolean_map`](Self::set_sparse_boolean_map).
  165    188   
    ///
         189  +
    /* FluentBuilderGenerator.kt:473 */
  166    190   
    #[allow(missing_docs)] // documentation missing in model
         191  +
                           /* FluentBuilderGenerator.kt:475 */
  167    192   
    pub fn sparse_boolean_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<bool>) -> Self {
  168    193   
        self.inner = self.inner.sparse_boolean_map(k.into(), v);
  169    194   
        self
  170    195   
    }
         196  +
    /* FluentBuilderGenerator.kt:498 */
  171    197   
    #[allow(missing_docs)] // documentation missing in model
         198  +
                           /* FluentBuilderGenerator.kt:500 */
  172    199   
    pub fn set_sparse_boolean_map(
  173    200   
        mut self,
  174    201   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>>,
  175    202   
    ) -> Self {
  176    203   
        self.inner = self.inner.set_sparse_boolean_map(input);
  177    204   
        self
  178    205   
    }
         206  +
    /* FluentBuilderGenerator.kt:518 */
  179    207   
    #[allow(missing_docs)] // documentation missing in model
         208  +
                           /* FluentBuilderGenerator.kt:520 */
  180    209   
    pub fn get_sparse_boolean_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>> {
  181    210   
        self.inner.get_sparse_boolean_map()
  182    211   
    }
  183         -
    ///
         212  +
    /// /* FluentBuilderGenerator.kt:466 */
  184    213   
    /// Adds a key-value pair to `sparseStringMap`.
  185    214   
    ///
  186    215   
    /// To override the contents of this collection use [`set_sparse_string_map`](Self::set_sparse_string_map).
  187    216   
    ///
         217  +
    /* FluentBuilderGenerator.kt:473 */
  188    218   
    #[allow(missing_docs)] // documentation missing in model
         219  +
                           /* FluentBuilderGenerator.kt:475 */
  189    220   
    pub fn sparse_string_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
  190    221   
        self.inner = self.inner.sparse_string_map(k.into(), v);
  191    222   
        self
  192    223   
    }
         224  +
    /* FluentBuilderGenerator.kt:498 */
  193    225   
    #[allow(missing_docs)] // documentation missing in model
         226  +
                           /* FluentBuilderGenerator.kt:500 */
  194    227   
    pub fn set_sparse_string_map(
  195    228   
        mut self,
  196    229   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
  197    230   
    ) -> Self {
  198    231   
        self.inner = self.inner.set_sparse_string_map(input);
  199    232   
        self
  200    233   
    }
         234  +
    /* FluentBuilderGenerator.kt:518 */
  201    235   
    #[allow(missing_docs)] // documentation missing in model
         236  +
                           /* FluentBuilderGenerator.kt:520 */
  202    237   
    pub fn get_sparse_string_map(
  203    238   
        &self,
  204    239   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
  205    240   
        self.inner.get_sparse_string_map()
  206    241   
    }
  207         -
    ///
         242  +
    /// /* FluentBuilderGenerator.kt:466 */
  208    243   
    /// Adds a key-value pair to `sparseSetMap`.
  209    244   
    ///
  210    245   
    /// To override the contents of this collection use [`set_sparse_set_map`](Self::set_sparse_set_map).
  211    246   
    ///
         247  +
    /* FluentBuilderGenerator.kt:473 */
  212    248   
    #[allow(missing_docs)] // documentation missing in model
         249  +
                           /* FluentBuilderGenerator.kt:475 */
  213    250   
    pub fn sparse_set_map(
  214    251   
        mut self,
  215    252   
        k: impl ::std::convert::Into<::std::string::String>,
  216    253   
        v: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  217    254   
    ) -> Self {
  218    255   
        self.inner = self.inner.sparse_set_map(k.into(), v);
  219    256   
        self
  220    257   
    }
         258  +
    /* FluentBuilderGenerator.kt:498 */
  221    259   
    #[allow(missing_docs)] // documentation missing in model
         260  +
                           /* FluentBuilderGenerator.kt:500 */
  222    261   
    pub fn set_sparse_set_map(
  223    262   
        mut self,
  224    263   
        input: ::std::option::Option<
  225    264   
            ::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>,
  226    265   
        >,
  227    266   
    ) -> Self {
  228    267   
        self.inner = self.inner.set_sparse_set_map(input);
  229    268   
        self
  230    269   
    }
         270  +
    /* FluentBuilderGenerator.kt:518 */
  231    271   
    #[allow(missing_docs)] // documentation missing in model
         272  +
                           /* FluentBuilderGenerator.kt:520 */
  232    273   
    pub fn get_sparse_set_map(
  233    274   
        &self,
  234    275   
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>
  235    276   
    {
  236    277   
        self.inner.get_sparse_set_map()
  237    278   
    }
         279  +
    /* FluentBuilderGenerator.kt:282 */
  238    280   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/streaming_traits.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 `StreamingTraits`.
           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 StreamingTraits;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl StreamingTraits {
    7         -
    /// Creates a new `StreamingTraits`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `StreamingTraits`
          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::streaming_traits::StreamingTraitsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::streaming_traits::StreamingTraitsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::streaming_traits::StreamingTraitsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +281,298 @@
   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 StreamingTraits {
   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("StreamingTraits");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            StreamingTraitsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            StreamingTraitsResponseDeserializer,
  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   
            "StreamingTraits",
  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("StreamingTraits")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(StreamingTraitsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::streaming_traits::StreamingTraitsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::streaming_traits::StreamingTraitsError,
  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 StreamingTraitsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StreamingTraitsResponseDeserializer {
  139    151   
    fn deserialize_streaming(
  140    152   
        &self,
  141    153   
        response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
  143    155   
        #[allow(unused_mut)]
  144    156   
        let mut force_error = false;
  145    157   
  146    158   
        // If this is an error, defer to the non-streaming parser
  147    159   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  148    160   
            return ::std::option::Option::None;
  149    161   
        }
  150    162   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  151    163   
            crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_response(response),
  152    164   
        ))
  153    165   
    }
  154    166   
  155    167   
    fn deserialize_nonstreaming(
  156    168   
        &self,
  157    169   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  158    170   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  159    171   
        // For streaming operations, we only hit this case if its an error
  160    172   
        let body = response.body().bytes().expect("body loaded");
  161    173   
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_error(
  162    174   
            response.status().as_u16(),
  163    175   
            response.headers(),
  164    176   
            body,
  165    177   
        ))
  166    178   
    }
  167    179   
}
         180  +
/* RequestSerializerGenerator.kt:67 */
  168    181   
#[derive(Debug)]
  169    182   
struct StreamingTraitsRequestSerializer;
  170    183   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamingTraitsRequestSerializer {
  171    184   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  172    185   
    fn serialize_input(
  173    186   
        &self,
  174    187   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  175    188   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  176    189   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  177    190   
        let input = input
  178    191   
            .downcast::<crate::operation::streaming_traits::StreamingTraitsInput>()
  179    192   
            .expect("correct type");
  180    193   
        let _header_serialization_settings = _cfg
  181    194   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  182    195   
            .cloned()
  183    196   
            .unwrap_or_default();
  184    197   
        let mut request_builder = {
  185    198   
            fn uri_base(
  186    199   
                _input: &crate::operation::streaming_traits::StreamingTraitsInput,
  187    200   
                output: &mut ::std::string::String,
  188    201   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  189    202   
                use ::std::fmt::Write as _;
  190    203   
                ::std::write!(output, "/StreamingTraits").expect("formatting should succeed");
  191    204   
                ::std::result::Result::Ok(())
  192    205   
            }
  193    206   
            #[allow(clippy::unnecessary_wraps)]
  194    207   
            fn update_http_builder(
  195    208   
                input: &crate::operation::streaming_traits::StreamingTraitsInput,
  196    209   
                builder: ::http::request::Builder,
  197    210   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  198    211   
                let mut uri = ::std::string::String::new();
  199    212   
                uri_base(input, &mut uri)?;
  200    213   
                let builder = crate::protocol_serde::shape_streaming_traits::ser_streaming_traits_headers(input, builder)?;
  201    214   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  202    215   
            }
  203    216   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  204    217   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/octet-stream");
  205    218   
            builder
  206    219   
        };
  207    220   
        let body = crate::protocol_serde::shape_streaming_traits_input::ser_blob_http_payload(input.blob)?.into_inner();
  208    221   
        if let Some(content_length) = body.content_length() {
  209    222   
            let content_length = content_length.to_string();
  210    223   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  211    224   
        }
  212    225   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  213    226   
    }
  214    227   
}
         228  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  215    229   
#[derive(Debug)]
  216    230   
struct StreamingTraitsEndpointParamsInterceptor;
  217    231   
  218    232   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamingTraitsEndpointParamsInterceptor {
  219    233   
    fn name(&self) -> &'static str {
  220    234   
        "StreamingTraitsEndpointParamsInterceptor"
  221    235   
    }
  222    236   
  223    237   
    fn read_before_execution(
  224    238   
        &self,
  225    239   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  226    240   
            '_,
  227    241   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  228    242   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  229    243   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  230    244   
        >,
  231    245   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  232    246   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  233    247   
        let _input = context
  234    248   
            .input()
  235    249   
            .downcast_ref::<StreamingTraitsInput>()
  236    250   
            .ok_or("failed to downcast to StreamingTraitsInput")?;
  237    251   
  238    252   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  239    253   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  240    254   
        })?;
  241    255   
        cfg.interceptor_state()
  242    256   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  243    257   
        ::std::result::Result::Ok(())
  244    258   
    }
  245    259   
}
  246    260   
  247    261   
// The get_* functions below are generated from JMESPath expressions in the
  248    262   
// operationContextParams trait. They target the operation's input shape.
  249    263   
         264  +
/* RustType.kt:516 */
  250    265   
#[allow(unreachable_code, unused_variables)]
         266  +
/* RustType.kt:516 */
  251    267   
#[cfg(test)]
         268  +
/* ProtocolTestGenerator.kt:98 */
  252    269   
mod streaming_traits_test {
  253    270   
  254    271   
    /// Serializes a blob in the HTTP payload
  255    272   
    /// Test ID: RestJsonStreamingTraitsWithBlob
  256    273   
    #[::tokio::test]
  257    274   
    #[::tracing_test::traced_test]
  258    275   
    async fn rest_json_streaming_traits_with_blob_request() {
  259    276   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  260    277   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  261    278   
@@ -377,394 +506,582 @@
  397    414   
        let parsed = parsed
  398    415   
            .expect("should be successful response")
  399    416   
            .downcast::<crate::operation::streaming_traits::StreamingTraitsOutput>()
  400    417   
            .unwrap();
  401    418   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  402    419   
        ::pretty_assertions::assert_eq!(
  403    420   
            parsed.blob.collect().await.unwrap().into_bytes(),
  404    421   
            expected_output.blob.collect().await.unwrap().into_bytes()
  405    422   
        );
  406    423   
    }
         424  +
         425  +
    /* ProtocolTestGenerator.kt:98 */
  407    426   
}
  408    427   
         428  +
/* OperationErrorGenerator.kt:79 */
  409    429   
/// Error type for the `StreamingTraitsError` operation.
         430  +
/* RustType.kt:516 */
  410    431   
#[non_exhaustive]
         432  +
/* RustType.kt:516 */
  411    433   
#[derive(::std::fmt::Debug)]
  412         -
pub enum StreamingTraitsError {
         434  +
pub /* OperationErrorGenerator.kt:81 */ enum StreamingTraitsError {
         435  +
    /* OperationErrorGenerator.kt:88 */
  413    436   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  414    437   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  415    438   
    variable wildcard pattern and check `.code()`:
  416    439   
     \
  417    440   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  418    441   
     \
  419    442   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StreamingTraitsError) for what information is available for the error.")]
  420    443   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         444  +
    /* OperationErrorGenerator.kt:81 */
  421    445   
}
         446  +
/* OperationErrorGenerator.kt:218 */
  422    447   
impl StreamingTraitsError {
         448  +
    /* OperationErrorGenerator.kt:219 */
  423    449   
    /// Creates the `StreamingTraitsError::Unhandled` variant from any error type.
  424    450   
    pub fn unhandled(
  425    451   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  426    452   
    ) -> Self {
  427    453   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  428    454   
            source: err.into(),
  429    455   
            meta: ::std::default::Default::default(),
  430    456   
        })
  431    457   
    }
  432    458   
  433    459   
    /// Creates the `StreamingTraitsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  434    460   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  435    461   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  436    462   
            source: err.clone().into(),
  437    463   
            meta: err,
  438    464   
        })
  439    465   
    }
  440         -
    ///
         466  +
    /// /* OperationErrorGenerator.kt:236 */
  441    467   
    /// Returns error metadata, which includes the error code, message,
  442    468   
    /// request ID, and potentially additional information.
  443    469   
    ///
         470  +
    /* OperationErrorGenerator.kt:242 */
  444    471   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         472  +
        /* OperationErrorGenerator.kt:243 */
  445    473   
        match self {
  446         -
            Self::Unhandled(e) => &e.meta,
         474  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         475  +
            /* OperationErrorGenerator.kt:243 */
  447    476   
        }
         477  +
        /* OperationErrorGenerator.kt:242 */
  448    478   
    }
         479  +
    /* OperationErrorGenerator.kt:218 */
  449    480   
}
         481  +
/* OperationErrorGenerator.kt:269 */
  450    482   
impl ::std::error::Error for StreamingTraitsError {
         483  +
    /* OperationErrorGenerator.kt:270 */
  451    484   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         485  +
        /* OperationErrorGenerator.kt:318 */
  452    486   
        match self {
  453         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         487  +
            /* OperationErrorGenerator.kt:326 */
         488  +
            Self::Unhandled(_inner) => {
         489  +
                /* OperationErrorGenerator.kt:279 */
         490  +
                ::std::option::Option::Some(&*_inner.source)
         491  +
                /* OperationErrorGenerator.kt:326 */
         492  +
            } /* OperationErrorGenerator.kt:318 */
  454    493   
        }
         494  +
        /* OperationErrorGenerator.kt:270 */
  455    495   
    }
         496  +
    /* OperationErrorGenerator.kt:269 */
  456    497   
}
         498  +
/* OperationErrorGenerator.kt:133 */
  457    499   
impl ::std::fmt::Display for StreamingTraitsError {
         500  +
    /* OperationErrorGenerator.kt:134 */
  458    501   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         502  +
        /* OperationErrorGenerator.kt:318 */
  459    503   
        match self {
         504  +
            /* OperationErrorGenerator.kt:326 */
  460    505   
            Self::Unhandled(_inner) => {
         506  +
                /* OperationErrorGenerator.kt:139 */
  461    507   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  462    508   
                    write!(f, "unhandled error ({code})")
  463    509   
                } else {
  464    510   
                    f.write_str("unhandled error")
  465    511   
                }
         512  +
                /* OperationErrorGenerator.kt:326 */
         513  +
            } /* OperationErrorGenerator.kt:318 */
  466    514   
        }
         515  +
        /* OperationErrorGenerator.kt:134 */
  467    516   
    }
  468         -
    }
         517  +
    /* OperationErrorGenerator.kt:133 */
  469    518   
}
         519  +
/* OperationErrorGenerator.kt:182 */
  470    520   
impl ::aws_smithy_types::retry::ProvideErrorKind for StreamingTraitsError {
         521  +
    /* OperationErrorGenerator.kt:186 */
  471    522   
    fn code(&self) -> ::std::option::Option<&str> {
         523  +
        /* OperationErrorGenerator.kt:187 */
  472    524   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         525  +
        /* OperationErrorGenerator.kt:186 */
  473    526   
    }
         527  +
    /* OperationErrorGenerator.kt:190 */
  474    528   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         529  +
        /* OperationErrorGenerator.kt:197 */
  475    530   
        ::std::option::Option::None
         531  +
        /* OperationErrorGenerator.kt:190 */
  476    532   
    }
         533  +
    /* OperationErrorGenerator.kt:182 */
  477    534   
}
         535  +
/* OperationErrorGenerator.kt:163 */
  478    536   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StreamingTraitsError {
         537  +
    /* OperationErrorGenerator.kt:164 */
  479    538   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         539  +
        /* OperationErrorGenerator.kt:318 */
  480    540   
        match self {
  481         -
            Self::Unhandled(_inner) => &_inner.meta,
         541  +
            /* OperationErrorGenerator.kt:326 */
         542  +
            Self::Unhandled(_inner) => {
         543  +
                /* OperationErrorGenerator.kt:168 */
         544  +
                &_inner.meta
         545  +
                /* OperationErrorGenerator.kt:326 */
         546  +
            } /* OperationErrorGenerator.kt:318 */
  482    547   
        }
         548  +
        /* OperationErrorGenerator.kt:164 */
  483    549   
    }
         550  +
    /* OperationErrorGenerator.kt:163 */
  484    551   
}
         552  +
/* OperationErrorGenerator.kt:109 */
  485    553   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StreamingTraitsError {
         554  +
    /* OperationErrorGenerator.kt:110 */
  486    555   
    fn create_unhandled_error(
  487    556   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  488    557   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  489    558   
    ) -> Self {
         559  +
        /* OperationErrorGenerator.kt:121 */
  490    560   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  491    561   
            source,
  492    562   
            meta: meta.unwrap_or_default(),
  493    563   
        })
         564  +
        /* OperationErrorGenerator.kt:110 */
  494    565   
    }
         566  +
    /* OperationErrorGenerator.kt:109 */
  495    567   
}
  496    568   
         569  +
/* CodegenDelegator.kt:255 */
  497    570   
pub use crate::operation::streaming_traits::_streaming_traits_output::StreamingTraitsOutput;
  498    571   
         572  +
/* CodegenDelegator.kt:255 */
  499    573   
pub use crate::operation::streaming_traits::_streaming_traits_input::StreamingTraitsInput;
  500    574   
         575  +
/* RustModule.kt:172 */
  501    576   
mod _streaming_traits_input;
  502    577   
         578  +
/* RustModule.kt:172 */
  503    579   
mod _streaming_traits_output;
  504    580   
  505         -
/// Builders
         581  +
/// /* CodegenDelegator.kt:51 */Builders
  506    582   
pub mod builders;

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

@@ -1,1 +73,138 @@
    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::fmt::Debug)]
    5         -
pub struct StreamingTraitsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StreamingTraitsInput {
           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: ::aws_smithy_types::byte_stream::ByteStream,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl StreamingTraitsInput {
          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) -> &::aws_smithy_types::byte_stream::ByteStream {
          31  +
        /* StructureGenerator.kt:172 */
   18     32   
        &self.blob
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl StreamingTraitsInput {
   22         -
    /// Creates a new builder-style object to manufacture [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct StreamingTraitsInputBuilder {
   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) blob: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
          59  +
    /* BuilderGenerator.kt:345 */
   34     60   
}
          61  +
/* BuilderGenerator.kt:355 */
   35     62   
impl StreamingTraitsInputBuilder {
          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   
    }
          90  +
    /* BuilderGenerator.kt:286 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:291 */
   51     93   
    pub fn blob(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
          94  +
        /* BuilderGenerator.kt:292 */
   52     95   
        self.blob = ::std::option::Option::Some(input);
          96  +
        /* BuilderGenerator.kt:293 */
   53     97   
        self
          98  +
        /* BuilderGenerator.kt:291 */
   54     99   
    }
         100  +
    /* BuilderGenerator.kt:312 */
   55    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:314 */
   56    103   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
         104  +
        /* BuilderGenerator.kt:315 */
   57    105   
        self.blob = input;
   58    106   
        self
         107  +
        /* BuilderGenerator.kt:314 */
   59    108   
    }
         109  +
    /* BuilderGenerator.kt:334 */
   60    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:336 */
   61    112   
    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
         113  +
        /* BuilderGenerator.kt:337 */
   62    114   
        &self.blob
         115  +
        /* BuilderGenerator.kt:336 */
   63    116   
    }
   64         -
    /// Consumes the builder and constructs a [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
         117  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StreamingTraitsInput`](crate::operation::streaming_traits::StreamingTraitsInput).
         118  +
    /* BuilderGenerator.kt:253 */
   65    119   
    pub fn build(
   66    120   
        self,
   67    121   
    ) -> ::std::result::Result<crate::operation::streaming_traits::StreamingTraitsInput, ::aws_smithy_types::error::operation::BuildError> {
   68         -
        ::std::result::Result::Ok(crate::operation::streaming_traits::StreamingTraitsInput {
   69         -
            foo: self.foo,
   70         -
            blob: self.blob.unwrap_or_default(),
   71         -
        })
         122  +
        /* BuilderGenerator.kt:254 */
         123  +
        ::std::result::Result::Ok(
         124  +
            /* BuilderGenerator.kt:477 */
         125  +
            crate::operation::streaming_traits::StreamingTraitsInput {
         126  +
                /* BuilderGenerator.kt:481 */ foo: self.foo,
         127  +
                /* BuilderGenerator.kt:481 */
         128  +
                blob: self
         129  +
                    .blob
         130  +
                    /* BuilderGenerator.kt:487 */
         131  +
                    .unwrap_or_default(),
         132  +
                /* BuilderGenerator.kt:477 */
         133  +
            }, /* BuilderGenerator.kt:254 */
         134  +
        )
         135  +
        /* BuilderGenerator.kt:253 */
   72    136   
    }
         137  +
    /* BuilderGenerator.kt:355 */
   73    138   
}

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

@@ -1,1 +71,133 @@
    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::fmt::Debug)]
    5         -
pub struct StreamingTraitsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StreamingTraitsOutput {
           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: ::aws_smithy_types::byte_stream::ByteStream,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl StreamingTraitsOutput {
          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) -> &::aws_smithy_types::byte_stream::ByteStream {
          31  +
        /* StructureGenerator.kt:172 */
   18     32   
        &self.blob
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl StreamingTraitsOutput {
   22         -
    /// Creates a new builder-style object to manufacture [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::streaming_traits::builders::StreamingTraitsOutputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::streaming_traits::builders::StreamingTraitsOutputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct StreamingTraitsOutputBuilder {
   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) blob: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
          59  +
    /* BuilderGenerator.kt:345 */
   34     60   
}
          61  +
/* BuilderGenerator.kt:355 */
   35     62   
impl StreamingTraitsOutputBuilder {
          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   
    }
          90  +
    /* BuilderGenerator.kt:286 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:291 */
   51     93   
    pub fn blob(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
          94  +
        /* BuilderGenerator.kt:292 */
   52     95   
        self.blob = ::std::option::Option::Some(input);
          96  +
        /* BuilderGenerator.kt:293 */
   53     97   
        self
          98  +
        /* BuilderGenerator.kt:291 */
   54     99   
    }
         100  +
    /* BuilderGenerator.kt:312 */
   55    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:314 */
   56    103   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
         104  +
        /* BuilderGenerator.kt:315 */
   57    105   
        self.blob = input;
   58    106   
        self
         107  +
        /* BuilderGenerator.kt:314 */
   59    108   
    }
         109  +
    /* BuilderGenerator.kt:334 */
   60    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:336 */
   61    112   
    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
         113  +
        /* BuilderGenerator.kt:337 */
   62    114   
        &self.blob
         115  +
        /* BuilderGenerator.kt:336 */
   63    116   
    }
   64         -
    /// Consumes the builder and constructs a [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
         117  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StreamingTraitsOutput`](crate::operation::streaming_traits::StreamingTraitsOutput).
         118  +
    /* BuilderGenerator.kt:253 */
   65    119   
    pub fn build(self) -> crate::operation::streaming_traits::StreamingTraitsOutput {
         120  +
        /* BuilderGenerator.kt:477 */
   66    121   
        crate::operation::streaming_traits::StreamingTraitsOutput {
   67         -
            foo: self.foo,
   68         -
            blob: self.blob.unwrap_or_default(),
         122  +
            /* BuilderGenerator.kt:481 */ foo: self.foo,
         123  +
            /* BuilderGenerator.kt:481 */
         124  +
            blob: self
         125  +
                .blob
         126  +
                /* BuilderGenerator.kt:487 */
         127  +
                .unwrap_or_default(),
         128  +
            /* BuilderGenerator.kt:477 */
   69    129   
        }
         130  +
        /* BuilderGenerator.kt:253 */
   70    131   
    }
         132  +
    /* BuilderGenerator.kt:355 */
   71    133   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/streaming_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::streaming_traits::_streaming_traits_output::StreamingTraitsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::streaming_traits::_streaming_traits_input::StreamingTraitsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder {
    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::streaming_traits::StreamingTraitsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::streaming_traits::StreamingTraitsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.streaming_traits();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `StreamingTraits`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `StreamingTraits`.
   24     27   
///
   25         -
/// This examples serializes a streaming blob shape in the request body. In this example, no JSON document is synthesized because the payload is not a structure or a union type.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This examples serializes a streaming blob shape in the request body. 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::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct StreamingTraitsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder,
   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::streaming_traits::StreamingTraitsOutput,
   35     41   
        crate::operation::streaming_traits::StreamingTraitsError,
   36     42   
    > for StreamingTraitsFluentBuilder
   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::streaming_traits::StreamingTraitsOutput,
   44     50   
            crate::operation::streaming_traits::StreamingTraitsError,
   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 StreamingTraitsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `StreamingTraitsFluentBuilder`.
   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 StreamingTraits as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::streaming_traits::builders::StreamingTraitsInputBuilder {
   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::streaming_traits::StreamingTraitsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::streaming_traits::StreamingTraitsError,
   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::streaming_traits::StreamingTraits::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::streaming_traits::StreamingTraits::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::streaming_traits::StreamingTraitsOutput,
   97    107   
        crate::operation::streaming_traits::StreamingTraitsError,
   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::byte_stream::ByteStream) -> 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::byte_stream::ByteStream>) -> 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::byte_stream::ByteStream> {
  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/streaming_traits_require_length.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 `StreamingTraitsRequireLength`.
           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 StreamingTraitsRequireLength;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl StreamingTraitsRequireLength {
    7         -
    /// Creates a new `StreamingTraitsRequireLength`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `StreamingTraitsRequireLength`
          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::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   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 StreamingTraitsRequireLength {
   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("StreamingTraitsRequireLength");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            StreamingTraitsRequireLengthRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            StreamingTraitsRequireLengthResponseDeserializer,
  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   
            "StreamingTraitsRequireLength",
  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("StreamingTraitsRequireLength")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(StreamingTraitsRequireLengthEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
  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 StreamingTraitsRequireLengthResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StreamingTraitsRequireLengthResponseDeserializer {
  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_streaming_traits_require_length::de_streaming_traits_require_length_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_streaming_traits_require_length::de_streaming_traits_require_length_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 StreamingTraitsRequireLengthRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamingTraitsRequireLengthRequestSerializer {
  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::streaming_traits_require_length::StreamingTraitsRequireLengthInput>()
  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::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
  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, "/StreamingTraitsRequireLength").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::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
  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 =
  190    203   
                    crate::protocol_serde::shape_streaming_traits_require_length::ser_streaming_traits_require_length_headers(input, builder)?;
  191    204   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192    205   
            }
  193    206   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  194    207   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/octet-stream");
  195    208   
            builder
  196    209   
        };
  197    210   
        let body = crate::protocol_serde::shape_streaming_traits_require_length_input::ser_blob_http_payload(input.blob)?.into_inner();
  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 StreamingTraitsRequireLengthEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamingTraitsRequireLengthEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "StreamingTraitsRequireLengthEndpointParamsInterceptor"
  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::<StreamingTraitsRequireLengthInput>()
  226    240   
            .ok_or("failed to downcast to StreamingTraitsRequireLengthInput")?;
  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 streaming_traits_require_length_test {
  243    260   
  244    261   
    /// Serializes a blob in the HTTP payload with a required length
  245    262   
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithBlob
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn rest_json_streaming_traits_require_length_with_blob_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   
@@ -273,290 +402,478 @@
  293    310   
        let http_request = request_receiver.expect_request();
  294    311   
        let expected_headers = [("X-Foo", "Foo")];
  295    312   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  296    313   
        let body = http_request.body().bytes().expect("body should be strict");
  297    314   
        // No body.
  298    315   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  299    316   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  300    317   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  301    318   
        ::pretty_assertions::assert_eq!(uri.path(), "/StreamingTraitsRequireLength", "path was incorrect");
  302    319   
    }
         320  +
         321  +
    /* ProtocolTestGenerator.kt:98 */
  303    322   
}
  304    323   
         324  +
/* OperationErrorGenerator.kt:79 */
  305    325   
/// Error type for the `StreamingTraitsRequireLengthError` operation.
         326  +
/* RustType.kt:516 */
  306    327   
#[non_exhaustive]
         328  +
/* RustType.kt:516 */
  307    329   
#[derive(::std::fmt::Debug)]
  308         -
pub enum StreamingTraitsRequireLengthError {
         330  +
pub /* OperationErrorGenerator.kt:81 */ enum StreamingTraitsRequireLengthError {
         331  +
    /* OperationErrorGenerator.kt:88 */
  309    332   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  310    333   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  311    334   
    variable wildcard pattern and check `.code()`:
  312    335   
     \
  313    336   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  314    337   
     \
  315    338   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StreamingTraitsRequireLengthError) for what information is available for the error.")]
  316    339   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         340  +
    /* OperationErrorGenerator.kt:81 */
  317    341   
}
         342  +
/* OperationErrorGenerator.kt:218 */
  318    343   
impl StreamingTraitsRequireLengthError {
         344  +
    /* OperationErrorGenerator.kt:219 */
  319    345   
    /// Creates the `StreamingTraitsRequireLengthError::Unhandled` variant from any error type.
  320    346   
    pub fn unhandled(
  321    347   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  322    348   
    ) -> Self {
  323    349   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  324    350   
            source: err.into(),
  325    351   
            meta: ::std::default::Default::default(),
  326    352   
        })
  327    353   
    }
  328    354   
  329    355   
    /// Creates the `StreamingTraitsRequireLengthError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  330    356   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  331    357   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  332    358   
            source: err.clone().into(),
  333    359   
            meta: err,
  334    360   
        })
  335    361   
    }
  336         -
    ///
         362  +
    /// /* OperationErrorGenerator.kt:236 */
  337    363   
    /// Returns error metadata, which includes the error code, message,
  338    364   
    /// request ID, and potentially additional information.
  339    365   
    ///
         366  +
    /* OperationErrorGenerator.kt:242 */
  340    367   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         368  +
        /* OperationErrorGenerator.kt:243 */
  341    369   
        match self {
  342         -
            Self::Unhandled(e) => &e.meta,
         370  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         371  +
            /* OperationErrorGenerator.kt:243 */
  343    372   
        }
         373  +
        /* OperationErrorGenerator.kt:242 */
  344    374   
    }
         375  +
    /* OperationErrorGenerator.kt:218 */
  345    376   
}
         377  +
/* OperationErrorGenerator.kt:269 */
  346    378   
impl ::std::error::Error for StreamingTraitsRequireLengthError {
         379  +
    /* OperationErrorGenerator.kt:270 */
  347    380   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         381  +
        /* OperationErrorGenerator.kt:318 */
  348    382   
        match self {
  349         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         383  +
            /* OperationErrorGenerator.kt:326 */
         384  +
            Self::Unhandled(_inner) => {
         385  +
                /* OperationErrorGenerator.kt:279 */
         386  +
                ::std::option::Option::Some(&*_inner.source)
         387  +
                /* OperationErrorGenerator.kt:326 */
         388  +
            } /* OperationErrorGenerator.kt:318 */
  350    389   
        }
         390  +
        /* OperationErrorGenerator.kt:270 */
  351    391   
    }
         392  +
    /* OperationErrorGenerator.kt:269 */
  352    393   
}
         394  +
/* OperationErrorGenerator.kt:133 */
  353    395   
impl ::std::fmt::Display for StreamingTraitsRequireLengthError {
         396  +
    /* OperationErrorGenerator.kt:134 */
  354    397   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         398  +
        /* OperationErrorGenerator.kt:318 */
  355    399   
        match self {
         400  +
            /* OperationErrorGenerator.kt:326 */
  356    401   
            Self::Unhandled(_inner) => {
         402  +
                /* OperationErrorGenerator.kt:139 */
  357    403   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  358    404   
                    write!(f, "unhandled error ({code})")
  359    405   
                } else {
  360    406   
                    f.write_str("unhandled error")
  361    407   
                }
         408  +
                /* OperationErrorGenerator.kt:326 */
         409  +
            } /* OperationErrorGenerator.kt:318 */
  362    410   
        }
         411  +
        /* OperationErrorGenerator.kt:134 */
  363    412   
    }
  364         -
    }
         413  +
    /* OperationErrorGenerator.kt:133 */
  365    414   
}
         415  +
/* OperationErrorGenerator.kt:182 */
  366    416   
impl ::aws_smithy_types::retry::ProvideErrorKind for StreamingTraitsRequireLengthError {
         417  +
    /* OperationErrorGenerator.kt:186 */
  367    418   
    fn code(&self) -> ::std::option::Option<&str> {
         419  +
        /* OperationErrorGenerator.kt:187 */
  368    420   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         421  +
        /* OperationErrorGenerator.kt:186 */
  369    422   
    }
         423  +
    /* OperationErrorGenerator.kt:190 */
  370    424   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         425  +
        /* OperationErrorGenerator.kt:197 */
  371    426   
        ::std::option::Option::None
         427  +
        /* OperationErrorGenerator.kt:190 */
  372    428   
    }
         429  +
    /* OperationErrorGenerator.kt:182 */
  373    430   
}
         431  +
/* OperationErrorGenerator.kt:163 */
  374    432   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StreamingTraitsRequireLengthError {
         433  +
    /* OperationErrorGenerator.kt:164 */
  375    434   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         435  +
        /* OperationErrorGenerator.kt:318 */
  376    436   
        match self {
  377         -
            Self::Unhandled(_inner) => &_inner.meta,
         437  +
            /* OperationErrorGenerator.kt:326 */
         438  +
            Self::Unhandled(_inner) => {
         439  +
                /* OperationErrorGenerator.kt:168 */
         440  +
                &_inner.meta
         441  +
                /* OperationErrorGenerator.kt:326 */
         442  +
            } /* OperationErrorGenerator.kt:318 */
  378    443   
        }
         444  +
        /* OperationErrorGenerator.kt:164 */
  379    445   
    }
         446  +
    /* OperationErrorGenerator.kt:163 */
  380    447   
}
         448  +
/* OperationErrorGenerator.kt:109 */
  381    449   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StreamingTraitsRequireLengthError {
         450  +
    /* OperationErrorGenerator.kt:110 */
  382    451   
    fn create_unhandled_error(
  383    452   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  384    453   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  385    454   
    ) -> Self {
         455  +
        /* OperationErrorGenerator.kt:121 */
  386    456   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  387    457   
            source,
  388    458   
            meta: meta.unwrap_or_default(),
  389    459   
        })
         460  +
        /* OperationErrorGenerator.kt:110 */
  390    461   
    }
         462  +
    /* OperationErrorGenerator.kt:109 */
  391    463   
}
  392    464   
         465  +
/* CodegenDelegator.kt:255 */
  393    466   
pub use crate::operation::streaming_traits_require_length::_streaming_traits_require_length_output::StreamingTraitsRequireLengthOutput;
  394    467   
         468  +
/* CodegenDelegator.kt:255 */
  395    469   
pub use crate::operation::streaming_traits_require_length::_streaming_traits_require_length_input::StreamingTraitsRequireLengthInput;
  396    470   
         471  +
/* RustModule.kt:172 */
  397    472   
mod _streaming_traits_require_length_input;
  398    473   
         474  +
/* RustModule.kt:172 */
  399    475   
mod _streaming_traits_require_length_output;
  400    476   
  401         -
/// Builders
         477  +
/// /* CodegenDelegator.kt:51 */Builders
  402    478   
pub mod builders;

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

@@ -1,1 +76,141 @@
    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::fmt::Debug)]
    5         -
pub struct StreamingTraitsRequireLengthInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StreamingTraitsRequireLengthInput {
           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: ::aws_smithy_types::byte_stream::ByteStream,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl StreamingTraitsRequireLengthInput {
          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) -> &::aws_smithy_types::byte_stream::ByteStream {
          31  +
        /* StructureGenerator.kt:172 */
   18     32   
        &self.blob
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl StreamingTraitsRequireLengthInput {
   22         -
    /// Creates a new builder-style object to manufacture [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct StreamingTraitsRequireLengthInputBuilder {
   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) blob: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
          59  +
    /* BuilderGenerator.kt:345 */
   34     60   
}
          61  +
/* BuilderGenerator.kt:355 */
   35     62   
impl StreamingTraitsRequireLengthInputBuilder {
          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   
    }
          90  +
    /* BuilderGenerator.kt:286 */
   50     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:291 */
   51     93   
    pub fn blob(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
          94  +
        /* BuilderGenerator.kt:292 */
   52     95   
        self.blob = ::std::option::Option::Some(input);
          96  +
        /* BuilderGenerator.kt:293 */
   53     97   
        self
          98  +
        /* BuilderGenerator.kt:291 */
   54     99   
    }
         100  +
    /* BuilderGenerator.kt:312 */
   55    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:314 */
   56    103   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
         104  +
        /* BuilderGenerator.kt:315 */
   57    105   
        self.blob = input;
   58    106   
        self
         107  +
        /* BuilderGenerator.kt:314 */
   59    108   
    }
         109  +
    /* BuilderGenerator.kt:334 */
   60    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:336 */
   61    112   
    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
         113  +
        /* BuilderGenerator.kt:337 */
   62    114   
        &self.blob
         115  +
        /* BuilderGenerator.kt:336 */
   63    116   
    }
   64         -
    /// Consumes the builder and constructs a [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
         117  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StreamingTraitsRequireLengthInput`](crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput).
         118  +
    /* BuilderGenerator.kt:253 */
   65    119   
    pub fn build(
   66    120   
        self,
   67    121   
    ) -> ::std::result::Result<
   68    122   
        crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput,
   69    123   
        ::aws_smithy_types::error::operation::BuildError,
   70    124   
    > {
   71         -
        ::std::result::Result::Ok(crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput {
   72         -
            foo: self.foo,
   73         -
            blob: self.blob.unwrap_or_default(),
   74         -
        })
         125  +
        /* BuilderGenerator.kt:254 */
         126  +
        ::std::result::Result::Ok(
         127  +
            /* BuilderGenerator.kt:477 */
         128  +
            crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthInput {
         129  +
                /* BuilderGenerator.kt:481 */ foo: self.foo,
         130  +
                /* BuilderGenerator.kt:481 */
         131  +
                blob: self
         132  +
                    .blob
         133  +
                    /* BuilderGenerator.kt:487 */
         134  +
                    .unwrap_or_default(),
         135  +
                /* BuilderGenerator.kt:477 */
         136  +
            }, /* BuilderGenerator.kt:254 */
         137  +
        )
         138  +
        /* BuilderGenerator.kt:253 */
   75    139   
    }
         140  +
    /* BuilderGenerator.kt:355 */
   76    141   
}

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/streaming_traits_require_length/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::streaming_traits_require_length::_streaming_traits_require_length_output::StreamingTraitsRequireLengthOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::streaming_traits_require_length::_streaming_traits_require_length_input::StreamingTraitsRequireLengthInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder {
    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::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.streaming_traits_require_length();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `StreamingTraitsRequireLength`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `StreamingTraitsRequireLength`.
   24     27   
///
   25         -
/// This examples serializes a streaming blob shape with a required content length in the request body. In this example, no JSON document is synthesized because the payload is not a structure or a union type.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This examples serializes a streaming blob shape with a required content length in the request body. 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::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct StreamingTraitsRequireLengthFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder,
   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::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   35     41   
        crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   36     42   
    > for StreamingTraitsRequireLengthFluentBuilder
   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::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   44     50   
            crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   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 StreamingTraitsRequireLengthFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `StreamingTraitsRequireLengthFluentBuilder`.
   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 StreamingTraitsRequireLength as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::streaming_traits_require_length::builders::StreamingTraitsRequireLengthInputBuilder {
   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::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   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::streaming_traits_require_length::StreamingTraitsRequireLength::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::streaming_traits_require_length::StreamingTraitsRequireLength::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::streaming_traits_require_length::StreamingTraitsRequireLengthOutput,
   97    107   
        crate::operation::streaming_traits_require_length::StreamingTraitsRequireLengthError,
   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::byte_stream::ByteStream) -> 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::byte_stream::ByteStream>) -> 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::byte_stream::ByteStream> {
  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/streaming_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 `StreamingTraitsWithMediaType`.
           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 StreamingTraitsWithMediaType;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl StreamingTraitsWithMediaType {
    7         -
    /// Creates a new `StreamingTraitsWithMediaType`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `StreamingTraitsWithMediaType`
          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::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +284,301 @@
   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 StreamingTraitsWithMediaType {
   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("StreamingTraitsWithMediaType");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            StreamingTraitsWithMediaTypeRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            StreamingTraitsWithMediaTypeResponseDeserializer,
  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   
            "StreamingTraitsWithMediaType",
  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("StreamingTraitsWithMediaType")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(StreamingTraitsWithMediaTypeEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeError,
  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 StreamingTraitsWithMediaTypeResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StreamingTraitsWithMediaTypeResponseDeserializer {
  139    151   
    fn deserialize_streaming(
  140    152   
        &self,
  141    153   
        response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
  143    155   
        #[allow(unused_mut)]
  144    156   
        let mut force_error = false;
  145    157   
  146    158   
        // If this is an error, defer to the non-streaming parser
  147    159   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  148    160   
            return ::std::option::Option::None;
  149    161   
        }
  150    162   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  151    163   
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_response(response),
  152    164   
        ))
  153    165   
    }
  154    166   
  155    167   
    fn deserialize_nonstreaming(
  156    168   
        &self,
  157    169   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  158    170   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  159    171   
        // For streaming operations, we only hit this case if its an error
  160    172   
        let body = response.body().bytes().expect("body loaded");
  161    173   
        crate::protocol_serde::type_erase_result(
  162    174   
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_error(
  163    175   
                response.status().as_u16(),
  164    176   
                response.headers(),
  165    177   
                body,
  166    178   
            ),
  167    179   
        )
  168    180   
    }
  169    181   
}
         182  +
/* RequestSerializerGenerator.kt:67 */
  170    183   
#[derive(Debug)]
  171    184   
struct StreamingTraitsWithMediaTypeRequestSerializer;
  172    185   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamingTraitsWithMediaTypeRequestSerializer {
  173    186   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  174    187   
    fn serialize_input(
  175    188   
        &self,
  176    189   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  177    190   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  178    191   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  179    192   
        let input = input
  180    193   
            .downcast::<crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput>()
  181    194   
            .expect("correct type");
  182    195   
        let _header_serialization_settings = _cfg
  183    196   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  184    197   
            .cloned()
  185    198   
            .unwrap_or_default();
  186    199   
        let mut request_builder = {
  187    200   
            fn uri_base(
  188    201   
                _input: &crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput,
  189    202   
                output: &mut ::std::string::String,
  190    203   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  191    204   
                use ::std::fmt::Write as _;
  192    205   
                ::std::write!(output, "/StreamingTraitsWithMediaType").expect("formatting should succeed");
  193    206   
                ::std::result::Result::Ok(())
  194    207   
            }
  195    208   
            #[allow(clippy::unnecessary_wraps)]
  196    209   
            fn update_http_builder(
  197    210   
                input: &crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeInput,
  198    211   
                builder: ::http::request::Builder,
  199    212   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  200    213   
                let mut uri = ::std::string::String::new();
  201    214   
                uri_base(input, &mut uri)?;
  202    215   
                let builder =
  203    216   
                    crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_headers(input, builder)?;
  204    217   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  205    218   
            }
  206    219   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  207    220   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "text/plain");
  208    221   
            builder
  209    222   
        };
  210    223   
        let body = crate::protocol_serde::shape_streaming_traits_with_media_type_input::ser_blob_http_payload(input.blob)?.into_inner();
  211    224   
        if let Some(content_length) = body.content_length() {
  212    225   
            let content_length = content_length.to_string();
  213    226   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  214    227   
        }
  215    228   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  216    229   
    }
  217    230   
}
         231  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  218    232   
#[derive(Debug)]
  219    233   
struct StreamingTraitsWithMediaTypeEndpointParamsInterceptor;
  220    234   
  221    235   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamingTraitsWithMediaTypeEndpointParamsInterceptor {
  222    236   
    fn name(&self) -> &'static str {
  223    237   
        "StreamingTraitsWithMediaTypeEndpointParamsInterceptor"
  224    238   
    }
  225    239   
  226    240   
    fn read_before_execution(
  227    241   
        &self,
  228    242   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  229    243   
            '_,
  230    244   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  231    245   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  232    246   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  233    247   
        >,
  234    248   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  235    249   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  236    250   
        let _input = context
  237    251   
            .input()
  238    252   
            .downcast_ref::<StreamingTraitsWithMediaTypeInput>()
  239    253   
            .ok_or("failed to downcast to StreamingTraitsWithMediaTypeInput")?;
  240    254   
  241    255   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  242    256   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  243    257   
        })?;
  244    258   
        cfg.interceptor_state()
  245    259   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  246    260   
        ::std::result::Result::Ok(())
  247    261   
    }
  248    262   
}
  249    263   
  250    264   
// The get_* functions below are generated from JMESPath expressions in the
  251    265   
// operationContextParams trait. They target the operation's input shape.
  252    266   
         267  +
/* RustType.kt:516 */
  253    268   
#[allow(unreachable_code, unused_variables)]
         269  +
/* RustType.kt:516 */
  254    270   
#[cfg(test)]
         271  +
/* ProtocolTestGenerator.kt:98 */
  255    272   
mod streaming_traits_with_media_type_test {
  256    273   
  257    274   
    /// Serializes a blob in the HTTP payload with a content-type
  258    275   
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
  259    276   
    #[::tokio::test]
  260    277   
    #[::tracing_test::traced_test]
  261    278   
    async fn rest_json_streaming_traits_with_media_type_with_blob_request() {
  262    279   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  263    280   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  264    281   
@@ -308,325 +437,513 @@
  328    345   
        let parsed = parsed
  329    346   
            .expect("should be successful response")
  330    347   
            .downcast::<crate::operation::streaming_traits_with_media_type::StreamingTraitsWithMediaTypeOutput>()
  331    348   
            .unwrap();
  332    349   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  333    350   
        ::pretty_assertions::assert_eq!(
  334    351   
            parsed.blob.collect().await.unwrap().into_bytes(),
  335    352   
            expected_output.blob.collect().await.unwrap().into_bytes()
  336    353   
        );
  337    354   
    }
         355  +
         356  +
    /* ProtocolTestGenerator.kt:98 */
  338    357   
}
  339    358   
         359  +
/* OperationErrorGenerator.kt:79 */
  340    360   
/// Error type for the `StreamingTraitsWithMediaTypeError` operation.
         361  +
/* RustType.kt:516 */
  341    362   
#[non_exhaustive]
         363  +
/* RustType.kt:516 */
  342    364   
#[derive(::std::fmt::Debug)]
  343         -
pub enum StreamingTraitsWithMediaTypeError {
         365  +
pub /* OperationErrorGenerator.kt:81 */ enum StreamingTraitsWithMediaTypeError {
         366  +
    /* OperationErrorGenerator.kt:88 */
  344    367   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  345    368   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  346    369   
    variable wildcard pattern and check `.code()`:
  347    370   
     \
  348    371   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  349    372   
     \
  350    373   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StreamingTraitsWithMediaTypeError) for what information is available for the error.")]
  351    374   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         375  +
    /* OperationErrorGenerator.kt:81 */
  352    376   
}
         377  +
/* OperationErrorGenerator.kt:218 */
  353    378   
impl StreamingTraitsWithMediaTypeError {
         379  +
    /* OperationErrorGenerator.kt:219 */
  354    380   
    /// Creates the `StreamingTraitsWithMediaTypeError::Unhandled` variant from any error type.
  355    381   
    pub fn unhandled(
  356    382   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  357    383   
    ) -> Self {
  358    384   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  359    385   
            source: err.into(),
  360    386   
            meta: ::std::default::Default::default(),
  361    387   
        })
  362    388   
    }
  363    389   
  364    390   
    /// Creates the `StreamingTraitsWithMediaTypeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  365    391   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  366    392   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  367    393   
            source: err.clone().into(),
  368    394   
            meta: err,
  369    395   
        })
  370    396   
    }
  371         -
    ///
         397  +
    /// /* OperationErrorGenerator.kt:236 */
  372    398   
    /// Returns error metadata, which includes the error code, message,
  373    399   
    /// request ID, and potentially additional information.
  374    400   
    ///
         401  +
    /* OperationErrorGenerator.kt:242 */
  375    402   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         403  +
        /* OperationErrorGenerator.kt:243 */
  376    404   
        match self {
  377         -
            Self::Unhandled(e) => &e.meta,
         405  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         406  +
            /* OperationErrorGenerator.kt:243 */
  378    407   
        }
         408  +
        /* OperationErrorGenerator.kt:242 */
  379    409   
    }
         410  +
    /* OperationErrorGenerator.kt:218 */
  380    411   
}
         412  +
/* OperationErrorGenerator.kt:269 */
  381    413   
impl ::std::error::Error for StreamingTraitsWithMediaTypeError {
         414  +
    /* OperationErrorGenerator.kt:270 */
  382    415   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         416  +
        /* OperationErrorGenerator.kt:318 */
  383    417   
        match self {
  384         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         418  +
            /* OperationErrorGenerator.kt:326 */
         419  +
            Self::Unhandled(_inner) => {
         420  +
                /* OperationErrorGenerator.kt:279 */
         421  +
                ::std::option::Option::Some(&*_inner.source)
         422  +
                /* OperationErrorGenerator.kt:326 */
         423  +
            } /* OperationErrorGenerator.kt:318 */
  385    424   
        }
         425  +
        /* OperationErrorGenerator.kt:270 */
  386    426   
    }
         427  +
    /* OperationErrorGenerator.kt:269 */
  387    428   
}
         429  +
/* OperationErrorGenerator.kt:133 */
  388    430   
impl ::std::fmt::Display for StreamingTraitsWithMediaTypeError {
         431  +
    /* OperationErrorGenerator.kt:134 */
  389    432   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         433  +
        /* OperationErrorGenerator.kt:318 */
  390    434   
        match self {
         435  +
            /* OperationErrorGenerator.kt:326 */
  391    436   
            Self::Unhandled(_inner) => {
         437  +
                /* OperationErrorGenerator.kt:139 */
  392    438   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  393    439   
                    write!(f, "unhandled error ({code})")
  394    440   
                } else {
  395    441   
                    f.write_str("unhandled error")
  396    442   
                }
         443  +
                /* OperationErrorGenerator.kt:326 */
         444  +
            } /* OperationErrorGenerator.kt:318 */
  397    445   
        }
         446  +
        /* OperationErrorGenerator.kt:134 */
  398    447   
    }
  399         -
    }
         448  +
    /* OperationErrorGenerator.kt:133 */
  400    449   
}
         450  +
/* OperationErrorGenerator.kt:182 */
  401    451   
impl ::aws_smithy_types::retry::ProvideErrorKind for StreamingTraitsWithMediaTypeError {
         452  +
    /* OperationErrorGenerator.kt:186 */
  402    453   
    fn code(&self) -> ::std::option::Option<&str> {
         454  +
        /* OperationErrorGenerator.kt:187 */
  403    455   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         456  +
        /* OperationErrorGenerator.kt:186 */
  404    457   
    }
         458  +
    /* OperationErrorGenerator.kt:190 */
  405    459   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         460  +
        /* OperationErrorGenerator.kt:197 */
  406    461   
        ::std::option::Option::None
         462  +
        /* OperationErrorGenerator.kt:190 */
  407    463   
    }
         464  +
    /* OperationErrorGenerator.kt:182 */
  408    465   
}
         466  +
/* OperationErrorGenerator.kt:163 */
  409    467   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StreamingTraitsWithMediaTypeError {
         468  +
    /* OperationErrorGenerator.kt:164 */
  410    469   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         470  +
        /* OperationErrorGenerator.kt:318 */
  411    471   
        match self {
  412         -
            Self::Unhandled(_inner) => &_inner.meta,
         472  +
            /* OperationErrorGenerator.kt:326 */
         473  +
            Self::Unhandled(_inner) => {
         474  +
                /* OperationErrorGenerator.kt:168 */
         475  +
                &_inner.meta
         476  +
                /* OperationErrorGenerator.kt:326 */
         477  +
            } /* OperationErrorGenerator.kt:318 */
  413    478   
        }
         479  +
        /* OperationErrorGenerator.kt:164 */
  414    480   
    }
         481  +
    /* OperationErrorGenerator.kt:163 */
  415    482   
}
         483  +
/* OperationErrorGenerator.kt:109 */
  416    484   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StreamingTraitsWithMediaTypeError {
         485  +
    /* OperationErrorGenerator.kt:110 */
  417    486   
    fn create_unhandled_error(
  418    487   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  419    488   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  420    489   
    ) -> Self {
         490  +
        /* OperationErrorGenerator.kt:121 */
  421    491   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  422    492   
            source,
  423    493   
            meta: meta.unwrap_or_default(),
  424    494   
        })
         495  +
        /* OperationErrorGenerator.kt:110 */
  425    496   
    }
         497  +
    /* OperationErrorGenerator.kt:109 */
  426    498   
}
  427    499   
         500  +
/* CodegenDelegator.kt:255 */
  428    501   
pub use crate::operation::streaming_traits_with_media_type::_streaming_traits_with_media_type_output::StreamingTraitsWithMediaTypeOutput;
  429    502   
         503  +
/* CodegenDelegator.kt:255 */
  430    504   
pub use crate::operation::streaming_traits_with_media_type::_streaming_traits_with_media_type_input::StreamingTraitsWithMediaTypeInput;
  431    505   
         506  +
/* RustModule.kt:172 */
  432    507   
mod _streaming_traits_with_media_type_input;
  433    508   
         509  +
/* RustModule.kt:172 */
  434    510   
mod _streaming_traits_with_media_type_output;
  435    511   
  436         -
/// Builders
         512  +
/// /* CodegenDelegator.kt:51 */Builders
  437    513   
pub mod builders;