Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/meta.rs

@@ -1,1 +4,5 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* CrateVersionCustomization.kt:23 */
    3      4   
/// Crate version number.
    4      5   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");

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

@@ -1,1 +4,4 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Types for the `GreetingWithUnwrappedErrors` operation.
           2  +
/* CodegenDelegator.kt:51 */
           3  +
/// /* CodegenDelegator.kt:51 */Types for the `GreetingWithUnwrappedErrors` operation.
    4      4   
pub mod greeting_with_unwrapped_errors;

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors.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 `GreetingWithUnwrappedErrors`.
           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 GreetingWithUnwrappedErrors;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl GreetingWithUnwrappedErrors {
    7         -
    /// Creates a new `GreetingWithUnwrappedErrors`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `GreetingWithUnwrappedErrors`
          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::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
   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 GreetingWithUnwrappedErrors {
   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("GreetingWithUnwrappedErrors");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            GreetingWithUnwrappedErrorsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            GreetingWithUnwrappedErrorsResponseDeserializer,
  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   
            "GreetingWithUnwrappedErrors",
  111    122   
            "Rest XML 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("GreetingWithUnwrappedErrors")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(GreetingWithUnwrappedErrorsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
  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 GreetingWithUnwrappedErrorsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithUnwrappedErrorsResponseDeserializer {
  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_greeting_with_unwrapped_errors::de_greeting_with_unwrapped_errors_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_greeting_with_unwrapped_errors::de_greeting_with_unwrapped_errors_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 GreetingWithUnwrappedErrorsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GreetingWithUnwrappedErrorsRequestSerializer {
  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::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput>()
  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::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput,
  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, "/GreetingWithErrors").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::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  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 GreetingWithUnwrappedErrorsEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithUnwrappedErrorsEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "GreetingWithUnwrappedErrorsEndpointParamsInterceptor"
  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::<GreetingWithUnwrappedErrorsInput>()
  220    234   
            .ok_or("failed to downcast to GreetingWithUnwrappedErrorsInput")?;
  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 greeting_with_unwrapped_errors_test {
  237    254   
  238    255   
    /// Ensures that operations with errors successfully know how to deserialize the successful response
  239    256   
    /// Test ID: GreetingWithErrorsUnwrapped
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn greeting_with_errors_unwrapped_response() {
  243    260   
        let expected_output = crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput::builder()
  244    261   
            .set_greeting(::std::option::Option::Some("Hello".to_owned()))
  245    262   
            .build();
@@ -342,359 +491,615 @@
  362    379   
        let parsed: &crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError =
  363    380   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  364    381   
        if let crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::ComplexErrorUnwrapped(parsed) = parsed {
  365    382   
            ::pretty_assertions::assert_eq!(parsed.header, expected_output.header, "Unexpected value for `header`");
  366    383   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  367    384   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  368    385   
        } else {
  369    386   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  370    387   
        }
  371    388   
    }
         389  +
         390  +
    /* ProtocolTestGenerator.kt:98 */
  372    391   
}
  373    392   
         393  +
/* OperationErrorGenerator.kt:79 */
  374    394   
/// Error type for the `GreetingWithUnwrappedErrorsError` operation.
         395  +
/* RustType.kt:516 */
  375    396   
#[non_exhaustive]
         397  +
/* RustType.kt:516 */
  376    398   
#[derive(::std::fmt::Debug)]
  377         -
pub enum GreetingWithUnwrappedErrorsError {
  378         -
    /// This error is thrown when an invalid greeting value is provided.
         399  +
pub /* OperationErrorGenerator.kt:81 */ enum GreetingWithUnwrappedErrorsError {
         400  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when an invalid greeting value is provided.
         401  +
    /* OperationErrorGenerator.kt:86 */
  379    402   
    InvalidGreetingUnwrapped(crate::types::error::InvalidGreetingUnwrapped),
  380         -
    /// This error is thrown when a request is invalid.
         403  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when a request is invalid.
         404  +
    /* OperationErrorGenerator.kt:86 */
  381    405   
    ComplexErrorUnwrapped(crate::types::error::ComplexErrorUnwrapped),
         406  +
    /* OperationErrorGenerator.kt:88 */
  382    407   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  383    408   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  384    409   
    variable wildcard pattern and check `.code()`:
  385    410   
     \
  386    411   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  387    412   
     \
  388    413   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GreetingWithUnwrappedErrorsError) for what information is available for the error.")]
  389    414   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         415  +
    /* OperationErrorGenerator.kt:81 */
  390    416   
}
         417  +
/* OperationErrorGenerator.kt:218 */
  391    418   
impl GreetingWithUnwrappedErrorsError {
         419  +
    /* OperationErrorGenerator.kt:219 */
  392    420   
    /// Creates the `GreetingWithUnwrappedErrorsError::Unhandled` variant from any error type.
  393    421   
    pub fn unhandled(
  394    422   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  395    423   
    ) -> Self {
  396    424   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  397    425   
            source: err.into(),
  398    426   
            meta: ::std::default::Default::default(),
  399    427   
        })
  400    428   
    }
  401    429   
  402    430   
    /// Creates the `GreetingWithUnwrappedErrorsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  403    431   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  404    432   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  405    433   
            source: err.clone().into(),
  406    434   
            meta: err,
  407    435   
        })
  408    436   
    }
  409         -
    ///
         437  +
    /// /* OperationErrorGenerator.kt:236 */
  410    438   
    /// Returns error metadata, which includes the error code, message,
  411    439   
    /// request ID, and potentially additional information.
  412    440   
    ///
         441  +
    /* OperationErrorGenerator.kt:242 */
  413    442   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         443  +
        /* OperationErrorGenerator.kt:243 */
  414    444   
        match self {
         445  +
            /* OperationErrorGenerator.kt:246 */
  415    446   
            Self::InvalidGreetingUnwrapped(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         447  +
            /* OperationErrorGenerator.kt:246 */
  416    448   
            Self::ComplexErrorUnwrapped(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  417         -
            Self::Unhandled(e) => &e.meta,
         449  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         450  +
            /* OperationErrorGenerator.kt:243 */
  418    451   
        }
         452  +
        /* OperationErrorGenerator.kt:242 */
  419    453   
    }
         454  +
    /* OperationErrorGenerator.kt:257 */
  420    455   
    /// Returns `true` if the error kind is `GreetingWithUnwrappedErrorsError::InvalidGreetingUnwrapped`.
         456  +
    /* OperationErrorGenerator.kt:258 */
  421    457   
    pub fn is_invalid_greeting_unwrapped(&self) -> bool {
         458  +
        /* OperationErrorGenerator.kt:259 */
  422    459   
        matches!(self, Self::InvalidGreetingUnwrapped(_))
         460  +
        /* OperationErrorGenerator.kt:258 */
  423    461   
    }
         462  +
    /* OperationErrorGenerator.kt:257 */
  424    463   
    /// Returns `true` if the error kind is `GreetingWithUnwrappedErrorsError::ComplexErrorUnwrapped`.
         464  +
    /* OperationErrorGenerator.kt:258 */
  425    465   
    pub fn is_complex_error_unwrapped(&self) -> bool {
         466  +
        /* OperationErrorGenerator.kt:259 */
  426    467   
        matches!(self, Self::ComplexErrorUnwrapped(_))
         468  +
        /* OperationErrorGenerator.kt:258 */
  427    469   
    }
         470  +
    /* OperationErrorGenerator.kt:218 */
  428    471   
}
         472  +
/* OperationErrorGenerator.kt:269 */
  429    473   
impl ::std::error::Error for GreetingWithUnwrappedErrorsError {
         474  +
    /* OperationErrorGenerator.kt:270 */
  430    475   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         476  +
        /* OperationErrorGenerator.kt:318 */
  431    477   
        match self {
  432         -
            Self::InvalidGreetingUnwrapped(_inner) => ::std::option::Option::Some(_inner),
  433         -
            Self::ComplexErrorUnwrapped(_inner) => ::std::option::Option::Some(_inner),
  434         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         478  +
            /* OperationErrorGenerator.kt:321 */
         479  +
            Self::InvalidGreetingUnwrapped(_inner) =>
         480  +
            /* OperationErrorGenerator.kt:283 */
         481  +
            {
         482  +
                ::std::option::Option::Some(_inner)
         483  +
            }
         484  +
            ,
         485  +
            /* OperationErrorGenerator.kt:321 */
         486  +
            Self::ComplexErrorUnwrapped(_inner) =>
         487  +
            /* OperationErrorGenerator.kt:283 */
         488  +
            {
         489  +
                ::std::option::Option::Some(_inner)
         490  +
            }
         491  +
            ,
         492  +
            /* OperationErrorGenerator.kt:326 */
         493  +
            Self::Unhandled(_inner) => {
         494  +
                /* OperationErrorGenerator.kt:279 */
         495  +
                ::std::option::Option::Some(&*_inner.source)
         496  +
                /* OperationErrorGenerator.kt:326 */
         497  +
            } /* OperationErrorGenerator.kt:318 */
  435    498   
        }
         499  +
        /* OperationErrorGenerator.kt:270 */
  436    500   
    }
         501  +
    /* OperationErrorGenerator.kt:269 */
  437    502   
}
         503  +
/* OperationErrorGenerator.kt:133 */
  438    504   
impl ::std::fmt::Display for GreetingWithUnwrappedErrorsError {
         505  +
    /* OperationErrorGenerator.kt:134 */
  439    506   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         507  +
        /* OperationErrorGenerator.kt:318 */
  440    508   
        match self {
  441         -
            Self::InvalidGreetingUnwrapped(_inner) => _inner.fmt(f),
  442         -
            Self::ComplexErrorUnwrapped(_inner) => _inner.fmt(f),
         509  +
            /* OperationErrorGenerator.kt:321 */
         510  +
            Self::InvalidGreetingUnwrapped(_inner) =>
         511  +
            /* OperationErrorGenerator.kt:151 */
         512  +
            {
         513  +
                _inner.fmt(f)
         514  +
            }
         515  +
            ,
         516  +
            /* OperationErrorGenerator.kt:321 */
         517  +
            Self::ComplexErrorUnwrapped(_inner) =>
         518  +
            /* OperationErrorGenerator.kt:151 */
         519  +
            {
         520  +
                _inner.fmt(f)
         521  +
            }
         522  +
            ,
         523  +
            /* OperationErrorGenerator.kt:326 */
  443    524   
            Self::Unhandled(_inner) => {
         525  +
                /* OperationErrorGenerator.kt:139 */
  444    526   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  445    527   
                    write!(f, "unhandled error ({code})")
  446    528   
                } else {
  447    529   
                    f.write_str("unhandled error")
  448    530   
                }
         531  +
                /* OperationErrorGenerator.kt:326 */
         532  +
            } /* OperationErrorGenerator.kt:318 */
  449    533   
        }
         534  +
        /* OperationErrorGenerator.kt:134 */
  450    535   
    }
  451         -
    }
         536  +
    /* OperationErrorGenerator.kt:133 */
  452    537   
}
         538  +
/* OperationErrorGenerator.kt:182 */
  453    539   
impl ::aws_smithy_types::retry::ProvideErrorKind for GreetingWithUnwrappedErrorsError {
         540  +
    /* OperationErrorGenerator.kt:186 */
  454    541   
    fn code(&self) -> ::std::option::Option<&str> {
         542  +
        /* OperationErrorGenerator.kt:187 */
  455    543   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         544  +
        /* OperationErrorGenerator.kt:186 */
  456    545   
    }
         546  +
    /* OperationErrorGenerator.kt:190 */
  457    547   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         548  +
        /* OperationErrorGenerator.kt:197 */
  458    549   
        ::std::option::Option::None
         550  +
        /* OperationErrorGenerator.kt:190 */
  459    551   
    }
         552  +
    /* OperationErrorGenerator.kt:182 */
  460    553   
}
         554  +
/* OperationErrorGenerator.kt:163 */
  461    555   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GreetingWithUnwrappedErrorsError {
         556  +
    /* OperationErrorGenerator.kt:164 */
  462    557   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         558  +
        /* OperationErrorGenerator.kt:318 */
  463    559   
        match self {
  464         -
            Self::InvalidGreetingUnwrapped(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  465         -
            Self::ComplexErrorUnwrapped(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  466         -
            Self::Unhandled(_inner) => &_inner.meta,
         560  +
            /* OperationErrorGenerator.kt:321 */
         561  +
            Self::InvalidGreetingUnwrapped(_inner) =>
         562  +
            /* OperationErrorGenerator.kt:169 */
         563  +
            {
         564  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         565  +
            }
         566  +
            ,
         567  +
            /* OperationErrorGenerator.kt:321 */
         568  +
            Self::ComplexErrorUnwrapped(_inner) =>
         569  +
            /* OperationErrorGenerator.kt:169 */
         570  +
            {
         571  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         572  +
            }
         573  +
            ,
         574  +
            /* OperationErrorGenerator.kt:326 */
         575  +
            Self::Unhandled(_inner) => {
         576  +
                /* OperationErrorGenerator.kt:168 */
         577  +
                &_inner.meta
         578  +
                /* OperationErrorGenerator.kt:326 */
         579  +
            } /* OperationErrorGenerator.kt:318 */
  467    580   
        }
         581  +
        /* OperationErrorGenerator.kt:164 */
  468    582   
    }
         583  +
    /* OperationErrorGenerator.kt:163 */
  469    584   
}
         585  +
/* OperationErrorGenerator.kt:109 */
  470    586   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GreetingWithUnwrappedErrorsError {
         587  +
    /* OperationErrorGenerator.kt:110 */
  471    588   
    fn create_unhandled_error(
  472    589   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  473    590   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  474    591   
    ) -> Self {
         592  +
        /* OperationErrorGenerator.kt:121 */
  475    593   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  476    594   
            source,
  477    595   
            meta: meta.unwrap_or_default(),
  478    596   
        })
         597  +
        /* OperationErrorGenerator.kt:110 */
  479    598   
    }
         599  +
    /* OperationErrorGenerator.kt:109 */
  480    600   
}
  481    601   
         602  +
/* CodegenDelegator.kt:255 */
  482    603   
pub use crate::operation::greeting_with_unwrapped_errors::_greeting_with_unwrapped_errors_output::GreetingWithUnwrappedErrorsOutput;
  483    604   
         605  +
/* CodegenDelegator.kt:255 */
  484    606   
pub use crate::operation::greeting_with_unwrapped_errors::_greeting_with_unwrapped_errors_input::GreetingWithUnwrappedErrorsInput;
  485    607   
         608  +
/* RustModule.kt:172 */
  486    609   
mod _greeting_with_unwrapped_errors_input;
  487    610   
         611  +
/* RustModule.kt:172 */
  488    612   
mod _greeting_with_unwrapped_errors_output;
  489    613   
  490         -
/// Builders
         614  +
/// /* CodegenDelegator.kt:51 */Builders
  491    615   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors/_greeting_with_unwrapped_errors_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors/_greeting_with_unwrapped_errors_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors/builders.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/primitives.rs

@@ -1,1 +7,8 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
    3      4   
pub use ::aws_smithy_types::Blob;
    4         -
pub use ::aws_smithy_types::DateTime;
           5  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
    5      6   
    6         -
/// Event stream related primitives such as `Message` or `Header`.
           7  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
    7      8   
pub mod event_stream;

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/protocol_serde.rs

@@ -1,1 +34,38 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ResponseDeserializerGenerator.kt:170 */
    2      3   
pub(crate) fn type_erase_result<O, E>(
    3      4   
    result: ::std::result::Result<O, E>,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6      7   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7      8   
>
    8      9   
where
    9     10   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     11   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     12   
{
   12     13   
    result
   13     14   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     15   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     16   
        .map_err(::std::convert::Into::into)
   16     17   
}
   17     18   
          19  +
/* RestXml.kt:61 */
   18     20   
pub fn parse_http_error_metadata(
   19     21   
    _response_status: u16,
   20     22   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     23   
    response_body: &[u8],
   22     24   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_xml::decode::XmlDecodeError> {
          25  +
    /* RestXml.kt:65 */
   23     26   
    crate::rest_xml_unwrapped_errors::parse_error_metadata(response_body)
          27  +
    /* RestXml.kt:61 */
   24     28   
}
   25     29   
   26     30   
pub(crate) mod shape_greeting_with_unwrapped_errors;
   27     31   
   28     32   
pub(crate) mod shape_complex_error_unwrapped;
   29     33   
   30     34   
pub(crate) mod shape_greeting_with_unwrapped_errors_output;
   31     35   
   32     36   
pub(crate) mod shape_invalid_greeting_unwrapped;
   33     37   

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/protocol_serde/shape_complex_error_unwrapped.rs

@@ -1,1 +49,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(unused_mut)]
           4  +
/* XmlBindingTraitParserGenerator.kt:221 */
    3      5   
pub fn de_complex_error_unwrapped_xml_err(
    4      6   
    inp: &[u8],
    5      7   
    mut builder: crate::types::error::builders::ComplexErrorUnwrappedBuilder,
    6      8   
) -> std::result::Result<crate::types::error::builders::ComplexErrorUnwrappedBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
           9  +
    /* XmlBindingTraitParserGenerator.kt:227 */
    7     10   
    if inp.is_empty() {
    8     11   
        return Ok(builder);
    9     12   
    }
          13  +
    /* XmlBindingTraitParserGenerator.kt:229 */
   10     14   
    let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   11     15   
    #[allow(unused_mut)]
   12     16   
    let mut error_decoder = crate::rest_xml_unwrapped_errors::error_scope(&mut document)?;
          17  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   13     18   
    while let Some(mut tag) = error_decoder.next_tag() {
          19  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   14     20   
        match tag.start_el() {
   15         -
            s if s.matches("Nested") /* Nested aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$Nested */ =>  {
   16         -
                let var_1 =
   17         -
                    Some(
   18         -
                        crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(&mut tag)
   19         -
                        ?
   20         -
                    )
   21         -
                ;
   22         -
                builder = builder.set_nested(var_1);
   23         -
            }
          21  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("Nested") /* Nested aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$Nested */ =>  {
          22  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          23  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          24  +
                        /* XmlBindingTraitParserGenerator.kt:536 */crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(&mut tag)
          25  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          26  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          27  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          28  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_nested(var_1);
          29  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   24     30   
            ,
   25         -
            s if s.matches("TopLevel") /* TopLevel aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$TopLevel */ =>  {
   26         -
                let var_2 =
   27         -
                    Some(
   28         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   29         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   30         -
                            .into()
   31         -
                        )
   32         -
                        ?
   33         -
                    )
   34         -
                ;
   35         -
                builder = builder.set_top_level(var_2);
   36         -
            }
          31  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("TopLevel") /* TopLevel aws.protocoltests.restxmlunwrapped#ComplexErrorUnwrapped$TopLevel */ =>  {
          32  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_2 =
          33  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          34  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          35  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          36  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          37  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          38  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          39  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          40  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          41  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_top_level(var_2);
          42  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   37     43   
            ,
   38         -
            _ => {}
   39         -
        }
          44  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          45  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          46  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   40     47   
    }
          48  +
    /* XmlBindingTraitParserGenerator.kt:240 */
   41     49   
    Ok(builder)
          50  +
    /* XmlBindingTraitParserGenerator.kt:221 */
   42     51   
}
   43     52   
          53  +
/* HttpBindingGenerator.kt:153 */
   44     54   
pub(crate) fn de_header_header(
   45     55   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   46     56   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
          57  +
    /* HttpBindingGenerator.kt:160 */
   47     58   
    let headers = header_map.get_all("X-Header");
          59  +
    /* HttpBindingGenerator.kt:375 */
   48     60   
    ::aws_smithy_http::header::one_or_none(headers)
          61  +
    /* HttpBindingGenerator.kt:153 */
   49     62   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/protocol_serde/shape_complex_nested_error_data.rs

@@ -1,1 +27,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::needless_question_mark)]
           4  +
/* XmlBindingTraitParserGenerator.kt:510 */
    3      5   
pub fn de_complex_nested_error_data(
    4      6   
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    5      7   
) -> ::std::result::Result<crate::types::ComplexNestedErrorData, ::aws_smithy_xml::decode::XmlDecodeError> {
           8  +
    /* RustType.kt:516 */
    6      9   
    #[allow(unused_mut)]
          10  +
    /* XmlBindingTraitParserGenerator.kt:515 */
    7     11   
    let mut builder = crate::types::ComplexNestedErrorData::builder();
          12  +
    /* XmlBindingTraitParserGenerator.kt:352 */
    8     13   
    while let Some(mut tag) = decoder.next_tag() {
          14  +
        /* XmlBindingTraitParserGenerator.kt:353 */
    9     15   
        match tag.start_el() {
   10         -
            s if s.matches("Foo") /* Foo aws.protocoltests.restxmlunwrapped#ComplexNestedErrorData$Foo */ =>  {
   11         -
                let var_1 =
   12         -
                    Some(
   13         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   14         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   15         -
                            .into()
   16         -
                        )
   17         -
                        ?
   18         -
                    )
   19         -
                ;
   20         -
                builder = builder.set_foo(var_1);
   21         -
            }
          16  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("Foo") /* Foo aws.protocoltests.restxmlunwrapped#ComplexNestedErrorData$Foo */ =>  {
          17  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          18  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          19  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          20  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          21  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          22  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          23  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          24  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          25  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          26  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_foo(var_1);
          27  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   22     28   
            ,
   23         -
            _ => {}
   24         -
        }
          29  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          30  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          31  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   25     32   
    }
          33  +
    /* XmlBindingTraitParserGenerator.kt:533 */
   26     34   
    Ok(builder.build())
          35  +
    /* XmlBindingTraitParserGenerator.kt:510 */
   27     36   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/protocol_serde/shape_greeting_with_unwrapped_errors.rs

@@ -1,1 +81,108 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_greeting_with_unwrapped_errors_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput,
    9     11   
    crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "InvalidGreetingUnwrapped" => crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::InvalidGreetingUnwrapped({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::InvalidGreetingUnwrappedBuilder::default();
   27         -
                output = crate::protocol_serde::shape_invalid_greeting_unwrapped::de_invalid_greeting_unwrapped_xml_err(_response_body, output)
   28         -
                    .map_err(crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InvalidGreetingUnwrappedBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_greeting_unwrapped::de_invalid_greeting_unwrapped_xml_err(_response_body, output).map_err(crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:170 */
   32     43   
            if tmp.message.is_none() {
   33     44   
                tmp.message = _error_message;
   34     45   
            }
          46  +
            /* ProtocolParserGenerator.kt:179 */
   35     47   
            tmp
          48  +
            /* ProtocolParserGenerator.kt:139 */
   36     49   
        }),
          50  +
        /* ProtocolParserGenerator.kt:139 */
   37     51   
        "ComplexErrorUnwrapped" => crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::ComplexErrorUnwrapped({
          52  +
            /* RustType.kt:516 */
   38     53   
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ComplexErrorUnwrappedBuilder::default();
   42         -
                output = crate::protocol_serde::shape_complex_error_unwrapped::de_complex_error_unwrapped_xml_err(_response_body, output)
   43         -
                    .map_err(crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled)?;
   44         -
                output = output.set_header(
   45         -
                    crate::protocol_serde::shape_complex_error_unwrapped::de_header_header(_response_headers).map_err(|_| {
   46         -
                        crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled(
   47         -
                            "Failed to parse Header from header `X-Header",
   48         -
                        )
   49         -
                    })?,
   50         -
                );
   51         -
                let output = output.meta(generic);
   52         -
                output.build()
   53         -
            };
          54  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          55  +
                /* ProtocolParserGenerator.kt:146 */ {
          56  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          57  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ComplexErrorUnwrappedBuilder::default();
          58  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_complex_error_unwrapped::de_complex_error_unwrapped_xml_err(_response_body, output).map_err(crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled)?;
          59  +
                    /* ProtocolParserGenerator.kt:267 */output = output.set_header(
          60  +
                        /* ProtocolParserGenerator.kt:302 */crate::protocol_serde::shape_complex_error_unwrapped::de_header_header(_response_headers)
          61  +
                                                    .map_err(|_|crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled("Failed to parse Header from header `X-Header"))?
          62  +
                    /* ProtocolParserGenerator.kt:267 */);
          63  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          64  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          65  +
                /* ProtocolParserGenerator.kt:146 */}
          66  +
            /* ProtocolParserGenerator.kt:145 */;
          67  +
            /* ProtocolParserGenerator.kt:179 */
   54     68   
            tmp
          69  +
            /* ProtocolParserGenerator.kt:139 */
   55     70   
        }),
   56         -
        _ => crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::generic(generic),
          71  +
        /* ProtocolParserGenerator.kt:182 */
          72  +
        _ => crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   57     73   
    })
          74  +
    /* ProtocolParserGenerator.kt:99 */
   58     75   
}
   59     76   
          77  +
/* RustType.kt:516 */
   60     78   
#[allow(clippy::unnecessary_wraps)]
          79  +
/* ProtocolParserGenerator.kt:71 */
   61     80   
pub fn de_greeting_with_unwrapped_errors_http_response(
   62     81   
    _response_status: u16,
   63     82   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   64     83   
    _response_body: &[u8],
   65     84   
) -> std::result::Result<
   66     85   
    crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsOutput,
   67     86   
    crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError,
   68     87   
> {
          88  +
    /* ProtocolParserGenerator.kt:77 */
   69     89   
    Ok({
          90  +
        /* RustType.kt:516 */
   70     91   
        #[allow(unused_mut)]
          92  +
        /* ProtocolParserGenerator.kt:240 */
   71     93   
        let mut output = crate::operation::greeting_with_unwrapped_errors::builders::GreetingWithUnwrappedErrorsOutputBuilder::default();
          94  +
        /* ProtocolParserGenerator.kt:267 */
   72     95   
        output = output.set_greeting(
          96  +
            /* ProtocolParserGenerator.kt:302 */
   73     97   
            crate::protocol_serde::shape_greeting_with_unwrapped_errors_output::de_greeting_header(_response_headers).map_err(|_| {
   74     98   
                crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsError::unhandled(
   75     99   
                    "Failed to parse greeting from header `X-Greeting",
   76    100   
                )
   77         -
            })?,
         101  +
            })?, /* ProtocolParserGenerator.kt:267 */
   78    102   
        );
         103  +
        /* ClientBuilderInstantiator.kt:56 */
   79    104   
        output.build()
         105  +
        /* ProtocolParserGenerator.kt:77 */
   80    106   
    })
         107  +
    /* ProtocolParserGenerator.kt:71 */
   81    108   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/protocol_serde/shape_greeting_with_unwrapped_errors_output.rs

@@ -1,1 +7,11 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_greeting_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
           6  +
    /* HttpBindingGenerator.kt:160 */
    5      7   
    let headers = header_map.get_all("X-Greeting");
           8  +
    /* HttpBindingGenerator.kt:375 */
    6      9   
    ::aws_smithy_http::header::one_or_none(headers)
          10  +
    /* HttpBindingGenerator.kt:153 */
    7     11   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/protocol_serde/shape_invalid_greeting_unwrapped.rs

@@ -1,1 +32,41 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(unused_mut)]
           4  +
/* XmlBindingTraitParserGenerator.kt:221 */
    3      5   
pub fn de_invalid_greeting_unwrapped_xml_err(
    4      6   
    inp: &[u8],
    5      7   
    mut builder: crate::types::error::builders::InvalidGreetingUnwrappedBuilder,
    6      8   
) -> std::result::Result<crate::types::error::builders::InvalidGreetingUnwrappedBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
           9  +
    /* XmlBindingTraitParserGenerator.kt:227 */
    7     10   
    if inp.is_empty() {
    8     11   
        return Ok(builder);
    9     12   
    }
          13  +
    /* XmlBindingTraitParserGenerator.kt:229 */
   10     14   
    let mut document = ::aws_smithy_xml::decode::Document::try_from(inp)?;
   11     15   
    #[allow(unused_mut)]
   12     16   
    let mut error_decoder = crate::rest_xml_unwrapped_errors::error_scope(&mut document)?;
          17  +
    /* XmlBindingTraitParserGenerator.kt:352 */
   13     18   
    while let Some(mut tag) = error_decoder.next_tag() {
          19  +
        /* XmlBindingTraitParserGenerator.kt:353 */
   14     20   
        match tag.start_el() {
   15         -
            s if s.matches("Message") /* Message aws.protocoltests.restxmlunwrapped#InvalidGreetingUnwrapped$Message */ =>  {
   16         -
                let var_1 =
   17         -
                    Some(
   18         -
                        Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
   19         -
                            ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
   20         -
                            .into()
   21         -
                        )
   22         -
                        ?
   23         -
                    )
   24         -
                ;
   25         -
                builder = builder.set_message(var_1);
   26         -
            }
          21  +
            /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("Message") /* Message aws.protocoltests.restxmlunwrapped#InvalidGreetingUnwrapped$Message */ =>  {
          22  +
                /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
          23  +
                    /* XmlBindingTraitParserGenerator.kt:372 */Some(
          24  +
                        /* XmlBindingTraitParserGenerator.kt:729 */Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
          25  +
                            /* XmlBindingTraitParserGenerator.kt:377 */::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
          26  +
                            /* XmlBindingTraitParserGenerator.kt:748 */.into()
          27  +
                        /* XmlBindingTraitParserGenerator.kt:729 */)
          28  +
                        /* XmlBindingTraitParserGenerator.kt:402 */?
          29  +
                    /* XmlBindingTraitParserGenerator.kt:372 */)
          30  +
                /* XmlBindingTraitParserGenerator.kt:329 */;
          31  +
                /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_message(var_1);
          32  +
            /* XmlBindingTraitParserGenerator.kt:492 */}
   27     33   
            ,
   28         -
            _ => {}
   29         -
        }
          34  +
            /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
          35  +
        /* XmlBindingTraitParserGenerator.kt:353 */}
          36  +
        /* XmlBindingTraitParserGenerator.kt:352 */
   30     37   
    }
          38  +
    /* XmlBindingTraitParserGenerator.kt:240 */
   31     39   
    Ok(builder)
          40  +
    /* XmlBindingTraitParserGenerator.kt:221 */
   32     41   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/types.rs

@@ -1,1 +10,12 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_complex_nested_error_data::ComplexNestedErrorData;
    3      4   
           5  +
/* RustModule.kt:172 */
    4      6   
mod _complex_nested_error_data;
    5      7   
    6         -
/// Builders
           8  +
/// /* CodegenDelegator.kt:51 */Builders
    7      9   
pub mod builders;
    8     10   
    9         -
/// Error types that the service can respond with.
          11  +
/// /* ClientRustModule.kt:121 */Error types that the service can respond with.
   10     12   
pub mod error;

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/types/_complex_nested_error_data.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/types/builders.rs

@@ -1,1 +2,3 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_complex_nested_error_data::ComplexNestedErrorDataBuilder;