Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/escaped_string_values.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 `EscapedStringValues`.
           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 EscapedStringValues;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EscapedStringValues {
    7         -
    /// Creates a new `EscapedStringValues`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EscapedStringValues`
          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::escaped_string_values::EscapedStringValuesInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::escaped_string_values::EscapedStringValuesOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::escaped_string_values::EscapedStringValuesError,
   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 EscapedStringValues {
   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("EscapedStringValues");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EscapedStringValuesRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EscapedStringValuesResponseDeserializer,
  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   
            "EscapedStringValues",
  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("EscapedStringValues")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EscapedStringValuesEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::escaped_string_values::EscapedStringValuesError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::escaped_string_values::EscapedStringValuesError,
  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 EscapedStringValuesResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EscapedStringValuesResponseDeserializer {
  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_escaped_string_values::de_escaped_string_values_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values_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 EscapedStringValuesRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EscapedStringValuesRequestSerializer {
  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::escaped_string_values::EscapedStringValuesInput>()
  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::escaped_string_values::EscapedStringValuesInput,
  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, "/escaped-string-values").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::escaped_string_values::EscapedStringValuesInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_escaped_string_values::ser_escaped_string_values_input(
  196    209   
            &input,
  197    210   
        )?);
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct EscapedStringValuesEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EscapedStringValuesEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "EscapedStringValuesEndpointParamsInterceptor"
  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::<EscapedStringValuesInput>()
  226    240   
            .ok_or("failed to downcast to EscapedStringValuesInput")?;
  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 escaped_string_values_test {
  243    260   
  244    261   
    /// Test ID: EscapedStringValuesRequest
  245    262   
    #[::tokio::test]
  246    263   
    #[::tracing_test::traced_test]
  247    264   
    async fn escaped_string_values_request_request() {
  248    265   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  249    266   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  250    267   
  251    268   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
@@ -336,353 +485,608 @@
  356    373   
        });
  357    374   
        let parsed = parsed.expect_err("should be error response");
  358    375   
        let parsed: &crate::operation::escaped_string_values::EscapedStringValuesError =
  359    376   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  360    377   
        if let crate::operation::escaped_string_values::EscapedStringValuesError::ExtraError(parsed) = parsed {
  361    378   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  362    379   
        } else {
  363    380   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  364    381   
        }
  365    382   
    }
         383  +
         384  +
    /* ProtocolTestGenerator.kt:98 */
  366    385   
}
  367    386   
         387  +
/* OperationErrorGenerator.kt:79 */
  368    388   
/// Error type for the `EscapedStringValuesError` operation.
         389  +
/* RustType.kt:516 */
  369    390   
#[non_exhaustive]
         391  +
/* RustType.kt:516 */
  370    392   
#[derive(::std::fmt::Debug)]
  371         -
pub enum EscapedStringValuesError {
  372         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         393  +
pub /* OperationErrorGenerator.kt:81 */ enum EscapedStringValuesError {
         394  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         395  +
    /* OperationErrorGenerator.kt:86 */
  373    396   
    ValidationError(crate::types::error::ValidationError),
         397  +
    /* OperationErrorGenerator.kt:83 */
  374    398   
    #[allow(missing_docs)] // documentation missing in model
         399  +
    /* OperationErrorGenerator.kt:86 */
  375    400   
    ExtraError(crate::types::error::ExtraError),
         401  +
    /* OperationErrorGenerator.kt:88 */
  376    402   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  377    403   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  378    404   
    variable wildcard pattern and check `.code()`:
  379    405   
     \
  380    406   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  381    407   
     \
  382    408   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EscapedStringValuesError) for what information is available for the error.")]
  383    409   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         410  +
    /* OperationErrorGenerator.kt:81 */
  384    411   
}
         412  +
/* OperationErrorGenerator.kt:218 */
  385    413   
impl EscapedStringValuesError {
         414  +
    /* OperationErrorGenerator.kt:219 */
  386    415   
    /// Creates the `EscapedStringValuesError::Unhandled` variant from any error type.
  387    416   
    pub fn unhandled(
  388    417   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  389    418   
    ) -> Self {
  390    419   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  391    420   
            source: err.into(),
  392    421   
            meta: ::std::default::Default::default(),
  393    422   
        })
  394    423   
    }
  395    424   
  396    425   
    /// Creates the `EscapedStringValuesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  397    426   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  398    427   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  399    428   
            source: err.clone().into(),
  400    429   
            meta: err,
  401    430   
        })
  402    431   
    }
  403         -
    ///
         432  +
    /// /* OperationErrorGenerator.kt:236 */
  404    433   
    /// Returns error metadata, which includes the error code, message,
  405    434   
    /// request ID, and potentially additional information.
  406    435   
    ///
         436  +
    /* OperationErrorGenerator.kt:242 */
  407    437   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         438  +
        /* OperationErrorGenerator.kt:243 */
  408    439   
        match self {
  409         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  410         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  411         -
            Self::Unhandled(e) => &e.meta,
         440  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         441  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         442  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         443  +
            /* OperationErrorGenerator.kt:243 */
  412    444   
        }
         445  +
        /* OperationErrorGenerator.kt:242 */
  413    446   
    }
         447  +
    /* OperationErrorGenerator.kt:257 */
  414    448   
    /// Returns `true` if the error kind is `EscapedStringValuesError::ValidationError`.
         449  +
    /* OperationErrorGenerator.kt:258 */
  415    450   
    pub fn is_validation_error(&self) -> bool {
         451  +
        /* OperationErrorGenerator.kt:259 */
  416    452   
        matches!(self, Self::ValidationError(_))
         453  +
        /* OperationErrorGenerator.kt:258 */
  417    454   
    }
         455  +
    /* OperationErrorGenerator.kt:257 */
  418    456   
    /// Returns `true` if the error kind is `EscapedStringValuesError::ExtraError`.
         457  +
    /* OperationErrorGenerator.kt:258 */
  419    458   
    pub fn is_extra_error(&self) -> bool {
         459  +
        /* OperationErrorGenerator.kt:259 */
  420    460   
        matches!(self, Self::ExtraError(_))
         461  +
        /* OperationErrorGenerator.kt:258 */
  421    462   
    }
         463  +
    /* OperationErrorGenerator.kt:218 */
  422    464   
}
         465  +
/* OperationErrorGenerator.kt:269 */
  423    466   
impl ::std::error::Error for EscapedStringValuesError {
         467  +
    /* OperationErrorGenerator.kt:270 */
  424    468   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         469  +
        /* OperationErrorGenerator.kt:318 */
  425    470   
        match self {
  426         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  427         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  428         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         471  +
            /* OperationErrorGenerator.kt:321 */
         472  +
            Self::ValidationError(_inner) =>
         473  +
            /* OperationErrorGenerator.kt:283 */
         474  +
            {
         475  +
                ::std::option::Option::Some(_inner)
         476  +
            }
         477  +
            ,
         478  +
            /* OperationErrorGenerator.kt:321 */
         479  +
            Self::ExtraError(_inner) =>
         480  +
            /* OperationErrorGenerator.kt:283 */
         481  +
            {
         482  +
                ::std::option::Option::Some(_inner)
         483  +
            }
         484  +
            ,
         485  +
            /* OperationErrorGenerator.kt:326 */
         486  +
            Self::Unhandled(_inner) => {
         487  +
                /* OperationErrorGenerator.kt:279 */
         488  +
                ::std::option::Option::Some(&*_inner.source)
         489  +
                /* OperationErrorGenerator.kt:326 */
         490  +
            } /* OperationErrorGenerator.kt:318 */
  429    491   
        }
         492  +
        /* OperationErrorGenerator.kt:270 */
  430    493   
    }
         494  +
    /* OperationErrorGenerator.kt:269 */
  431    495   
}
         496  +
/* OperationErrorGenerator.kt:133 */
  432    497   
impl ::std::fmt::Display for EscapedStringValuesError {
         498  +
    /* OperationErrorGenerator.kt:134 */
  433    499   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         500  +
        /* OperationErrorGenerator.kt:318 */
  434    501   
        match self {
  435         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  436         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         502  +
            /* OperationErrorGenerator.kt:321 */
         503  +
            Self::ValidationError(_inner) =>
         504  +
            /* OperationErrorGenerator.kt:151 */
         505  +
            {
         506  +
                _inner.fmt(f)
         507  +
            }
         508  +
            ,
         509  +
            /* OperationErrorGenerator.kt:321 */
         510  +
            Self::ExtraError(_inner) =>
         511  +
            /* OperationErrorGenerator.kt:151 */
         512  +
            {
         513  +
                _inner.fmt(f)
         514  +
            }
         515  +
            ,
         516  +
            /* OperationErrorGenerator.kt:326 */
  437    517   
            Self::Unhandled(_inner) => {
         518  +
                /* OperationErrorGenerator.kt:139 */
  438    519   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  439    520   
                    write!(f, "unhandled error ({code})")
  440    521   
                } else {
  441    522   
                    f.write_str("unhandled error")
  442    523   
                }
  443         -
            }
         524  +
                /* OperationErrorGenerator.kt:326 */
         525  +
            } /* OperationErrorGenerator.kt:318 */
  444    526   
        }
         527  +
        /* OperationErrorGenerator.kt:134 */
  445    528   
    }
         529  +
    /* OperationErrorGenerator.kt:133 */
  446    530   
}
         531  +
/* OperationErrorGenerator.kt:182 */
  447    532   
impl ::aws_smithy_types::retry::ProvideErrorKind for EscapedStringValuesError {
         533  +
    /* OperationErrorGenerator.kt:186 */
  448    534   
    fn code(&self) -> ::std::option::Option<&str> {
         535  +
        /* OperationErrorGenerator.kt:187 */
  449    536   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         537  +
        /* OperationErrorGenerator.kt:186 */
  450    538   
    }
         539  +
    /* OperationErrorGenerator.kt:190 */
  451    540   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         541  +
        /* OperationErrorGenerator.kt:197 */
  452    542   
        ::std::option::Option::None
         543  +
        /* OperationErrorGenerator.kt:190 */
  453    544   
    }
         545  +
    /* OperationErrorGenerator.kt:182 */
  454    546   
}
         547  +
/* OperationErrorGenerator.kt:163 */
  455    548   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EscapedStringValuesError {
         549  +
    /* OperationErrorGenerator.kt:164 */
  456    550   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         551  +
        /* OperationErrorGenerator.kt:318 */
  457    552   
        match self {
  458         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  459         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  460         -
            Self::Unhandled(_inner) => &_inner.meta,
         553  +
            /* OperationErrorGenerator.kt:321 */
         554  +
            Self::ValidationError(_inner) =>
         555  +
            /* OperationErrorGenerator.kt:169 */
         556  +
            {
         557  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         558  +
            }
         559  +
            ,
         560  +
            /* OperationErrorGenerator.kt:321 */
         561  +
            Self::ExtraError(_inner) =>
         562  +
            /* OperationErrorGenerator.kt:169 */
         563  +
            {
         564  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         565  +
            }
         566  +
            ,
         567  +
            /* OperationErrorGenerator.kt:326 */
         568  +
            Self::Unhandled(_inner) => {
         569  +
                /* OperationErrorGenerator.kt:168 */
         570  +
                &_inner.meta
         571  +
                /* OperationErrorGenerator.kt:326 */
         572  +
            } /* OperationErrorGenerator.kt:318 */
  461    573   
        }
         574  +
        /* OperationErrorGenerator.kt:164 */
  462    575   
    }
         576  +
    /* OperationErrorGenerator.kt:163 */
  463    577   
}
         578  +
/* OperationErrorGenerator.kt:109 */
  464    579   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EscapedStringValuesError {
         580  +
    /* OperationErrorGenerator.kt:110 */
  465    581   
    fn create_unhandled_error(
  466    582   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  467    583   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  468    584   
    ) -> Self {
         585  +
        /* OperationErrorGenerator.kt:121 */
  469    586   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  470    587   
            source,
  471    588   
            meta: meta.unwrap_or_default(),
  472    589   
        })
         590  +
        /* OperationErrorGenerator.kt:110 */
  473    591   
    }
         592  +
    /* OperationErrorGenerator.kt:109 */
  474    593   
}
  475    594   
         595  +
/* CodegenDelegator.kt:255 */
  476    596   
pub use crate::operation::escaped_string_values::_escaped_string_values_output::EscapedStringValuesOutput;
  477    597   
         598  +
/* CodegenDelegator.kt:255 */
  478    599   
pub use crate::operation::escaped_string_values::_escaped_string_values_input::EscapedStringValuesInput;
  479    600   
         601  +
/* RustModule.kt:172 */
  480    602   
mod _escaped_string_values_input;
  481    603   
         604  +
/* RustModule.kt:172 */
  482    605   
mod _escaped_string_values_output;
  483    606   
  484         -
/// Builders
         607  +
/// /* CodegenDelegator.kt:51 */Builders
  485    608   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/escaped_string_values/_escaped_string_values_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/escaped_string_values/_escaped_string_values_output.rs

@@ -1,1 +71,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EscapedStringValuesOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct EscapedStringValuesOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub r#enum: ::std::option::Option<crate::types::EnumWithEscapedChars>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub some_string: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl EscapedStringValuesOutput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn r#enum(&self) -> ::std::option::Option<&crate::types::EnumWithEscapedChars> {
          23  +
        /* StructureGenerator.kt:170 */
   14     24   
        self.r#enum.as_ref()
          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 some_string(&self) -> ::std::option::Option<&str> {
          31  +
        /* StructureGenerator.kt:169 */
   18     32   
        self.some_string.as_deref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl EscapedStringValuesOutput {
   22         -
    /// Creates a new builder-style object to manufacture [`EscapedStringValuesOutput`](crate::operation::escaped_string_values::EscapedStringValuesOutput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EscapedStringValuesOutput`](crate::operation::escaped_string_values::EscapedStringValuesOutput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`EscapedStringValuesOutput`](crate::operation::escaped_string_values::EscapedStringValuesOutput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`EscapedStringValuesOutput`](crate::operation::escaped_string_values::EscapedStringValuesOutput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct EscapedStringValuesOutputBuilder {
   32         -
    pub(crate) r#enum: ::std::option::Option<crate::types::EnumWithEscapedChars>,
   33         -
    pub(crate) some_string: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) r#enum: ::std::option::Option<crate::types::EnumWithEscapedChars>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) some_string: ::std::option::Option<::std::string::String>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl EscapedStringValuesOutputBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn r#enum(mut self, input: crate::types::EnumWithEscapedChars) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.r#enum = ::std::option::Option::Some(input);
          68  +
        /* BuilderGenerator.kt:293 */
   39     69   
        self
          70  +
        /* BuilderGenerator.kt:291 */
   40     71   
    }
          72  +
    /* BuilderGenerator.kt:312 */
   41     73   
    #[allow(missing_docs)] // documentation missing in model
          74  +
                           /* BuilderGenerator.kt:314 */
   42     75   
    pub fn set_enum(mut self, input: ::std::option::Option<crate::types::EnumWithEscapedChars>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.r#enum = input;
   44     78   
        self
          79  +
        /* BuilderGenerator.kt:314 */
   45     80   
    }
          81  +
    /* BuilderGenerator.kt:334 */
   46     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:336 */
   47     84   
    pub fn get_enum(&self) -> &::std::option::Option<crate::types::EnumWithEscapedChars> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.r#enum
          87  +
        /* BuilderGenerator.kt:336 */
   49     88   
    }
          89  +
    /* BuilderGenerator.kt:286 */
   50     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:291 */
   51     92   
    pub fn some_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.some_string = ::std::option::Option::Some(input.into());
          95  +
        /* BuilderGenerator.kt:293 */
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:291 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:312 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:314 */
   56    102   
    pub fn set_some_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.some_string = input;
   58    105   
        self
         106  +
        /* BuilderGenerator.kt:314 */
   59    107   
    }
         108  +
    /* BuilderGenerator.kt:334 */
   60    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:336 */
   61    111   
    pub fn get_some_string(&self) -> &::std::option::Option<::std::string::String> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.some_string
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`EscapedStringValuesOutput`](crate::operation::escaped_string_values::EscapedStringValuesOutput).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EscapedStringValuesOutput`](crate::operation::escaped_string_values::EscapedStringValuesOutput).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(self) -> crate::operation::escaped_string_values::EscapedStringValuesOutput {
         119  +
        /* BuilderGenerator.kt:477 */
   66    120   
        crate::operation::escaped_string_values::EscapedStringValuesOutput {
   67         -
            r#enum: self.r#enum,
         121  +
            /* BuilderGenerator.kt:481 */ r#enum: self.r#enum,
         122  +
            /* BuilderGenerator.kt:481 */
   68    123   
            some_string: self.some_string,
         124  +
            /* BuilderGenerator.kt:477 */
   69    125   
        }
         126  +
        /* BuilderGenerator.kt:253 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:355 */
   71    129   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/escaped_string_values/builders.rs

@@ -1,1 +138,162 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::escaped_string_values::_escaped_string_values_output::EscapedStringValuesOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::escaped_string_values::_escaped_string_values_input::EscapedStringValuesInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::escaped_string_values::builders::EscapedStringValuesInputBuilder {
    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::escaped_string_values::EscapedStringValuesOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::escaped_string_values::EscapedStringValuesError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.escaped_string_values();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EscapedStringValues`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EscapedStringValues`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EscapedStringValuesFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::escaped_string_values::builders::EscapedStringValuesInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::escaped_string_values::EscapedStringValuesOutput,
   34     40   
        crate::operation::escaped_string_values::EscapedStringValuesError,
   35     41   
    > for EscapedStringValuesFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::escaped_string_values::EscapedStringValuesOutput,
   43     49   
            crate::operation::escaped_string_values::EscapedStringValuesError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl EscapedStringValuesFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EscapedStringValuesFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the EscapedStringValues as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::escaped_string_values::builders::EscapedStringValuesInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::escaped_string_values::EscapedStringValuesOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::escaped_string_values::EscapedStringValuesError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::escaped_string_values::EscapedStringValues::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::escaped_string_values::EscapedStringValues::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::escaped_string_values::EscapedStringValuesOutput,
   96    106   
        crate::operation::escaped_string_values::EscapedStringValuesError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn r#enum(mut self, input: crate::types::EnumWithEscapedChars) -> Self {
  112    125   
        self.inner = self.inner.r#enum(input);
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_enum(mut self, input: ::std::option::Option<crate::types::EnumWithEscapedChars>) -> Self {
  117    132   
        self.inner = self.inner.set_enum(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_enum(&self) -> &::std::option::Option<crate::types::EnumWithEscapedChars> {
  122    139   
        self.inner.get_enum()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:498 */
  124    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:500 */
  125    144   
    pub fn some_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  126    145   
        self.inner = self.inner.some_string(input.into());
  127    146   
        self
  128    147   
    }
         148  +
    /* FluentBuilderGenerator.kt:498 */
  129    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* FluentBuilderGenerator.kt:500 */
  130    151   
    pub fn set_some_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  131    152   
        self.inner = self.inner.set_some_string(input);
  132    153   
        self
  133    154   
    }
         155  +
    /* FluentBuilderGenerator.kt:518 */
  134    156   
    #[allow(missing_docs)] // documentation missing in model
         157  +
                           /* FluentBuilderGenerator.kt:520 */
  135    158   
    pub fn get_some_string(&self) -> &::std::option::Option<::std::string::String> {
  136    159   
        self.inner.get_some_string()
  137    160   
    }
         161  +
    /* FluentBuilderGenerator.kt:282 */
  138    162   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/map_with_enum_key_op.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 `MapWithEnumKeyOp`.
           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 MapWithEnumKeyOp;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl MapWithEnumKeyOp {
    7         -
    /// Creates a new `MapWithEnumKeyOp`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `MapWithEnumKeyOp`
          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::map_with_enum_key_op::MapWithEnumKeyOpInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +270,287 @@
   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 MapWithEnumKeyOp {
   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("MapWithEnumKeyOp");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            MapWithEnumKeyOpRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            MapWithEnumKeyOpResponseDeserializer,
  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   
            "MapWithEnumKeyOp",
  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("MapWithEnumKeyOp")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(MapWithEnumKeyOpEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
  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 MapWithEnumKeyOpResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MapWithEnumKeyOpResponseDeserializer {
  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_map_with_enum_key_op::de_map_with_enum_key_op_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op_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 MapWithEnumKeyOpRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MapWithEnumKeyOpRequestSerializer {
  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::map_with_enum_key_op::MapWithEnumKeyOpInput>()
  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::map_with_enum_key_op::MapWithEnumKeyOpInput,
  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, "/map-with-enum-key").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::map_with_enum_key_op::MapWithEnumKeyOpInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body =
  196    209   
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_map_with_enum_key_op::ser_map_with_enum_key_op_input(&input)?);
  197    210   
        if let Some(content_length) = body.content_length() {
  198    211   
            let content_length = content_length.to_string();
  199    212   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  200    213   
        }
  201    214   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  202    215   
    }
  203    216   
}
         217  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  204    218   
#[derive(Debug)]
  205    219   
struct MapWithEnumKeyOpEndpointParamsInterceptor;
  206    220   
  207    221   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MapWithEnumKeyOpEndpointParamsInterceptor {
  208    222   
    fn name(&self) -> &'static str {
  209    223   
        "MapWithEnumKeyOpEndpointParamsInterceptor"
  210    224   
    }
  211    225   
  212    226   
    fn read_before_execution(
  213    227   
        &self,
  214    228   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  215    229   
            '_,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  219    233   
        >,
  220    234   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  221    235   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  222    236   
        let _input = context
  223    237   
            .input()
  224    238   
            .downcast_ref::<MapWithEnumKeyOpInput>()
  225    239   
            .ok_or("failed to downcast to MapWithEnumKeyOpInput")?;
  226    240   
  227    241   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  228    242   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  229    243   
        })?;
  230    244   
        cfg.interceptor_state()
  231    245   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  232    246   
        ::std::result::Result::Ok(())
  233    247   
    }
  234    248   
}
  235    249   
  236    250   
// The get_* functions below are generated from JMESPath expressions in the
  237    251   
// operationContextParams trait. They target the operation's input shape.
  238    252   
         253  +
/* RustType.kt:516 */
  239    254   
#[allow(unreachable_code, unused_variables)]
         255  +
/* RustType.kt:516 */
  240    256   
#[cfg(test)]
         257  +
/* ProtocolTestGenerator.kt:98 */
  241    258   
mod map_with_enum_key_op_test {
  242    259   
  243    260   
    /// Test ID: MapWithEnumKeyRequest
  244    261   
    #[::tokio::test]
  245    262   
    #[::tracing_test::traced_test]
  246    263   
    async fn map_with_enum_key_request_request() {
  247    264   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    265   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  249    266   
  250    267   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
@@ -336,353 +485,608 @@
  356    373   
        });
  357    374   
        let parsed = parsed.expect_err("should be error response");
  358    375   
        let parsed: &crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError =
  359    376   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  360    377   
        if let crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ExtraError(parsed) = parsed {
  361    378   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  362    379   
        } else {
  363    380   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  364    381   
        }
  365    382   
    }
         383  +
         384  +
    /* ProtocolTestGenerator.kt:98 */
  366    385   
}
  367    386   
         387  +
/* OperationErrorGenerator.kt:79 */
  368    388   
/// Error type for the `MapWithEnumKeyOpError` operation.
         389  +
/* RustType.kt:516 */
  369    390   
#[non_exhaustive]
         391  +
/* RustType.kt:516 */
  370    392   
#[derive(::std::fmt::Debug)]
  371         -
pub enum MapWithEnumKeyOpError {
  372         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         393  +
pub /* OperationErrorGenerator.kt:81 */ enum MapWithEnumKeyOpError {
         394  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         395  +
    /* OperationErrorGenerator.kt:86 */
  373    396   
    ValidationError(crate::types::error::ValidationError),
         397  +
    /* OperationErrorGenerator.kt:83 */
  374    398   
    #[allow(missing_docs)] // documentation missing in model
         399  +
    /* OperationErrorGenerator.kt:86 */
  375    400   
    ExtraError(crate::types::error::ExtraError),
         401  +
    /* OperationErrorGenerator.kt:88 */
  376    402   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  377    403   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  378    404   
    variable wildcard pattern and check `.code()`:
  379    405   
     \
  380    406   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  381    407   
     \
  382    408   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MapWithEnumKeyOpError) for what information is available for the error.")]
  383    409   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         410  +
    /* OperationErrorGenerator.kt:81 */
  384    411   
}
         412  +
/* OperationErrorGenerator.kt:218 */
  385    413   
impl MapWithEnumKeyOpError {
         414  +
    /* OperationErrorGenerator.kt:219 */
  386    415   
    /// Creates the `MapWithEnumKeyOpError::Unhandled` variant from any error type.
  387    416   
    pub fn unhandled(
  388    417   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  389    418   
    ) -> Self {
  390    419   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  391    420   
            source: err.into(),
  392    421   
            meta: ::std::default::Default::default(),
  393    422   
        })
  394    423   
    }
  395    424   
  396    425   
    /// Creates the `MapWithEnumKeyOpError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  397    426   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  398    427   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  399    428   
            source: err.clone().into(),
  400    429   
            meta: err,
  401    430   
        })
  402    431   
    }
  403         -
    ///
         432  +
    /// /* OperationErrorGenerator.kt:236 */
  404    433   
    /// Returns error metadata, which includes the error code, message,
  405    434   
    /// request ID, and potentially additional information.
  406    435   
    ///
         436  +
    /* OperationErrorGenerator.kt:242 */
  407    437   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         438  +
        /* OperationErrorGenerator.kt:243 */
  408    439   
        match self {
  409         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  410         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  411         -
            Self::Unhandled(e) => &e.meta,
         440  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         441  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         442  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         443  +
            /* OperationErrorGenerator.kt:243 */
  412    444   
        }
         445  +
        /* OperationErrorGenerator.kt:242 */
  413    446   
    }
         447  +
    /* OperationErrorGenerator.kt:257 */
  414    448   
    /// Returns `true` if the error kind is `MapWithEnumKeyOpError::ValidationError`.
         449  +
    /* OperationErrorGenerator.kt:258 */
  415    450   
    pub fn is_validation_error(&self) -> bool {
         451  +
        /* OperationErrorGenerator.kt:259 */
  416    452   
        matches!(self, Self::ValidationError(_))
         453  +
        /* OperationErrorGenerator.kt:258 */
  417    454   
    }
         455  +
    /* OperationErrorGenerator.kt:257 */
  418    456   
    /// Returns `true` if the error kind is `MapWithEnumKeyOpError::ExtraError`.
         457  +
    /* OperationErrorGenerator.kt:258 */
  419    458   
    pub fn is_extra_error(&self) -> bool {
         459  +
        /* OperationErrorGenerator.kt:259 */
  420    460   
        matches!(self, Self::ExtraError(_))
         461  +
        /* OperationErrorGenerator.kt:258 */
  421    462   
    }
         463  +
    /* OperationErrorGenerator.kt:218 */
  422    464   
}
         465  +
/* OperationErrorGenerator.kt:269 */
  423    466   
impl ::std::error::Error for MapWithEnumKeyOpError {
         467  +
    /* OperationErrorGenerator.kt:270 */
  424    468   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         469  +
        /* OperationErrorGenerator.kt:318 */
  425    470   
        match self {
  426         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  427         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  428         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         471  +
            /* OperationErrorGenerator.kt:321 */
         472  +
            Self::ValidationError(_inner) =>
         473  +
            /* OperationErrorGenerator.kt:283 */
         474  +
            {
         475  +
                ::std::option::Option::Some(_inner)
         476  +
            }
         477  +
            ,
         478  +
            /* OperationErrorGenerator.kt:321 */
         479  +
            Self::ExtraError(_inner) =>
         480  +
            /* OperationErrorGenerator.kt:283 */
         481  +
            {
         482  +
                ::std::option::Option::Some(_inner)
         483  +
            }
         484  +
            ,
         485  +
            /* OperationErrorGenerator.kt:326 */
         486  +
            Self::Unhandled(_inner) => {
         487  +
                /* OperationErrorGenerator.kt:279 */
         488  +
                ::std::option::Option::Some(&*_inner.source)
         489  +
                /* OperationErrorGenerator.kt:326 */
         490  +
            } /* OperationErrorGenerator.kt:318 */
  429    491   
        }
         492  +
        /* OperationErrorGenerator.kt:270 */
  430    493   
    }
         494  +
    /* OperationErrorGenerator.kt:269 */
  431    495   
}
         496  +
/* OperationErrorGenerator.kt:133 */
  432    497   
impl ::std::fmt::Display for MapWithEnumKeyOpError {
         498  +
    /* OperationErrorGenerator.kt:134 */
  433    499   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         500  +
        /* OperationErrorGenerator.kt:318 */
  434    501   
        match self {
  435         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  436         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         502  +
            /* OperationErrorGenerator.kt:321 */
         503  +
            Self::ValidationError(_inner) =>
         504  +
            /* OperationErrorGenerator.kt:151 */
         505  +
            {
         506  +
                _inner.fmt(f)
         507  +
            }
         508  +
            ,
         509  +
            /* OperationErrorGenerator.kt:321 */
         510  +
            Self::ExtraError(_inner) =>
         511  +
            /* OperationErrorGenerator.kt:151 */
         512  +
            {
         513  +
                _inner.fmt(f)
         514  +
            }
         515  +
            ,
         516  +
            /* OperationErrorGenerator.kt:326 */
  437    517   
            Self::Unhandled(_inner) => {
         518  +
                /* OperationErrorGenerator.kt:139 */
  438    519   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  439    520   
                    write!(f, "unhandled error ({code})")
  440    521   
                } else {
  441    522   
                    f.write_str("unhandled error")
  442    523   
                }
  443         -
            }
         524  +
                /* OperationErrorGenerator.kt:326 */
         525  +
            } /* OperationErrorGenerator.kt:318 */
  444    526   
        }
         527  +
        /* OperationErrorGenerator.kt:134 */
  445    528   
    }
         529  +
    /* OperationErrorGenerator.kt:133 */
  446    530   
}
         531  +
/* OperationErrorGenerator.kt:182 */
  447    532   
impl ::aws_smithy_types::retry::ProvideErrorKind for MapWithEnumKeyOpError {
         533  +
    /* OperationErrorGenerator.kt:186 */
  448    534   
    fn code(&self) -> ::std::option::Option<&str> {
         535  +
        /* OperationErrorGenerator.kt:187 */
  449    536   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         537  +
        /* OperationErrorGenerator.kt:186 */
  450    538   
    }
         539  +
    /* OperationErrorGenerator.kt:190 */
  451    540   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         541  +
        /* OperationErrorGenerator.kt:197 */
  452    542   
        ::std::option::Option::None
         543  +
        /* OperationErrorGenerator.kt:190 */
  453    544   
    }
         545  +
    /* OperationErrorGenerator.kt:182 */
  454    546   
}
         547  +
/* OperationErrorGenerator.kt:163 */
  455    548   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MapWithEnumKeyOpError {
         549  +
    /* OperationErrorGenerator.kt:164 */
  456    550   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         551  +
        /* OperationErrorGenerator.kt:318 */
  457    552   
        match self {
  458         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  459         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  460         -
            Self::Unhandled(_inner) => &_inner.meta,
         553  +
            /* OperationErrorGenerator.kt:321 */
         554  +
            Self::ValidationError(_inner) =>
         555  +
            /* OperationErrorGenerator.kt:169 */
         556  +
            {
         557  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         558  +
            }
         559  +
            ,
         560  +
            /* OperationErrorGenerator.kt:321 */
         561  +
            Self::ExtraError(_inner) =>
         562  +
            /* OperationErrorGenerator.kt:169 */
         563  +
            {
         564  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         565  +
            }
         566  +
            ,
         567  +
            /* OperationErrorGenerator.kt:326 */
         568  +
            Self::Unhandled(_inner) => {
         569  +
                /* OperationErrorGenerator.kt:168 */
         570  +
                &_inner.meta
         571  +
                /* OperationErrorGenerator.kt:326 */
         572  +
            } /* OperationErrorGenerator.kt:318 */
  461    573   
        }
         574  +
        /* OperationErrorGenerator.kt:164 */
  462    575   
    }
         576  +
    /* OperationErrorGenerator.kt:163 */
  463    577   
}
         578  +
/* OperationErrorGenerator.kt:109 */
  464    579   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MapWithEnumKeyOpError {
         580  +
    /* OperationErrorGenerator.kt:110 */
  465    581   
    fn create_unhandled_error(
  466    582   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  467    583   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  468    584   
    ) -> Self {
         585  +
        /* OperationErrorGenerator.kt:121 */
  469    586   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  470    587   
            source,
  471    588   
            meta: meta.unwrap_or_default(),
  472    589   
        })
         590  +
        /* OperationErrorGenerator.kt:110 */
  473    591   
    }
         592  +
    /* OperationErrorGenerator.kt:109 */
  474    593   
}
  475    594   
         595  +
/* CodegenDelegator.kt:255 */
  476    596   
pub use crate::operation::map_with_enum_key_op::_map_with_enum_key_op_output::MapWithEnumKeyOpOutput;
  477    597   
         598  +
/* CodegenDelegator.kt:255 */
  478    599   
pub use crate::operation::map_with_enum_key_op::_map_with_enum_key_op_input::MapWithEnumKeyOpInput;
  479    600   
         601  +
/* RustModule.kt:172 */
  480    602   
mod _map_with_enum_key_op_input;
  481    603   
         604  +
/* RustModule.kt:172 */
  482    605   
mod _map_with_enum_key_op_output;
  483    606   
  484         -
/// Builders
         607  +
/// /* CodegenDelegator.kt:51 */Builders
  485    608   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/map_with_enum_key_op/_map_with_enum_key_op_input.rs

@@ -1,1 +54,99 @@
    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 MapWithEnumKeyOpInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MapWithEnumKeyOpInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub map: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MapWithEnumKeyOpInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn map(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.map.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MapWithEnumKeyOpInput {
   16         -
    /// Creates a new builder-style object to manufacture [`MapWithEnumKeyOpInput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MapWithEnumKeyOpInput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MapWithEnumKeyOpInput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MapWithEnumKeyOpInput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct MapWithEnumKeyOpInputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) map: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>,
          47  +
    /* BuilderGenerator.kt:345 */
   27     48   
}
          49  +
/* BuilderGenerator.kt:355 */
   28     50   
impl MapWithEnumKeyOpInputBuilder {
   29         -
    /// Adds a key-value pair to `map`.
          51  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `map`.
          52  +
    /* BuilderGenerator.kt:437 */
   30     53   
    ///
   31         -
    /// To override the contents of this collection use [`set_map`](Self::set_map).
          54  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_map`](Self::set_map).
          55  +
    /* BuilderGenerator.kt:439 */
   32     56   
    ///
          57  +
    /* BuilderGenerator.kt:445 */
   33     58   
    pub fn map(mut self, k: crate::types::StringEnum, v: impl ::std::convert::Into<::std::string::String>) -> Self {
          59  +
        /* BuilderGenerator.kt:448 */
   34     60   
        let mut hash_map = self.map.unwrap_or_default();
   35     61   
        hash_map.insert(k, v.into());
   36     62   
        self.map = ::std::option::Option::Some(hash_map);
   37     63   
        self
          64  +
        /* BuilderGenerator.kt:445 */
   38     65   
    }
          66  +
    /* BuilderGenerator.kt:312 */
   39     67   
    #[allow(missing_docs)] // documentation missing in model
          68  +
                           /* BuilderGenerator.kt:314 */
   40     69   
    pub fn set_map(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>) -> Self {
          70  +
        /* BuilderGenerator.kt:315 */
   41     71   
        self.map = input;
   42     72   
        self
          73  +
        /* BuilderGenerator.kt:314 */
   43     74   
    }
          75  +
    /* BuilderGenerator.kt:334 */
   44     76   
    #[allow(missing_docs)] // documentation missing in model
          77  +
                           /* BuilderGenerator.kt:336 */
   45     78   
    pub fn get_map(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          79  +
        /* BuilderGenerator.kt:337 */
   46     80   
        &self.map
          81  +
        /* BuilderGenerator.kt:336 */
   47     82   
    }
   48         -
    /// Consumes the builder and constructs a [`MapWithEnumKeyOpInput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput).
          83  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MapWithEnumKeyOpInput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput).
          84  +
    /* BuilderGenerator.kt:253 */
   49     85   
    pub fn build(
   50     86   
        self,
   51     87   
    ) -> ::std::result::Result<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput, ::aws_smithy_types::error::operation::BuildError> {
   52         -
        ::std::result::Result::Ok(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput { map: self.map })
          88  +
        /* BuilderGenerator.kt:254 */
          89  +
        ::std::result::Result::Ok(
          90  +
            /* BuilderGenerator.kt:477 */
          91  +
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput {
          92  +
                /* BuilderGenerator.kt:481 */ map: self.map,
          93  +
                /* BuilderGenerator.kt:477 */
          94  +
            }, /* BuilderGenerator.kt:254 */
          95  +
        )
          96  +
        /* BuilderGenerator.kt:253 */
   53     97   
    }
          98  +
    /* BuilderGenerator.kt:355 */
   54     99   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/map_with_enum_key_op/_map_with_enum_key_op_output.rs

@@ -1,1 +52,94 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct MapWithEnumKeyOpOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct MapWithEnumKeyOpOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub map: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl MapWithEnumKeyOpOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn map(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.map.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl MapWithEnumKeyOpOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`MapWithEnumKeyOpOutput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MapWithEnumKeyOpOutput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`MapWithEnumKeyOpOutput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`MapWithEnumKeyOpOutput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct MapWithEnumKeyOpOutputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) map: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>,
          47  +
    /* BuilderGenerator.kt:345 */
   27     48   
}
          49  +
/* BuilderGenerator.kt:355 */
   28     50   
impl MapWithEnumKeyOpOutputBuilder {
   29         -
    /// Adds a key-value pair to `map`.
          51  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `map`.
          52  +
    /* BuilderGenerator.kt:437 */
   30     53   
    ///
   31         -
    /// To override the contents of this collection use [`set_map`](Self::set_map).
          54  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_map`](Self::set_map).
          55  +
    /* BuilderGenerator.kt:439 */
   32     56   
    ///
          57  +
    /* BuilderGenerator.kt:445 */
   33     58   
    pub fn map(mut self, k: crate::types::StringEnum, v: impl ::std::convert::Into<::std::string::String>) -> Self {
          59  +
        /* BuilderGenerator.kt:448 */
   34     60   
        let mut hash_map = self.map.unwrap_or_default();
   35     61   
        hash_map.insert(k, v.into());
   36     62   
        self.map = ::std::option::Option::Some(hash_map);
   37     63   
        self
          64  +
        /* BuilderGenerator.kt:445 */
   38     65   
    }
          66  +
    /* BuilderGenerator.kt:312 */
   39     67   
    #[allow(missing_docs)] // documentation missing in model
          68  +
                           /* BuilderGenerator.kt:314 */
   40     69   
    pub fn set_map(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>) -> Self {
          70  +
        /* BuilderGenerator.kt:315 */
   41     71   
        self.map = input;
   42     72   
        self
          73  +
        /* BuilderGenerator.kt:314 */
   43     74   
    }
          75  +
    /* BuilderGenerator.kt:334 */
   44     76   
    #[allow(missing_docs)] // documentation missing in model
          77  +
                           /* BuilderGenerator.kt:336 */
   45     78   
    pub fn get_map(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          79  +
        /* BuilderGenerator.kt:337 */
   46     80   
        &self.map
          81  +
        /* BuilderGenerator.kt:336 */
   47     82   
    }
   48         -
    /// Consumes the builder and constructs a [`MapWithEnumKeyOpOutput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput).
          83  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MapWithEnumKeyOpOutput`](crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput).
          84  +
    /* BuilderGenerator.kt:253 */
   49     85   
    pub fn build(self) -> crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput {
   50         -
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput { map: self.map }
          86  +
        /* BuilderGenerator.kt:477 */
          87  +
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput {
          88  +
            /* BuilderGenerator.kt:481 */ map: self.map,
          89  +
            /* BuilderGenerator.kt:477 */
          90  +
        }
          91  +
        /* BuilderGenerator.kt:253 */
   51     92   
    }
          93  +
    /* BuilderGenerator.kt:355 */
   52     94   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/map_with_enum_key_op/builders.rs

@@ -1,1 +129,147 @@
    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::map_with_enum_key_op::_map_with_enum_key_op_output::MapWithEnumKeyOpOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::map_with_enum_key_op::_map_with_enum_key_op_input::MapWithEnumKeyOpInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpInputBuilder {
    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::map_with_enum_key_op::MapWithEnumKeyOpOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.map_with_enum_key_op();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `MapWithEnumKeyOp`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `MapWithEnumKeyOp`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct MapWithEnumKeyOpFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput,
   34     40   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
   35     41   
    > for MapWithEnumKeyOpFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput,
   43     49   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl MapWithEnumKeyOpFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `MapWithEnumKeyOpFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the MapWithEnumKeyOp as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::map_with_enum_key_op::MapWithEnumKeyOp::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOp::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput,
   96    106   
        crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
  110         -
    ///
         121  +
    /// /* FluentBuilderGenerator.kt:466 */
  111    122   
    /// Adds a key-value pair to `map`.
  112    123   
    ///
  113    124   
    /// To override the contents of this collection use [`set_map`](Self::set_map).
  114    125   
    ///
         126  +
    /* FluentBuilderGenerator.kt:473 */
  115    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* FluentBuilderGenerator.kt:475 */
  116    129   
    pub fn map(mut self, k: crate::types::StringEnum, v: impl ::std::convert::Into<::std::string::String>) -> Self {
  117    130   
        self.inner = self.inner.map(k, v.into());
  118    131   
        self
  119    132   
    }
         133  +
    /* FluentBuilderGenerator.kt:498 */
  120    134   
    #[allow(missing_docs)] // documentation missing in model
         135  +
                           /* FluentBuilderGenerator.kt:500 */
  121    136   
    pub fn set_map(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>) -> Self {
  122    137   
        self.inner = self.inner.set_map(input);
  123    138   
        self
  124    139   
    }
         140  +
    /* FluentBuilderGenerator.kt:518 */
  125    141   
    #[allow(missing_docs)] // documentation missing in model
         142  +
                           /* FluentBuilderGenerator.kt:520 */
  126    143   
    pub fn get_map(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
  127    144   
        self.inner.get_map()
  128    145   
    }
         146  +
    /* FluentBuilderGenerator.kt:282 */
  129    147   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/null_in_non_sparse.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 `NullInNonSparse`.
           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 NullInNonSparse;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl NullInNonSparse {
    7         -
    /// Creates a new `NullInNonSparse`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `NullInNonSparse`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::null_in_non_sparse::NullInNonSparseInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::null_in_non_sparse::NullInNonSparseOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::null_in_non_sparse::NullInNonSparseError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   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 NullInNonSparse {
   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("NullInNonSparse");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            NullInNonSparseRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            NullInNonSparseResponseDeserializer,
  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   
            "NullInNonSparse",
  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("NullInNonSparse")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(NullInNonSparseEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::null_in_non_sparse::NullInNonSparseError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::null_in_non_sparse::NullInNonSparseError,
  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 NullInNonSparseResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NullInNonSparseResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_null_in_non_sparse::de_null_in_non_sparse_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_null_in_non_sparse::de_null_in_non_sparse_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 NullInNonSparseRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NullInNonSparseRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::null_in_non_sparse::NullInNonSparseInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::null_in_non_sparse::NullInNonSparseInput,
  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, "/null-in-non-sparse").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::null_in_non_sparse::NullInNonSparseInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct NullInNonSparseEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NullInNonSparseEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "NullInNonSparseEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<NullInNonSparseInput>()
  220    234   
            .ok_or("failed to downcast to NullInNonSparseInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod null_in_non_sparse_test {
  237    254   
  238    255   
    /// Test ID: NullInNonSparse
  239    256   
    #[::tokio::test]
  240    257   
    #[::tracing_test::traced_test]
  241    258   
    async fn null_in_non_sparse_response() {
  242    259   
        let expected_output = crate::operation::null_in_non_sparse::NullInNonSparseOutput::builder()
  243    260   
            .set_list(::std::option::Option::Some(vec!["one".to_owned(), "two".to_owned()]))
  244    261   
            .set_map(::std::option::Option::Some({
  245    262   
                let mut ret = ::std::collections::HashMap::new();
@@ -299,316 +438,538 @@
  319    336   
        });
  320    337   
        let parsed = parsed.expect_err("should be error response");
  321    338   
        let parsed: &crate::operation::null_in_non_sparse::NullInNonSparseError =
  322    339   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  323    340   
        if let crate::operation::null_in_non_sparse::NullInNonSparseError::ExtraError(parsed) = parsed {
  324    341   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  325    342   
        } else {
  326    343   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  327    344   
        }
  328    345   
    }
         346  +
         347  +
    /* ProtocolTestGenerator.kt:98 */
  329    348   
}
  330    349   
         350  +
/* OperationErrorGenerator.kt:79 */
  331    351   
/// Error type for the `NullInNonSparseError` operation.
         352  +
/* RustType.kt:516 */
  332    353   
#[non_exhaustive]
         354  +
/* RustType.kt:516 */
  333    355   
#[derive(::std::fmt::Debug)]
  334         -
pub enum NullInNonSparseError {
         356  +
pub /* OperationErrorGenerator.kt:81 */ enum NullInNonSparseError {
         357  +
    /* OperationErrorGenerator.kt:83 */
  335    358   
    #[allow(missing_docs)] // documentation missing in model
         359  +
    /* OperationErrorGenerator.kt:86 */
  336    360   
    ExtraError(crate::types::error::ExtraError),
         361  +
    /* OperationErrorGenerator.kt:88 */
  337    362   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  338    363   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  339    364   
    variable wildcard pattern and check `.code()`:
  340    365   
     \
  341    366   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  342    367   
     \
  343    368   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-NullInNonSparseError) for what information is available for the error.")]
  344    369   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         370  +
    /* OperationErrorGenerator.kt:81 */
  345    371   
}
         372  +
/* OperationErrorGenerator.kt:218 */
  346    373   
impl NullInNonSparseError {
         374  +
    /* OperationErrorGenerator.kt:219 */
  347    375   
    /// Creates the `NullInNonSparseError::Unhandled` variant from any error type.
  348    376   
    pub fn unhandled(
  349    377   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  350    378   
    ) -> Self {
  351    379   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  352    380   
            source: err.into(),
  353    381   
            meta: ::std::default::Default::default(),
  354    382   
        })
  355    383   
    }
  356    384   
  357    385   
    /// Creates the `NullInNonSparseError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  358    386   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  359    387   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  360    388   
            source: err.clone().into(),
  361    389   
            meta: err,
  362    390   
        })
  363    391   
    }
  364         -
    ///
         392  +
    /// /* OperationErrorGenerator.kt:236 */
  365    393   
    /// Returns error metadata, which includes the error code, message,
  366    394   
    /// request ID, and potentially additional information.
  367    395   
    ///
         396  +
    /* OperationErrorGenerator.kt:242 */
  368    397   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         398  +
        /* OperationErrorGenerator.kt:243 */
  369    399   
        match self {
  370         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  371         -
            Self::Unhandled(e) => &e.meta,
         400  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         401  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         402  +
            /* OperationErrorGenerator.kt:243 */
  372    403   
        }
         404  +
        /* OperationErrorGenerator.kt:242 */
  373    405   
    }
         406  +
    /* OperationErrorGenerator.kt:257 */
  374    407   
    /// Returns `true` if the error kind is `NullInNonSparseError::ExtraError`.
         408  +
    /* OperationErrorGenerator.kt:258 */
  375    409   
    pub fn is_extra_error(&self) -> bool {
         410  +
        /* OperationErrorGenerator.kt:259 */
  376    411   
        matches!(self, Self::ExtraError(_))
         412  +
        /* OperationErrorGenerator.kt:258 */
  377    413   
    }
         414  +
    /* OperationErrorGenerator.kt:218 */
  378    415   
}
         416  +
/* OperationErrorGenerator.kt:269 */
  379    417   
impl ::std::error::Error for NullInNonSparseError {
         418  +
    /* OperationErrorGenerator.kt:270 */
  380    419   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         420  +
        /* OperationErrorGenerator.kt:318 */
  381    421   
        match self {
  382         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  383         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         422  +
            /* OperationErrorGenerator.kt:321 */
         423  +
            Self::ExtraError(_inner) =>
         424  +
            /* OperationErrorGenerator.kt:283 */
         425  +
            {
         426  +
                ::std::option::Option::Some(_inner)
         427  +
            }
         428  +
            ,
         429  +
            /* OperationErrorGenerator.kt:326 */
         430  +
            Self::Unhandled(_inner) => {
         431  +
                /* OperationErrorGenerator.kt:279 */
         432  +
                ::std::option::Option::Some(&*_inner.source)
         433  +
                /* OperationErrorGenerator.kt:326 */
         434  +
            } /* OperationErrorGenerator.kt:318 */
  384    435   
        }
         436  +
        /* OperationErrorGenerator.kt:270 */
  385    437   
    }
         438  +
    /* OperationErrorGenerator.kt:269 */
  386    439   
}
         440  +
/* OperationErrorGenerator.kt:133 */
  387    441   
impl ::std::fmt::Display for NullInNonSparseError {
         442  +
    /* OperationErrorGenerator.kt:134 */
  388    443   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         444  +
        /* OperationErrorGenerator.kt:318 */
  389    445   
        match self {
  390         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         446  +
            /* OperationErrorGenerator.kt:321 */
         447  +
            Self::ExtraError(_inner) =>
         448  +
            /* OperationErrorGenerator.kt:151 */
         449  +
            {
         450  +
                _inner.fmt(f)
         451  +
            }
         452  +
            ,
         453  +
            /* OperationErrorGenerator.kt:326 */
  391    454   
            Self::Unhandled(_inner) => {
         455  +
                /* OperationErrorGenerator.kt:139 */
  392    456   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  393    457   
                    write!(f, "unhandled error ({code})")
  394    458   
                } else {
  395    459   
                    f.write_str("unhandled error")
  396    460   
                }
  397         -
            }
         461  +
                /* OperationErrorGenerator.kt:326 */
         462  +
            } /* OperationErrorGenerator.kt:318 */
  398    463   
        }
         464  +
        /* OperationErrorGenerator.kt:134 */
  399    465   
    }
         466  +
    /* OperationErrorGenerator.kt:133 */
  400    467   
}
         468  +
/* OperationErrorGenerator.kt:182 */
  401    469   
impl ::aws_smithy_types::retry::ProvideErrorKind for NullInNonSparseError {
         470  +
    /* OperationErrorGenerator.kt:186 */
  402    471   
    fn code(&self) -> ::std::option::Option<&str> {
         472  +
        /* OperationErrorGenerator.kt:187 */
  403    473   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         474  +
        /* OperationErrorGenerator.kt:186 */
  404    475   
    }
         476  +
    /* OperationErrorGenerator.kt:190 */
  405    477   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         478  +
        /* OperationErrorGenerator.kt:197 */
  406    479   
        ::std::option::Option::None
         480  +
        /* OperationErrorGenerator.kt:190 */
  407    481   
    }
         482  +
    /* OperationErrorGenerator.kt:182 */
  408    483   
}
         484  +
/* OperationErrorGenerator.kt:163 */
  409    485   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for NullInNonSparseError {
         486  +
    /* OperationErrorGenerator.kt:164 */
  410    487   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         488  +
        /* OperationErrorGenerator.kt:318 */
  411    489   
        match self {
  412         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  413         -
            Self::Unhandled(_inner) => &_inner.meta,
         490  +
            /* OperationErrorGenerator.kt:321 */
         491  +
            Self::ExtraError(_inner) =>
         492  +
            /* OperationErrorGenerator.kt:169 */
         493  +
            {
         494  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         495  +
            }
         496  +
            ,
         497  +
            /* OperationErrorGenerator.kt:326 */
         498  +
            Self::Unhandled(_inner) => {
         499  +
                /* OperationErrorGenerator.kt:168 */
         500  +
                &_inner.meta
         501  +
                /* OperationErrorGenerator.kt:326 */
         502  +
            } /* OperationErrorGenerator.kt:318 */
  414    503   
        }
         504  +
        /* OperationErrorGenerator.kt:164 */
  415    505   
    }
         506  +
    /* OperationErrorGenerator.kt:163 */
  416    507   
}
         508  +
/* OperationErrorGenerator.kt:109 */
  417    509   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for NullInNonSparseError {
         510  +
    /* OperationErrorGenerator.kt:110 */
  418    511   
    fn create_unhandled_error(
  419    512   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  420    513   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  421    514   
    ) -> Self {
         515  +
        /* OperationErrorGenerator.kt:121 */
  422    516   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  423    517   
            source,
  424    518   
            meta: meta.unwrap_or_default(),
  425    519   
        })
         520  +
        /* OperationErrorGenerator.kt:110 */
  426    521   
    }
         522  +
    /* OperationErrorGenerator.kt:109 */
  427    523   
}
  428    524   
         525  +
/* CodegenDelegator.kt:255 */
  429    526   
pub use crate::operation::null_in_non_sparse::_null_in_non_sparse_output::NullInNonSparseOutput;
  430    527   
         528  +
/* CodegenDelegator.kt:255 */
  431    529   
pub use crate::operation::null_in_non_sparse::_null_in_non_sparse_input::NullInNonSparseInput;
  432    530   
         531  +
/* RustModule.kt:172 */
  433    532   
mod _null_in_non_sparse_input;
  434    533   
         534  +
/* RustModule.kt:172 */
  435    535   
mod _null_in_non_sparse_output;
  436    536   
  437         -
/// Builders
         537  +
/// /* CodegenDelegator.kt:51 */Builders
  438    538   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/null_in_non_sparse/_null_in_non_sparse_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/null_in_non_sparse/_null_in_non_sparse_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/null_in_non_sparse/builders.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_header.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 `PrimitiveIntHeader`.
           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 PrimitiveIntHeader;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl PrimitiveIntHeader {
    7         -
    /// Creates a new `PrimitiveIntHeader`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `PrimitiveIntHeader`
          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::primitive_int_header::PrimitiveIntHeaderInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::primitive_int_header::PrimitiveIntHeaderOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   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 PrimitiveIntHeader {
   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("PrimitiveIntHeader");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            PrimitiveIntHeaderRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            PrimitiveIntHeaderResponseDeserializer,
  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   
            "PrimitiveIntHeader",
  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("PrimitiveIntHeader")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(PrimitiveIntHeaderEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::primitive_int_header::PrimitiveIntHeaderError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::primitive_int_header::PrimitiveIntHeaderError,
  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 PrimitiveIntHeaderResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PrimitiveIntHeaderResponseDeserializer {
  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_primitive_int_header::de_primitive_int_header_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_primitive_int_header::de_primitive_int_header_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 PrimitiveIntHeaderRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PrimitiveIntHeaderRequestSerializer {
  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::primitive_int_header::PrimitiveIntHeaderInput>()
  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::primitive_int_header::PrimitiveIntHeaderInput,
  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, "/primitive").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::primitive_int_header::PrimitiveIntHeaderInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct PrimitiveIntHeaderEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PrimitiveIntHeaderEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "PrimitiveIntHeaderEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<PrimitiveIntHeaderInput>()
  220    234   
            .ok_or("failed to downcast to PrimitiveIntHeaderInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod primitive_int_header_test {
  237    254   
  238    255   
    /// Test ID: DeserPrimitiveHeader
  239    256   
    #[::tokio::test]
  240    257   
    #[::tracing_test::traced_test]
  241    258   
    async fn deser_primitive_header_response() {
  242    259   
        let expected_output = crate::operation::primitive_int_header::PrimitiveIntHeaderOutput::builder()
  243    260   
            .set_field(::std::option::Option::Some(123))
  244    261   
            .build();
  245    262   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
@@ -330,347 +479,602 @@
  350    367   
        });
  351    368   
        let parsed = parsed.expect_err("should be error response");
  352    369   
        let parsed: &crate::operation::primitive_int_header::PrimitiveIntHeaderError =
  353    370   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  354    371   
        if let crate::operation::primitive_int_header::PrimitiveIntHeaderError::ExtraError(parsed) = parsed {
  355    372   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  356    373   
        } else {
  357    374   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  358    375   
        }
  359    376   
    }
         377  +
         378  +
    /* ProtocolTestGenerator.kt:98 */
  360    379   
}
  361    380   
         381  +
/* OperationErrorGenerator.kt:79 */
  362    382   
/// Error type for the `PrimitiveIntHeaderError` operation.
         383  +
/* RustType.kt:516 */
  363    384   
#[non_exhaustive]
         385  +
/* RustType.kt:516 */
  364    386   
#[derive(::std::fmt::Debug)]
  365         -
pub enum PrimitiveIntHeaderError {
  366         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         387  +
pub /* OperationErrorGenerator.kt:81 */ enum PrimitiveIntHeaderError {
         388  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         389  +
    /* OperationErrorGenerator.kt:86 */
  367    390   
    ValidationError(crate::types::error::ValidationError),
         391  +
    /* OperationErrorGenerator.kt:83 */
  368    392   
    #[allow(missing_docs)] // documentation missing in model
         393  +
    /* OperationErrorGenerator.kt:86 */
  369    394   
    ExtraError(crate::types::error::ExtraError),
         395  +
    /* OperationErrorGenerator.kt:88 */
  370    396   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  371    397   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  372    398   
    variable wildcard pattern and check `.code()`:
  373    399   
     \
  374    400   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  375    401   
     \
  376    402   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PrimitiveIntHeaderError) for what information is available for the error.")]
  377    403   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         404  +
    /* OperationErrorGenerator.kt:81 */
  378    405   
}
         406  +
/* OperationErrorGenerator.kt:218 */
  379    407   
impl PrimitiveIntHeaderError {
         408  +
    /* OperationErrorGenerator.kt:219 */
  380    409   
    /// Creates the `PrimitiveIntHeaderError::Unhandled` variant from any error type.
  381    410   
    pub fn unhandled(
  382    411   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  383    412   
    ) -> Self {
  384    413   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  385    414   
            source: err.into(),
  386    415   
            meta: ::std::default::Default::default(),
  387    416   
        })
  388    417   
    }
  389    418   
  390    419   
    /// Creates the `PrimitiveIntHeaderError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  391    420   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  392    421   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  393    422   
            source: err.clone().into(),
  394    423   
            meta: err,
  395    424   
        })
  396    425   
    }
  397         -
    ///
         426  +
    /// /* OperationErrorGenerator.kt:236 */
  398    427   
    /// Returns error metadata, which includes the error code, message,
  399    428   
    /// request ID, and potentially additional information.
  400    429   
    ///
         430  +
    /* OperationErrorGenerator.kt:242 */
  401    431   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         432  +
        /* OperationErrorGenerator.kt:243 */
  402    433   
        match self {
  403         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  404         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  405         -
            Self::Unhandled(e) => &e.meta,
         434  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         435  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         436  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         437  +
            /* OperationErrorGenerator.kt:243 */
  406    438   
        }
         439  +
        /* OperationErrorGenerator.kt:242 */
  407    440   
    }
         441  +
    /* OperationErrorGenerator.kt:257 */
  408    442   
    /// Returns `true` if the error kind is `PrimitiveIntHeaderError::ValidationError`.
         443  +
    /* OperationErrorGenerator.kt:258 */
  409    444   
    pub fn is_validation_error(&self) -> bool {
         445  +
        /* OperationErrorGenerator.kt:259 */
  410    446   
        matches!(self, Self::ValidationError(_))
         447  +
        /* OperationErrorGenerator.kt:258 */
  411    448   
    }
         449  +
    /* OperationErrorGenerator.kt:257 */
  412    450   
    /// Returns `true` if the error kind is `PrimitiveIntHeaderError::ExtraError`.
         451  +
    /* OperationErrorGenerator.kt:258 */
  413    452   
    pub fn is_extra_error(&self) -> bool {
         453  +
        /* OperationErrorGenerator.kt:259 */
  414    454   
        matches!(self, Self::ExtraError(_))
         455  +
        /* OperationErrorGenerator.kt:258 */
  415    456   
    }
         457  +
    /* OperationErrorGenerator.kt:218 */
  416    458   
}
         459  +
/* OperationErrorGenerator.kt:269 */
  417    460   
impl ::std::error::Error for PrimitiveIntHeaderError {
         461  +
    /* OperationErrorGenerator.kt:270 */
  418    462   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         463  +
        /* OperationErrorGenerator.kt:318 */
  419    464   
        match self {
  420         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  421         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  422         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         465  +
            /* OperationErrorGenerator.kt:321 */
         466  +
            Self::ValidationError(_inner) =>
         467  +
            /* OperationErrorGenerator.kt:283 */
         468  +
            {
         469  +
                ::std::option::Option::Some(_inner)
         470  +
            }
         471  +
            ,
         472  +
            /* OperationErrorGenerator.kt:321 */
         473  +
            Self::ExtraError(_inner) =>
         474  +
            /* OperationErrorGenerator.kt:283 */
         475  +
            {
         476  +
                ::std::option::Option::Some(_inner)
         477  +
            }
         478  +
            ,
         479  +
            /* OperationErrorGenerator.kt:326 */
         480  +
            Self::Unhandled(_inner) => {
         481  +
                /* OperationErrorGenerator.kt:279 */
         482  +
                ::std::option::Option::Some(&*_inner.source)
         483  +
                /* OperationErrorGenerator.kt:326 */
         484  +
            } /* OperationErrorGenerator.kt:318 */
  423    485   
        }
         486  +
        /* OperationErrorGenerator.kt:270 */
  424    487   
    }
         488  +
    /* OperationErrorGenerator.kt:269 */
  425    489   
}
         490  +
/* OperationErrorGenerator.kt:133 */
  426    491   
impl ::std::fmt::Display for PrimitiveIntHeaderError {
         492  +
    /* OperationErrorGenerator.kt:134 */
  427    493   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         494  +
        /* OperationErrorGenerator.kt:318 */
  428    495   
        match self {
  429         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  430         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         496  +
            /* OperationErrorGenerator.kt:321 */
         497  +
            Self::ValidationError(_inner) =>
         498  +
            /* OperationErrorGenerator.kt:151 */
         499  +
            {
         500  +
                _inner.fmt(f)
         501  +
            }
         502  +
            ,
         503  +
            /* OperationErrorGenerator.kt:321 */
         504  +
            Self::ExtraError(_inner) =>
         505  +
            /* OperationErrorGenerator.kt:151 */
         506  +
            {
         507  +
                _inner.fmt(f)
         508  +
            }
         509  +
            ,
         510  +
            /* OperationErrorGenerator.kt:326 */
  431    511   
            Self::Unhandled(_inner) => {
         512  +
                /* OperationErrorGenerator.kt:139 */
  432    513   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  433    514   
                    write!(f, "unhandled error ({code})")
  434    515   
                } else {
  435    516   
                    f.write_str("unhandled error")
  436    517   
                }
  437         -
            }
         518  +
                /* OperationErrorGenerator.kt:326 */
         519  +
            } /* OperationErrorGenerator.kt:318 */
  438    520   
        }
         521  +
        /* OperationErrorGenerator.kt:134 */
  439    522   
    }
         523  +
    /* OperationErrorGenerator.kt:133 */
  440    524   
}
         525  +
/* OperationErrorGenerator.kt:182 */
  441    526   
impl ::aws_smithy_types::retry::ProvideErrorKind for PrimitiveIntHeaderError {
         527  +
    /* OperationErrorGenerator.kt:186 */
  442    528   
    fn code(&self) -> ::std::option::Option<&str> {
         529  +
        /* OperationErrorGenerator.kt:187 */
  443    530   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         531  +
        /* OperationErrorGenerator.kt:186 */
  444    532   
    }
         533  +
    /* OperationErrorGenerator.kt:190 */
  445    534   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         535  +
        /* OperationErrorGenerator.kt:197 */
  446    536   
        ::std::option::Option::None
         537  +
        /* OperationErrorGenerator.kt:190 */
  447    538   
    }
         539  +
    /* OperationErrorGenerator.kt:182 */
  448    540   
}
         541  +
/* OperationErrorGenerator.kt:163 */
  449    542   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PrimitiveIntHeaderError {
         543  +
    /* OperationErrorGenerator.kt:164 */
  450    544   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         545  +
        /* OperationErrorGenerator.kt:318 */
  451    546   
        match self {
  452         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  453         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  454         -
            Self::Unhandled(_inner) => &_inner.meta,
         547  +
            /* OperationErrorGenerator.kt:321 */
         548  +
            Self::ValidationError(_inner) =>
         549  +
            /* OperationErrorGenerator.kt:169 */
         550  +
            {
         551  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         552  +
            }
         553  +
            ,
         554  +
            /* OperationErrorGenerator.kt:321 */
         555  +
            Self::ExtraError(_inner) =>
         556  +
            /* OperationErrorGenerator.kt:169 */
         557  +
            {
         558  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         559  +
            }
         560  +
            ,
         561  +
            /* OperationErrorGenerator.kt:326 */
         562  +
            Self::Unhandled(_inner) => {
         563  +
                /* OperationErrorGenerator.kt:168 */
         564  +
                &_inner.meta
         565  +
                /* OperationErrorGenerator.kt:326 */
         566  +
            } /* OperationErrorGenerator.kt:318 */
  455    567   
        }
         568  +
        /* OperationErrorGenerator.kt:164 */
  456    569   
    }
         570  +
    /* OperationErrorGenerator.kt:163 */
  457    571   
}
         572  +
/* OperationErrorGenerator.kt:109 */
  458    573   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PrimitiveIntHeaderError {
         574  +
    /* OperationErrorGenerator.kt:110 */
  459    575   
    fn create_unhandled_error(
  460    576   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  461    577   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  462    578   
    ) -> Self {
         579  +
        /* OperationErrorGenerator.kt:121 */
  463    580   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  464    581   
            source,
  465    582   
            meta: meta.unwrap_or_default(),
  466    583   
        })
         584  +
        /* OperationErrorGenerator.kt:110 */
  467    585   
    }
         586  +
    /* OperationErrorGenerator.kt:109 */
  468    587   
}
  469    588   
         589  +
/* CodegenDelegator.kt:255 */
  470    590   
pub use crate::operation::primitive_int_header::_primitive_int_header_output::PrimitiveIntHeaderOutput;
  471    591   
         592  +
/* CodegenDelegator.kt:255 */
  472    593   
pub use crate::operation::primitive_int_header::_primitive_int_header_input::PrimitiveIntHeaderInput;
  473    594   
         595  +
/* RustModule.kt:172 */
  474    596   
mod _primitive_int_header_input;
  475    597   
         598  +
/* RustModule.kt:172 */
  476    599   
mod _primitive_int_header_output;
  477    600   
  478         -
/// Builders
         601  +
/// /* CodegenDelegator.kt:51 */Builders
  479    602   
pub mod builders;