Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/create_foo.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 `CreateFoo`.
           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 CreateFoo;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl CreateFoo {
    7         -
    /// Creates a new `CreateFoo`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `CreateFoo`
          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::create_foo::CreateFooInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::create_foo::CreateFooOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::create_foo::CreateFooError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +327,398 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateFoo {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateFoo");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            CreateFooRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            CreateFooResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "CreateFoo",
  105    116   
            "Rest XML Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateFoo")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(CreateFooEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::create_foo::CreateFooError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::create_foo::CreateFooError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct CreateFooResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateFooResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_create_foo::de_create_foo_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_create_foo::de_create_foo_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct CreateFooRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateFooRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input.downcast::<crate::operation::create_foo::CreateFooInput>().expect("correct type");
  161    174   
        let _header_serialization_settings = _cfg
  162    175   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163    176   
            .cloned()
  164    177   
            .unwrap_or_default();
  165    178   
        let mut request_builder = {
  166    179   
            fn uri_base(
  167    180   
                _input: &crate::operation::create_foo::CreateFooInput,
  168    181   
                output: &mut ::std::string::String,
  169    182   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  170    183   
                use ::std::fmt::Write as _;
  171    184   
                ::std::write!(output, "/reused-input").expect("formatting should succeed");
  172    185   
                ::std::result::Result::Ok(())
  173    186   
            }
  174    187   
            #[allow(clippy::unnecessary_wraps)]
  175    188   
            fn update_http_builder(
  176    189   
                input: &crate::operation::create_foo::CreateFooInput,
  177    190   
                builder: ::http::request::Builder,
  178    191   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  179    192   
                let mut uri = ::std::string::String::new();
  180    193   
                uri_base(input, &mut uri)?;
  181    194   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  182    195   
            }
  183    196   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  184    197   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
  185    198   
            builder
  186    199   
        };
  187    200   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_foo::ser_create_foo_op_input(&input)?);
  188    201   
        if let Some(content_length) = body.content_length() {
  189    202   
            let content_length = content_length.to_string();
  190    203   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  191    204   
        }
  192    205   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  193    206   
    }
  194    207   
}
         208  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  195    209   
#[derive(Debug)]
  196    210   
struct CreateFooEndpointParamsInterceptor;
  197    211   
  198    212   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateFooEndpointParamsInterceptor {
  199    213   
    fn name(&self) -> &'static str {
  200    214   
        "CreateFooEndpointParamsInterceptor"
  201    215   
    }
  202    216   
  203    217   
    fn read_before_execution(
  204    218   
        &self,
  205    219   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  206    220   
            '_,
  207    221   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  208    222   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  210    224   
        >,
  211    225   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  212    226   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  213    227   
        let _input = context
  214    228   
            .input()
  215    229   
            .downcast_ref::<CreateFooInput>()
  216    230   
            .ok_or("failed to downcast to CreateFooInput")?;
  217    231   
  218    232   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  220    234   
        })?;
  221    235   
        cfg.interceptor_state()
  222    236   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  223    237   
        ::std::result::Result::Ok(())
  224    238   
    }
  225    239   
}
  226    240   
  227    241   
// The get_* functions below are generated from JMESPath expressions in the
  228    242   
// operationContextParams trait. They target the operation's input shape.
  229    243   
         244  +
/* OperationErrorGenerator.kt:79 */
  230    245   
/// Error type for the `CreateFooError` operation.
         246  +
/* RustType.kt:516 */
  231    247   
#[non_exhaustive]
         248  +
/* RustType.kt:516 */
  232    249   
#[derive(::std::fmt::Debug)]
  233         -
pub enum CreateFooError {
         250  +
pub /* OperationErrorGenerator.kt:81 */ enum CreateFooError {
         251  +
    /* OperationErrorGenerator.kt:88 */
  234    252   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  235    253   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  236    254   
    variable wildcard pattern and check `.code()`:
  237    255   
     \
  238    256   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  239    257   
     \
  240    258   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateFooError) for what information is available for the error.")]
  241    259   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         260  +
    /* OperationErrorGenerator.kt:81 */
  242    261   
}
         262  +
/* OperationErrorGenerator.kt:218 */
  243    263   
impl CreateFooError {
         264  +
    /* OperationErrorGenerator.kt:219 */
  244    265   
    /// Creates the `CreateFooError::Unhandled` variant from any error type.
  245    266   
    pub fn unhandled(
  246    267   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  247    268   
    ) -> Self {
  248    269   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  249    270   
            source: err.into(),
  250    271   
            meta: ::std::default::Default::default(),
  251    272   
        })
  252    273   
    }
  253    274   
  254    275   
    /// Creates the `CreateFooError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  255    276   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  256    277   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  257    278   
            source: err.clone().into(),
  258    279   
            meta: err,
  259    280   
        })
  260    281   
    }
  261         -
    ///
         282  +
    /// /* OperationErrorGenerator.kt:236 */
  262    283   
    /// Returns error metadata, which includes the error code, message,
  263    284   
    /// request ID, and potentially additional information.
  264    285   
    ///
         286  +
    /* OperationErrorGenerator.kt:242 */
  265    287   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         288  +
        /* OperationErrorGenerator.kt:243 */
  266    289   
        match self {
  267         -
            Self::Unhandled(e) => &e.meta,
         290  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         291  +
            /* OperationErrorGenerator.kt:243 */
  268    292   
        }
         293  +
        /* OperationErrorGenerator.kt:242 */
  269    294   
    }
         295  +
    /* OperationErrorGenerator.kt:218 */
  270    296   
}
         297  +
/* OperationErrorGenerator.kt:269 */
  271    298   
impl ::std::error::Error for CreateFooError {
         299  +
    /* OperationErrorGenerator.kt:270 */
  272    300   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         301  +
        /* OperationErrorGenerator.kt:318 */
  273    302   
        match self {
  274         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         303  +
            /* OperationErrorGenerator.kt:326 */
         304  +
            Self::Unhandled(_inner) => {
         305  +
                /* OperationErrorGenerator.kt:279 */
         306  +
                ::std::option::Option::Some(&*_inner.source)
         307  +
                /* OperationErrorGenerator.kt:326 */
         308  +
            } /* OperationErrorGenerator.kt:318 */
  275    309   
        }
         310  +
        /* OperationErrorGenerator.kt:270 */
  276    311   
    }
         312  +
    /* OperationErrorGenerator.kt:269 */
  277    313   
}
         314  +
/* OperationErrorGenerator.kt:133 */
  278    315   
impl ::std::fmt::Display for CreateFooError {
         316  +
    /* OperationErrorGenerator.kt:134 */
  279    317   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         318  +
        /* OperationErrorGenerator.kt:318 */
  280    319   
        match self {
         320  +
            /* OperationErrorGenerator.kt:326 */
  281    321   
            Self::Unhandled(_inner) => {
         322  +
                /* OperationErrorGenerator.kt:139 */
  282    323   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  283    324   
                    write!(f, "unhandled error ({code})")
  284    325   
                } else {
  285    326   
                    f.write_str("unhandled error")
  286    327   
                }
  287         -
            }
         328  +
                /* OperationErrorGenerator.kt:326 */
         329  +
            } /* OperationErrorGenerator.kt:318 */
  288    330   
        }
         331  +
        /* OperationErrorGenerator.kt:134 */
  289    332   
    }
         333  +
    /* OperationErrorGenerator.kt:133 */
  290    334   
}
         335  +
/* OperationErrorGenerator.kt:182 */
  291    336   
impl ::aws_smithy_types::retry::ProvideErrorKind for CreateFooError {
         337  +
    /* OperationErrorGenerator.kt:186 */
  292    338   
    fn code(&self) -> ::std::option::Option<&str> {
         339  +
        /* OperationErrorGenerator.kt:187 */
  293    340   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         341  +
        /* OperationErrorGenerator.kt:186 */
  294    342   
    }
         343  +
    /* OperationErrorGenerator.kt:190 */
  295    344   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         345  +
        /* OperationErrorGenerator.kt:197 */
  296    346   
        ::std::option::Option::None
         347  +
        /* OperationErrorGenerator.kt:190 */
  297    348   
    }
         349  +
    /* OperationErrorGenerator.kt:182 */
  298    350   
}
         351  +
/* OperationErrorGenerator.kt:163 */
  299    352   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateFooError {
         353  +
    /* OperationErrorGenerator.kt:164 */
  300    354   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         355  +
        /* OperationErrorGenerator.kt:318 */
  301    356   
        match self {
  302         -
            Self::Unhandled(_inner) => &_inner.meta,
         357  +
            /* OperationErrorGenerator.kt:326 */
         358  +
            Self::Unhandled(_inner) => {
         359  +
                /* OperationErrorGenerator.kt:168 */
         360  +
                &_inner.meta
         361  +
                /* OperationErrorGenerator.kt:326 */
         362  +
            } /* OperationErrorGenerator.kt:318 */
  303    363   
        }
         364  +
        /* OperationErrorGenerator.kt:164 */
  304    365   
    }
         366  +
    /* OperationErrorGenerator.kt:163 */
  305    367   
}
         368  +
/* OperationErrorGenerator.kt:109 */
  306    369   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateFooError {
         370  +
    /* OperationErrorGenerator.kt:110 */
  307    371   
    fn create_unhandled_error(
  308    372   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  309    373   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  310    374   
    ) -> Self {
         375  +
        /* OperationErrorGenerator.kt:121 */
  311    376   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  312    377   
            source,
  313    378   
            meta: meta.unwrap_or_default(),
  314    379   
        })
         380  +
        /* OperationErrorGenerator.kt:110 */
  315    381   
    }
         382  +
    /* OperationErrorGenerator.kt:109 */
  316    383   
}
  317    384   
         385  +
/* CodegenDelegator.kt:255 */
  318    386   
pub use crate::operation::create_foo::_create_foo_output::CreateFooOutput;
  319    387   
         388  +
/* CodegenDelegator.kt:255 */
  320    389   
pub use crate::operation::create_foo::_create_foo_input::CreateFooInput;
  321    390   
         391  +
/* RustModule.kt:172 */
  322    392   
mod _create_foo_input;
  323    393   
         394  +
/* RustModule.kt:172 */
  324    395   
mod _create_foo_output;
  325    396   
  326         -
/// Builders
         397  +
/// /* CodegenDelegator.kt:51 */Builders
  327    398   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/create_foo/_create_foo_input.rs

@@ -1,1 +47,91 @@
    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 CreateFooInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct CreateFooInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub input: ::std::option::Option<crate::types::CreateFooInput>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl CreateFooInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn input(&self) -> ::std::option::Option<&crate::types::CreateFooInput> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.input.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl CreateFooInput {
   16         -
    /// Creates a new builder-style object to manufacture [`CreateFooInput`](crate::operation::create_foo::CreateFooInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CreateFooInput`](crate::operation::create_foo::CreateFooInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::create_foo::builders::CreateFooInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::create_foo::builders::CreateFooInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`CreateFooInput`](crate::operation::create_foo::CreateFooInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`CreateFooInput`](crate::operation::create_foo::CreateFooInput).
          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 CreateFooInputBuilder {
   26         -
    pub(crate) input: ::std::option::Option<crate::types::CreateFooInput>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) input: ::std::option::Option<crate::types::CreateFooInput>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl CreateFooInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn input(mut self, input: crate::types::CreateFooInput) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.input = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_input(mut self, input: ::std::option::Option<crate::types::CreateFooInput>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.input = 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_input(&self) -> &::std::option::Option<crate::types::CreateFooInput> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.input
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`CreateFooInput`](crate::operation::create_foo::CreateFooInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CreateFooInput`](crate::operation::create_foo::CreateFooInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> ::std::result::Result<crate::operation::create_foo::CreateFooInput, ::aws_smithy_types::error::operation::BuildError> {
   45         -
        ::std::result::Result::Ok(crate::operation::create_foo::CreateFooInput { input: self.input })
          80  +
        /* BuilderGenerator.kt:254 */
          81  +
        ::std::result::Result::Ok(
          82  +
            /* BuilderGenerator.kt:477 */
          83  +
            crate::operation::create_foo::CreateFooInput {
          84  +
                /* BuilderGenerator.kt:481 */ input: self.input,
          85  +
                /* BuilderGenerator.kt:477 */
          86  +
            }, /* BuilderGenerator.kt:254 */
          87  +
        )
          88  +
        /* BuilderGenerator.kt:253 */
   46     89   
    }
          90  +
    /* BuilderGenerator.kt:355 */
   47     91   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/create_foo/_create_foo_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/create_foo/builders.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/enum_keys.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 `EnumKeys`.
           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 EnumKeys;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EnumKeys {
    7         -
    /// Creates a new `EnumKeys`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EnumKeys`
          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::enum_keys::EnumKeysInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::enum_keys::EnumKeysOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::enum_keys::EnumKeysError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -53,62 +257,274 @@
   73     82   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   74     83   
            }
   75     84   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   76     85   
                config_override,
   77     86   
                client_config.config.clone(),
   78     87   
                &client_config.runtime_components,
   79     88   
            ));
   80     89   
        }
   81     90   
        runtime_plugins
   82     91   
    }
          92  +
    /* OperationGenerator.kt:85 */
   83     93   
}
          94  +
/* OperationRuntimePluginGenerator.kt:55 */
   84     95   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for EnumKeys {
   85     96   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   86     97   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("EnumKeys");
   87     98   
   88     99   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   89    100   
            EnumKeysRequestSerializer,
   90    101   
        ));
   91    102   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   92    103   
            EnumKeysResponseDeserializer,
   93    104   
        ));
   94    105   
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   96    107   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  100    111   
            "EnumKeys",
  101    112   
            "Rest XML Protocol",
  102    113   
        ));
  103    114   
  104    115   
        ::std::option::Option::Some(cfg.freeze())
  105    116   
    }
  106    117   
  107    118   
    fn runtime_components(
  108    119   
        &self,
  109    120   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  110    121   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  111    122   
        #[allow(unused_mut)]
  112    123   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("EnumKeys")
  113    124   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  114    125   
            .with_interceptor(EnumKeysEndpointParamsInterceptor)
  115    126   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  116    127   
                crate::operation::enum_keys::EnumKeysError,
  117    128   
            >::new())
  118    129   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  119    130   
                crate::operation::enum_keys::EnumKeysError,
  120    131   
            >::new());
  121    132   
  122    133   
        ::std::borrow::Cow::Owned(rcb)
  123    134   
    }
  124    135   
}
  125    136   
         137  +
/* ResponseDeserializerGenerator.kt:64 */
  126    138   
#[derive(Debug)]
  127    139   
struct EnumKeysResponseDeserializer;
  128    140   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EnumKeysResponseDeserializer {
  129    141   
    fn deserialize_nonstreaming(
  130    142   
        &self,
  131    143   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  132    144   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  133    145   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  134    146   
        let headers = response.headers();
  135    147   
        let body = response.body().bytes().expect("body loaded");
  136    148   
        #[allow(unused_mut)]
  137    149   
        let mut force_error = false;
  138    150   
  139    151   
        let parse_result = if !success && status != 200 || force_error {
  140    152   
            crate::protocol_serde::shape_enum_keys::de_enum_keys_http_error(status, headers, body)
  141    153   
        } else {
  142    154   
            crate::protocol_serde::shape_enum_keys::de_enum_keys_http_response(status, headers, body)
  143    155   
        };
  144    156   
        crate::protocol_serde::type_erase_result(parse_result)
  145    157   
    }
  146    158   
}
         159  +
/* RequestSerializerGenerator.kt:67 */
  147    160   
#[derive(Debug)]
  148    161   
struct EnumKeysRequestSerializer;
  149    162   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EnumKeysRequestSerializer {
  150    163   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  151    164   
    fn serialize_input(
  152    165   
        &self,
  153    166   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  154    167   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  155    168   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  156    169   
        let input = input.downcast::<crate::operation::enum_keys::EnumKeysInput>().expect("correct type");
  157    170   
        let _header_serialization_settings = _cfg
  158    171   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  159    172   
            .cloned()
  160    173   
            .unwrap_or_default();
  161    174   
        let mut request_builder = {
  162    175   
            fn uri_base(
  163    176   
                _input: &crate::operation::enum_keys::EnumKeysInput,
  164    177   
                output: &mut ::std::string::String,
  165    178   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  166    179   
                use ::std::fmt::Write as _;
  167    180   
                ::std::write!(output, "/enumkeys").expect("formatting should succeed");
  168    181   
                ::std::result::Result::Ok(())
  169    182   
            }
  170    183   
            #[allow(clippy::unnecessary_wraps)]
  171    184   
            fn update_http_builder(
  172    185   
                input: &crate::operation::enum_keys::EnumKeysInput,
  173    186   
                builder: ::http::request::Builder,
  174    187   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  175    188   
                let mut uri = ::std::string::String::new();
  176    189   
                uri_base(input, &mut uri)?;
  177    190   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  178    191   
            }
  179    192   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  180    193   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
  181    194   
            builder
  182    195   
        };
  183    196   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_enum_keys::ser_enum_keys_op_input(&input)?);
  184    197   
        if let Some(content_length) = body.content_length() {
  185    198   
            let content_length = content_length.to_string();
  186    199   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  187    200   
        }
  188    201   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  189    202   
    }
  190    203   
}
         204  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  191    205   
#[derive(Debug)]
  192    206   
struct EnumKeysEndpointParamsInterceptor;
  193    207   
  194    208   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnumKeysEndpointParamsInterceptor {
  195    209   
    fn name(&self) -> &'static str {
  196    210   
        "EnumKeysEndpointParamsInterceptor"
  197    211   
    }
  198    212   
  199    213   
    fn read_before_execution(
  200    214   
        &self,
  201    215   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  202    216   
            '_,
  203    217   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  204    218   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  205    219   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  206    220   
        >,
  207    221   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  208    222   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  209    223   
        let _input = context
  210    224   
            .input()
  211    225   
            .downcast_ref::<EnumKeysInput>()
  212    226   
            .ok_or("failed to downcast to EnumKeysInput")?;
  213    227   
  214    228   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  216    230   
        })?;
  217    231   
        cfg.interceptor_state()
  218    232   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  219    233   
        ::std::result::Result::Ok(())
  220    234   
    }
  221    235   
}
  222    236   
  223    237   
// The get_* functions below are generated from JMESPath expressions in the
  224    238   
// operationContextParams trait. They target the operation's input shape.
  225    239   
         240  +
/* RustType.kt:516 */
  226    241   
#[allow(unreachable_code, unused_variables)]
         242  +
/* RustType.kt:516 */
  227    243   
#[cfg(test)]
         244  +
/* ProtocolTestGenerator.kt:98 */
  228    245   
mod enum_keys_test {
  229    246   
  230    247   
    /// Test ID: SerEnumMap
  231    248   
    #[::tokio::test]
  232    249   
    #[::tracing_test::traced_test]
  233    250   
    async fn ser_enum_map_request() {
  234    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  235    252   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  236    253   
  237    254   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
@@ -280,297 +409,485 @@
  300    317   
                )))
  301    318   
            });
  302    319   
            de.deserialize_nonstreaming(&http_response)
  303    320   
        });
  304    321   
        let parsed = parsed
  305    322   
            .expect("should be successful response")
  306    323   
            .downcast::<crate::operation::enum_keys::EnumKeysOutput>()
  307    324   
            .unwrap();
  308    325   
        ::pretty_assertions::assert_eq!(parsed.data, expected_output.data, "Unexpected value for `data`");
  309    326   
    }
         327  +
         328  +
    /* ProtocolTestGenerator.kt:98 */
  310    329   
}
  311    330   
         331  +
/* OperationErrorGenerator.kt:79 */
  312    332   
/// Error type for the `EnumKeysError` operation.
         333  +
/* RustType.kt:516 */
  313    334   
#[non_exhaustive]
         335  +
/* RustType.kt:516 */
  314    336   
#[derive(::std::fmt::Debug)]
  315         -
pub enum EnumKeysError {
         337  +
pub /* OperationErrorGenerator.kt:81 */ enum EnumKeysError {
         338  +
    /* OperationErrorGenerator.kt:88 */
  316    339   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  317    340   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  318    341   
    variable wildcard pattern and check `.code()`:
  319    342   
     \
  320    343   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  321    344   
     \
  322    345   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EnumKeysError) for what information is available for the error.")]
  323    346   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         347  +
    /* OperationErrorGenerator.kt:81 */
  324    348   
}
         349  +
/* OperationErrorGenerator.kt:218 */
  325    350   
impl EnumKeysError {
         351  +
    /* OperationErrorGenerator.kt:219 */
  326    352   
    /// Creates the `EnumKeysError::Unhandled` variant from any error type.
  327    353   
    pub fn unhandled(
  328    354   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  329    355   
    ) -> Self {
  330    356   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  331    357   
            source: err.into(),
  332    358   
            meta: ::std::default::Default::default(),
  333    359   
        })
  334    360   
    }
  335    361   
  336    362   
    /// Creates the `EnumKeysError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  337    363   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  338    364   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  339    365   
            source: err.clone().into(),
  340    366   
            meta: err,
  341    367   
        })
  342    368   
    }
  343         -
    ///
         369  +
    /// /* OperationErrorGenerator.kt:236 */
  344    370   
    /// Returns error metadata, which includes the error code, message,
  345    371   
    /// request ID, and potentially additional information.
  346    372   
    ///
         373  +
    /* OperationErrorGenerator.kt:242 */
  347    374   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         375  +
        /* OperationErrorGenerator.kt:243 */
  348    376   
        match self {
  349         -
            Self::Unhandled(e) => &e.meta,
         377  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         378  +
            /* OperationErrorGenerator.kt:243 */
  350    379   
        }
         380  +
        /* OperationErrorGenerator.kt:242 */
  351    381   
    }
         382  +
    /* OperationErrorGenerator.kt:218 */
  352    383   
}
         384  +
/* OperationErrorGenerator.kt:269 */
  353    385   
impl ::std::error::Error for EnumKeysError {
         386  +
    /* OperationErrorGenerator.kt:270 */
  354    387   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         388  +
        /* OperationErrorGenerator.kt:318 */
  355    389   
        match self {
  356         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         390  +
            /* OperationErrorGenerator.kt:326 */
         391  +
            Self::Unhandled(_inner) => {
         392  +
                /* OperationErrorGenerator.kt:279 */
         393  +
                ::std::option::Option::Some(&*_inner.source)
         394  +
                /* OperationErrorGenerator.kt:326 */
         395  +
            } /* OperationErrorGenerator.kt:318 */
  357    396   
        }
         397  +
        /* OperationErrorGenerator.kt:270 */
  358    398   
    }
         399  +
    /* OperationErrorGenerator.kt:269 */
  359    400   
}
         401  +
/* OperationErrorGenerator.kt:133 */
  360    402   
impl ::std::fmt::Display for EnumKeysError {
         403  +
    /* OperationErrorGenerator.kt:134 */
  361    404   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         405  +
        /* OperationErrorGenerator.kt:318 */
  362    406   
        match self {
         407  +
            /* OperationErrorGenerator.kt:326 */
  363    408   
            Self::Unhandled(_inner) => {
         409  +
                /* OperationErrorGenerator.kt:139 */
  364    410   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  365    411   
                    write!(f, "unhandled error ({code})")
  366    412   
                } else {
  367    413   
                    f.write_str("unhandled error")
  368    414   
                }
  369         -
            }
         415  +
                /* OperationErrorGenerator.kt:326 */
         416  +
            } /* OperationErrorGenerator.kt:318 */
  370    417   
        }
         418  +
        /* OperationErrorGenerator.kt:134 */
  371    419   
    }
         420  +
    /* OperationErrorGenerator.kt:133 */
  372    421   
}
         422  +
/* OperationErrorGenerator.kt:182 */
  373    423   
impl ::aws_smithy_types::retry::ProvideErrorKind for EnumKeysError {
         424  +
    /* OperationErrorGenerator.kt:186 */
  374    425   
    fn code(&self) -> ::std::option::Option<&str> {
         426  +
        /* OperationErrorGenerator.kt:187 */
  375    427   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         428  +
        /* OperationErrorGenerator.kt:186 */
  376    429   
    }
         430  +
    /* OperationErrorGenerator.kt:190 */
  377    431   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         432  +
        /* OperationErrorGenerator.kt:197 */
  378    433   
        ::std::option::Option::None
         434  +
        /* OperationErrorGenerator.kt:190 */
  379    435   
    }
         436  +
    /* OperationErrorGenerator.kt:182 */
  380    437   
}
         438  +
/* OperationErrorGenerator.kt:163 */
  381    439   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EnumKeysError {
         440  +
    /* OperationErrorGenerator.kt:164 */
  382    441   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         442  +
        /* OperationErrorGenerator.kt:318 */
  383    443   
        match self {
  384         -
            Self::Unhandled(_inner) => &_inner.meta,
         444  +
            /* OperationErrorGenerator.kt:326 */
         445  +
            Self::Unhandled(_inner) => {
         446  +
                /* OperationErrorGenerator.kt:168 */
         447  +
                &_inner.meta
         448  +
                /* OperationErrorGenerator.kt:326 */
         449  +
            } /* OperationErrorGenerator.kt:318 */
  385    450   
        }
         451  +
        /* OperationErrorGenerator.kt:164 */
  386    452   
    }
         453  +
    /* OperationErrorGenerator.kt:163 */
  387    454   
}
         455  +
/* OperationErrorGenerator.kt:109 */
  388    456   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EnumKeysError {
         457  +
    /* OperationErrorGenerator.kt:110 */
  389    458   
    fn create_unhandled_error(
  390    459   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  391    460   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  392    461   
    ) -> Self {
         462  +
        /* OperationErrorGenerator.kt:121 */
  393    463   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  394    464   
            source,
  395    465   
            meta: meta.unwrap_or_default(),
  396    466   
        })
         467  +
        /* OperationErrorGenerator.kt:110 */
  397    468   
    }
         469  +
    /* OperationErrorGenerator.kt:109 */
  398    470   
}
  399    471   
         472  +
/* CodegenDelegator.kt:255 */
  400    473   
pub use crate::operation::enum_keys::_enum_keys_output::EnumKeysOutput;
  401    474   
         475  +
/* CodegenDelegator.kt:255 */
  402    476   
pub use crate::operation::enum_keys::_enum_keys_input::EnumKeysInput;
  403    477   
         478  +
/* RustModule.kt:172 */
  404    479   
mod _enum_keys_input;
  405    480   
         481  +
/* RustModule.kt:172 */
  406    482   
mod _enum_keys_output;
  407    483   
  408         -
/// Builders
         484  +
/// /* CodegenDelegator.kt:51 */Builders
  409    485   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/enum_keys/_enum_keys_input.rs

@@ -1,1 +52,97 @@
    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 EnumKeysInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct EnumKeysInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub data: ::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 EnumKeysInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn data(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.data.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl EnumKeysInput {
   16         -
    /// Creates a new builder-style object to manufacture [`EnumKeysInput`](crate::operation::enum_keys::EnumKeysInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EnumKeysInput`](crate::operation::enum_keys::EnumKeysInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::enum_keys::builders::EnumKeysInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::enum_keys::builders::EnumKeysInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`EnumKeysInput`](crate::operation::enum_keys::EnumKeysInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`EnumKeysInput`](crate::operation::enum_keys::EnumKeysInput).
          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 EnumKeysInputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) data: ::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 EnumKeysInputBuilder {
   29         -
    /// Adds a key-value pair to `data`.
          51  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `data`.
          52  +
    /* BuilderGenerator.kt:437 */
   30     53   
    ///
   31         -
    /// To override the contents of this collection use [`set_data`](Self::set_data).
          54  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_data`](Self::set_data).
          55  +
    /* BuilderGenerator.kt:439 */
   32     56   
    ///
          57  +
    /* BuilderGenerator.kt:445 */
   33     58   
    pub fn data(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.data.unwrap_or_default();
   35     61   
        hash_map.insert(k, v.into());
   36     62   
        self.data = ::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_data(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>) -> Self {
          70  +
        /* BuilderGenerator.kt:315 */
   41     71   
        self.data = 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_data(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          79  +
        /* BuilderGenerator.kt:337 */
   46     80   
        &self.data
          81  +
        /* BuilderGenerator.kt:336 */
   47     82   
    }
   48         -
    /// Consumes the builder and constructs a [`EnumKeysInput`](crate::operation::enum_keys::EnumKeysInput).
          83  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EnumKeysInput`](crate::operation::enum_keys::EnumKeysInput).
          84  +
    /* BuilderGenerator.kt:253 */
   49     85   
    pub fn build(self) -> ::std::result::Result<crate::operation::enum_keys::EnumKeysInput, ::aws_smithy_types::error::operation::BuildError> {
   50         -
        ::std::result::Result::Ok(crate::operation::enum_keys::EnumKeysInput { data: self.data })
          86  +
        /* BuilderGenerator.kt:254 */
          87  +
        ::std::result::Result::Ok(
          88  +
            /* BuilderGenerator.kt:477 */
          89  +
            crate::operation::enum_keys::EnumKeysInput {
          90  +
                /* BuilderGenerator.kt:481 */ data: self.data,
          91  +
                /* BuilderGenerator.kt:477 */
          92  +
            }, /* BuilderGenerator.kt:254 */
          93  +
        )
          94  +
        /* BuilderGenerator.kt:253 */
   51     95   
    }
          96  +
    /* BuilderGenerator.kt:355 */
   52     97   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/enum_keys/_enum_keys_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 EnumKeysOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct EnumKeysOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub data: ::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 EnumKeysOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn data(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.data.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl EnumKeysOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`EnumKeysOutput`](crate::operation::enum_keys::EnumKeysOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EnumKeysOutput`](crate::operation::enum_keys::EnumKeysOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::enum_keys::builders::EnumKeysOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::enum_keys::builders::EnumKeysOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`EnumKeysOutput`](crate::operation::enum_keys::EnumKeysOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`EnumKeysOutput`](crate::operation::enum_keys::EnumKeysOutput).
          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 EnumKeysOutputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) data: ::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 EnumKeysOutputBuilder {
   29         -
    /// Adds a key-value pair to `data`.
          51  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `data`.
          52  +
    /* BuilderGenerator.kt:437 */
   30     53   
    ///
   31         -
    /// To override the contents of this collection use [`set_data`](Self::set_data).
          54  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_data`](Self::set_data).
          55  +
    /* BuilderGenerator.kt:439 */
   32     56   
    ///
          57  +
    /* BuilderGenerator.kt:445 */
   33     58   
    pub fn data(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.data.unwrap_or_default();
   35     61   
        hash_map.insert(k, v.into());
   36     62   
        self.data = ::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_data(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>) -> Self {
          70  +
        /* BuilderGenerator.kt:315 */
   41     71   
        self.data = 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_data(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>> {
          79  +
        /* BuilderGenerator.kt:337 */
   46     80   
        &self.data
          81  +
        /* BuilderGenerator.kt:336 */
   47     82   
    }
   48         -
    /// Consumes the builder and constructs a [`EnumKeysOutput`](crate::operation::enum_keys::EnumKeysOutput).
          83  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EnumKeysOutput`](crate::operation::enum_keys::EnumKeysOutput).
          84  +
    /* BuilderGenerator.kt:253 */
   49     85   
    pub fn build(self) -> crate::operation::enum_keys::EnumKeysOutput {
   50         -
        crate::operation::enum_keys::EnumKeysOutput { data: self.data }
          86  +
        /* BuilderGenerator.kt:477 */
          87  +
        crate::operation::enum_keys::EnumKeysOutput {
          88  +
            /* BuilderGenerator.kt:481 */ data: self.data,
          89  +
            /* BuilderGenerator.kt:477 */
          90  +
        }
          91  +
        /* BuilderGenerator.kt:253 */
   51     92   
    }
          93  +
    /* BuilderGenerator.kt:355 */
   52     94   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/enum_keys/builders.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/primitive_int_op_xml.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 `PrimitiveIntOpXml`.
           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 PrimitiveIntOpXml;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl PrimitiveIntOpXml {
    7         -
    /// Creates a new `PrimitiveIntOpXml`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `PrimitiveIntOpXml`
          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_op_xml::PrimitiveIntOpXmlInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +388,464 @@
   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 PrimitiveIntOpXml {
   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("PrimitiveIntOpXml");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            PrimitiveIntOpXmlRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            PrimitiveIntOpXmlResponseDeserializer,
  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   
            "PrimitiveIntOpXml",
  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("PrimitiveIntOpXml")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(PrimitiveIntOpXmlEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
  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 PrimitiveIntOpXmlResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PrimitiveIntOpXmlResponseDeserializer {
  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_op_xml::de_primitive_int_op_xml_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_primitive_int_op_xml::de_primitive_int_op_xml_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 PrimitiveIntOpXmlRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PrimitiveIntOpXmlRequestSerializer {
  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_op_xml::PrimitiveIntOpXmlInput>()
  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_op_xml::PrimitiveIntOpXmlInput,
  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-document").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_op_xml::PrimitiveIntOpXmlInput,
  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/xml");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_primitive_int_op_xml::ser_primitive_int_op_xml_op_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 PrimitiveIntOpXmlEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PrimitiveIntOpXmlEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "PrimitiveIntOpXmlEndpointParamsInterceptor"
  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::<PrimitiveIntOpXmlInput>()
  226    240   
            .ok_or("failed to downcast to PrimitiveIntOpXmlInput")?;
  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 primitive_int_op_xml_test {
  243    260   
  244    261   
    /// Primitive ints should not be serialized when they are unset
  245    262   
    /// Test ID: RestXmlSerPrimitiveIntUnset
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn rest_xml_ser_primitive_int_unset_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
  252    269   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    270   
        let result = client.primitive_int_op_xml().send().await;
  254    271   
        let _ = dbg!(result);
  255    272   
        let http_request = request_receiver.expect_request();
  256    273   
        let body = http_request.body().bytes().expect("body should be strict");
  257    274   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  258    275   
            body,
  259    276   
            "    <PrimitiveIntDocument>\n    </PrimitiveIntDocument>\n",
  260    277   
            ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  261    278   
        ));
  262    279   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  263    280   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  264    281   
        ::pretty_assertions::assert_eq!(uri.path(), "/primitive-document", "path was incorrect");
  265    282   
    }
  266    283   
  267    284   
    /// Primitive ints should not be serialized when they are unset
  268    285   
    /// Test ID: RestXmlSerPrimitiveIntSetToDefault
  269    286   
    #[::tokio::test]
  270    287   
    #[::tracing_test::traced_test]
  271    288   
    async fn rest_xml_ser_primitive_int_set_to_default_request() {
  272    289   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  273    290   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  274    291   
  275    292   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  276    293   
        let result = client.primitive_int_op_xml().set_value(::std::option::Option::Some(1)).send().await;
  277    294   
        let _ = dbg!(result);
  278    295   
        let http_request = request_receiver.expect_request();
  279    296   
        let body = http_request.body().bytes().expect("body should be strict");
  280    297   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  281    298   
            body,
  282    299   
            "<PrimitiveIntDocument>\n     <value>1</value>\n</PrimitiveIntDocument>\n",
  283    300   
            ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  284    301   
        ));
  285    302   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  286    303   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  287    304   
        ::pretty_assertions::assert_eq!(uri.path(), "/primitive-document", "path was incorrect");
  288    305   
    }
         306  +
         307  +
    /* ProtocolTestGenerator.kt:98 */
  289    308   
}
  290    309   
         310  +
/* OperationErrorGenerator.kt:79 */
  291    311   
/// Error type for the `PrimitiveIntOpXmlError` operation.
         312  +
/* RustType.kt:516 */
  292    313   
#[non_exhaustive]
         314  +
/* RustType.kt:516 */
  293    315   
#[derive(::std::fmt::Debug)]
  294         -
pub enum PrimitiveIntOpXmlError {
         316  +
pub /* OperationErrorGenerator.kt:81 */ enum PrimitiveIntOpXmlError {
         317  +
    /* OperationErrorGenerator.kt:88 */
  295    318   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  296    319   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  297    320   
    variable wildcard pattern and check `.code()`:
  298    321   
     \
  299    322   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  300    323   
     \
  301    324   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PrimitiveIntOpXmlError) for what information is available for the error.")]
  302    325   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         326  +
    /* OperationErrorGenerator.kt:81 */
  303    327   
}
         328  +
/* OperationErrorGenerator.kt:218 */
  304    329   
impl PrimitiveIntOpXmlError {
         330  +
    /* OperationErrorGenerator.kt:219 */
  305    331   
    /// Creates the `PrimitiveIntOpXmlError::Unhandled` variant from any error type.
  306    332   
    pub fn unhandled(
  307    333   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  308    334   
    ) -> Self {
  309    335   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  310    336   
            source: err.into(),
  311    337   
            meta: ::std::default::Default::default(),
  312    338   
        })
  313    339   
    }
  314    340   
  315    341   
    /// Creates the `PrimitiveIntOpXmlError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  316    342   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  317    343   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  318    344   
            source: err.clone().into(),
  319    345   
            meta: err,
  320    346   
        })
  321    347   
    }
  322         -
    ///
         348  +
    /// /* OperationErrorGenerator.kt:236 */
  323    349   
    /// Returns error metadata, which includes the error code, message,
  324    350   
    /// request ID, and potentially additional information.
  325    351   
    ///
         352  +
    /* OperationErrorGenerator.kt:242 */
  326    353   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         354  +
        /* OperationErrorGenerator.kt:243 */
  327    355   
        match self {
  328         -
            Self::Unhandled(e) => &e.meta,
         356  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         357  +
            /* OperationErrorGenerator.kt:243 */
  329    358   
        }
         359  +
        /* OperationErrorGenerator.kt:242 */
  330    360   
    }
         361  +
    /* OperationErrorGenerator.kt:218 */
  331    362   
}
         363  +
/* OperationErrorGenerator.kt:269 */
  332    364   
impl ::std::error::Error for PrimitiveIntOpXmlError {
         365  +
    /* OperationErrorGenerator.kt:270 */
  333    366   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         367  +
        /* OperationErrorGenerator.kt:318 */
  334    368   
        match self {
  335         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         369  +
            /* OperationErrorGenerator.kt:326 */
         370  +
            Self::Unhandled(_inner) => {
         371  +
                /* OperationErrorGenerator.kt:279 */
         372  +
                ::std::option::Option::Some(&*_inner.source)
         373  +
                /* OperationErrorGenerator.kt:326 */
         374  +
            } /* OperationErrorGenerator.kt:318 */
  336    375   
        }
         376  +
        /* OperationErrorGenerator.kt:270 */
  337    377   
    }
         378  +
    /* OperationErrorGenerator.kt:269 */
  338    379   
}
         380  +
/* OperationErrorGenerator.kt:133 */
  339    381   
impl ::std::fmt::Display for PrimitiveIntOpXmlError {
         382  +
    /* OperationErrorGenerator.kt:134 */
  340    383   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         384  +
        /* OperationErrorGenerator.kt:318 */
  341    385   
        match self {
         386  +
            /* OperationErrorGenerator.kt:326 */
  342    387   
            Self::Unhandled(_inner) => {
         388  +
                /* OperationErrorGenerator.kt:139 */
  343    389   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  344    390   
                    write!(f, "unhandled error ({code})")
  345    391   
                } else {
  346    392   
                    f.write_str("unhandled error")
  347    393   
                }
  348         -
            }
         394  +
                /* OperationErrorGenerator.kt:326 */
         395  +
            } /* OperationErrorGenerator.kt:318 */
  349    396   
        }
         397  +
        /* OperationErrorGenerator.kt:134 */
  350    398   
    }
         399  +
    /* OperationErrorGenerator.kt:133 */
  351    400   
}
         401  +
/* OperationErrorGenerator.kt:182 */
  352    402   
impl ::aws_smithy_types::retry::ProvideErrorKind for PrimitiveIntOpXmlError {
         403  +
    /* OperationErrorGenerator.kt:186 */
  353    404   
    fn code(&self) -> ::std::option::Option<&str> {
         405  +
        /* OperationErrorGenerator.kt:187 */
  354    406   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         407  +
        /* OperationErrorGenerator.kt:186 */
  355    408   
    }
         409  +
    /* OperationErrorGenerator.kt:190 */
  356    410   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         411  +
        /* OperationErrorGenerator.kt:197 */
  357    412   
        ::std::option::Option::None
         413  +
        /* OperationErrorGenerator.kt:190 */
  358    414   
    }
         415  +
    /* OperationErrorGenerator.kt:182 */
  359    416   
}
         417  +
/* OperationErrorGenerator.kt:163 */
  360    418   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PrimitiveIntOpXmlError {
         419  +
    /* OperationErrorGenerator.kt:164 */
  361    420   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         421  +
        /* OperationErrorGenerator.kt:318 */
  362    422   
        match self {
  363         -
            Self::Unhandled(_inner) => &_inner.meta,
         423  +
            /* OperationErrorGenerator.kt:326 */
         424  +
            Self::Unhandled(_inner) => {
         425  +
                /* OperationErrorGenerator.kt:168 */
         426  +
                &_inner.meta
         427  +
                /* OperationErrorGenerator.kt:326 */
         428  +
            } /* OperationErrorGenerator.kt:318 */
  364    429   
        }
         430  +
        /* OperationErrorGenerator.kt:164 */
  365    431   
    }
         432  +
    /* OperationErrorGenerator.kt:163 */
  366    433   
}
         434  +
/* OperationErrorGenerator.kt:109 */
  367    435   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PrimitiveIntOpXmlError {
         436  +
    /* OperationErrorGenerator.kt:110 */
  368    437   
    fn create_unhandled_error(
  369    438   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  370    439   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  371    440   
    ) -> Self {
         441  +
        /* OperationErrorGenerator.kt:121 */
  372    442   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  373    443   
            source,
  374    444   
            meta: meta.unwrap_or_default(),
  375    445   
        })
         446  +
        /* OperationErrorGenerator.kt:110 */
  376    447   
    }
         448  +
    /* OperationErrorGenerator.kt:109 */
  377    449   
}
  378    450   
         451  +
/* CodegenDelegator.kt:255 */
  379    452   
pub use crate::operation::primitive_int_op_xml::_primitive_int_op_xml_output::PrimitiveIntOpXmlOutput;
  380    453   
         454  +
/* CodegenDelegator.kt:255 */
  381    455   
pub use crate::operation::primitive_int_op_xml::_primitive_int_op_xml_input::PrimitiveIntOpXmlInput;
  382    456   
         457  +
/* RustModule.kt:172 */
  383    458   
mod _primitive_int_op_xml_input;
  384    459   
         460  +
/* RustModule.kt:172 */
  385    461   
mod _primitive_int_op_xml_output;
  386    462   
  387         -
/// Builders
         463  +
/// /* CodegenDelegator.kt:51 */Builders
  388    464   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/primitive_int_op_xml/_primitive_int_op_xml_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/primitive_int_op_xml/_primitive_int_op_xml_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/primitive_int_op_xml/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::primitive_int_op_xml::_primitive_int_op_xml_output::PrimitiveIntOpXmlOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::primitive_int_op_xml::_primitive_int_op_xml_input::PrimitiveIntOpXmlInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::primitive_int_op_xml::builders::PrimitiveIntOpXmlInputBuilder {
    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::primitive_int_op_xml::PrimitiveIntOpXmlOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.primitive_int_op_xml();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `PrimitiveIntOpXml`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `PrimitiveIntOpXml`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct PrimitiveIntOpXmlFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::primitive_int_op_xml::builders::PrimitiveIntOpXmlInputBuilder,
   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::primitive_int_op_xml::PrimitiveIntOpXmlOutput,
   34     40   
        crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
   35     41   
    > for PrimitiveIntOpXmlFluentBuilder
   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::primitive_int_op_xml::PrimitiveIntOpXmlOutput,
   43     49   
            crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
   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 PrimitiveIntOpXmlFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `PrimitiveIntOpXmlFluentBuilder`.
   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 PrimitiveIntOpXml as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::primitive_int_op_xml::builders::PrimitiveIntOpXmlInputBuilder {
   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::primitive_int_op_xml::PrimitiveIntOpXmlOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
   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::primitive_int_op_xml::PrimitiveIntOpXml::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::primitive_int_op_xml::PrimitiveIntOpXml::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::primitive_int_op_xml::PrimitiveIntOpXmlOutput,
   96    106   
        crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlError,
   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 value(mut self, input: i32) -> Self {
  112    125   
        self.inner = self.inner.value(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_value(mut self, input: ::std::option::Option<i32>) -> Self {
  117    132   
        self.inner = self.inner.set_value(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_value(&self) -> &::std::option::Option<i32> {
  122    139   
        self.inner.get_value()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:498 */
  124    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:500 */
  125    144   
    pub fn defaulted_value(mut self, input: i32) -> Self {
  126    145   
        self.inner = self.inner.defaulted_value(input);
  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_defaulted_value(mut self, input: ::std::option::Option<i32>) -> Self {
  131    152   
        self.inner = self.inner.set_defaulted_value(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_defaulted_value(&self) -> &::std::option::Option<i32> {
  136    159   
        self.inner.get_defaulted_value()
  137    160   
    }
         161  +
    /* FluentBuilderGenerator.kt:282 */
  138    162   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member.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 `RequiredMember`.
           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 RequiredMember;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl RequiredMember {
    7         -
    /// Creates a new `RequiredMember`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `RequiredMember`
          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::required_member::RequiredMemberInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::required_member::RequiredMemberOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::required_member::RequiredMemberError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +329,400 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RequiredMember {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RequiredMember");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            RequiredMemberRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            RequiredMemberResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "RequiredMember",
  105    116   
            "Rest XML Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RequiredMember")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(RequiredMemberEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::required_member::RequiredMemberError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::required_member::RequiredMemberError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct RequiredMemberResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RequiredMemberResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_required_member::de_required_member_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_required_member::de_required_member_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct RequiredMemberRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RequiredMemberRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input
  161    174   
            .downcast::<crate::operation::required_member::RequiredMemberInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::required_member::RequiredMemberInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/required-member").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::required_member::RequiredMemberInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_required_member::ser_required_member_op_input(&input)?);
  190    203   
        if let Some(content_length) = body.content_length() {
  191    204   
            let content_length = content_length.to_string();
  192    205   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  193    206   
        }
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct RequiredMemberEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredMemberEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "RequiredMemberEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<RequiredMemberInput>()
  218    232   
            .ok_or("failed to downcast to RequiredMemberInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* OperationErrorGenerator.kt:79 */
  232    247   
/// Error type for the `RequiredMemberError` operation.
         248  +
/* RustType.kt:516 */
  233    249   
#[non_exhaustive]
         250  +
/* RustType.kt:516 */
  234    251   
#[derive(::std::fmt::Debug)]
  235         -
pub enum RequiredMemberError {
         252  +
pub /* OperationErrorGenerator.kt:81 */ enum RequiredMemberError {
         253  +
    /* OperationErrorGenerator.kt:88 */
  236    254   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  237    255   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  238    256   
    variable wildcard pattern and check `.code()`:
  239    257   
     \
  240    258   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  241    259   
     \
  242    260   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RequiredMemberError) for what information is available for the error.")]
  243    261   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         262  +
    /* OperationErrorGenerator.kt:81 */
  244    263   
}
         264  +
/* OperationErrorGenerator.kt:218 */
  245    265   
impl RequiredMemberError {
         266  +
    /* OperationErrorGenerator.kt:219 */
  246    267   
    /// Creates the `RequiredMemberError::Unhandled` variant from any error type.
  247    268   
    pub fn unhandled(
  248    269   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  249    270   
    ) -> Self {
  250    271   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  251    272   
            source: err.into(),
  252    273   
            meta: ::std::default::Default::default(),
  253    274   
        })
  254    275   
    }
  255    276   
  256    277   
    /// Creates the `RequiredMemberError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  257    278   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  258    279   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  259    280   
            source: err.clone().into(),
  260    281   
            meta: err,
  261    282   
        })
  262    283   
    }
  263         -
    ///
         284  +
    /// /* OperationErrorGenerator.kt:236 */
  264    285   
    /// Returns error metadata, which includes the error code, message,
  265    286   
    /// request ID, and potentially additional information.
  266    287   
    ///
         288  +
    /* OperationErrorGenerator.kt:242 */
  267    289   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         290  +
        /* OperationErrorGenerator.kt:243 */
  268    291   
        match self {
  269         -
            Self::Unhandled(e) => &e.meta,
         292  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         293  +
            /* OperationErrorGenerator.kt:243 */
  270    294   
        }
         295  +
        /* OperationErrorGenerator.kt:242 */
  271    296   
    }
         297  +
    /* OperationErrorGenerator.kt:218 */
  272    298   
}
         299  +
/* OperationErrorGenerator.kt:269 */
  273    300   
impl ::std::error::Error for RequiredMemberError {
         301  +
    /* OperationErrorGenerator.kt:270 */
  274    302   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         303  +
        /* OperationErrorGenerator.kt:318 */
  275    304   
        match self {
  276         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         305  +
            /* OperationErrorGenerator.kt:326 */
         306  +
            Self::Unhandled(_inner) => {
         307  +
                /* OperationErrorGenerator.kt:279 */
         308  +
                ::std::option::Option::Some(&*_inner.source)
         309  +
                /* OperationErrorGenerator.kt:326 */
         310  +
            } /* OperationErrorGenerator.kt:318 */
  277    311   
        }
         312  +
        /* OperationErrorGenerator.kt:270 */
  278    313   
    }
         314  +
    /* OperationErrorGenerator.kt:269 */
  279    315   
}
         316  +
/* OperationErrorGenerator.kt:133 */
  280    317   
impl ::std::fmt::Display for RequiredMemberError {
         318  +
    /* OperationErrorGenerator.kt:134 */
  281    319   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         320  +
        /* OperationErrorGenerator.kt:318 */
  282    321   
        match self {
         322  +
            /* OperationErrorGenerator.kt:326 */
  283    323   
            Self::Unhandled(_inner) => {
         324  +
                /* OperationErrorGenerator.kt:139 */
  284    325   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  285    326   
                    write!(f, "unhandled error ({code})")
  286    327   
                } else {
  287    328   
                    f.write_str("unhandled error")
  288    329   
                }
  289         -
            }
         330  +
                /* OperationErrorGenerator.kt:326 */
         331  +
            } /* OperationErrorGenerator.kt:318 */
  290    332   
        }
         333  +
        /* OperationErrorGenerator.kt:134 */
  291    334   
    }
         335  +
    /* OperationErrorGenerator.kt:133 */
  292    336   
}
         337  +
/* OperationErrorGenerator.kt:182 */
  293    338   
impl ::aws_smithy_types::retry::ProvideErrorKind for RequiredMemberError {
         339  +
    /* OperationErrorGenerator.kt:186 */
  294    340   
    fn code(&self) -> ::std::option::Option<&str> {
         341  +
        /* OperationErrorGenerator.kt:187 */
  295    342   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         343  +
        /* OperationErrorGenerator.kt:186 */
  296    344   
    }
         345  +
    /* OperationErrorGenerator.kt:190 */
  297    346   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         347  +
        /* OperationErrorGenerator.kt:197 */
  298    348   
        ::std::option::Option::None
         349  +
        /* OperationErrorGenerator.kt:190 */
  299    350   
    }
         351  +
    /* OperationErrorGenerator.kt:182 */
  300    352   
}
         353  +
/* OperationErrorGenerator.kt:163 */
  301    354   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RequiredMemberError {
         355  +
    /* OperationErrorGenerator.kt:164 */
  302    356   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         357  +
        /* OperationErrorGenerator.kt:318 */
  303    358   
        match self {
  304         -
            Self::Unhandled(_inner) => &_inner.meta,
         359  +
            /* OperationErrorGenerator.kt:326 */
         360  +
            Self::Unhandled(_inner) => {
         361  +
                /* OperationErrorGenerator.kt:168 */
         362  +
                &_inner.meta
         363  +
                /* OperationErrorGenerator.kt:326 */
         364  +
            } /* OperationErrorGenerator.kt:318 */
  305    365   
        }
         366  +
        /* OperationErrorGenerator.kt:164 */
  306    367   
    }
         368  +
    /* OperationErrorGenerator.kt:163 */
  307    369   
}
         370  +
/* OperationErrorGenerator.kt:109 */
  308    371   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RequiredMemberError {
         372  +
    /* OperationErrorGenerator.kt:110 */
  309    373   
    fn create_unhandled_error(
  310    374   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  311    375   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  312    376   
    ) -> Self {
         377  +
        /* OperationErrorGenerator.kt:121 */
  313    378   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  314    379   
            source,
  315    380   
            meta: meta.unwrap_or_default(),
  316    381   
        })
         382  +
        /* OperationErrorGenerator.kt:110 */
  317    383   
    }
         384  +
    /* OperationErrorGenerator.kt:109 */
  318    385   
}
  319    386   
         387  +
/* CodegenDelegator.kt:255 */
  320    388   
pub use crate::operation::required_member::_required_member_output::RequiredMemberOutput;
  321    389   
         390  +
/* CodegenDelegator.kt:255 */
  322    391   
pub use crate::operation::required_member::_required_member_input::RequiredMemberInput;
  323    392   
         393  +
/* RustModule.kt:172 */
  324    394   
mod _required_member_input;
  325    395   
         396  +
/* RustModule.kt:172 */
  326    397   
mod _required_member_output;
  327    398   
  328         -
/// Builders
         399  +
/// /* CodegenDelegator.kt:51 */Builders
  329    400   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member/_required_member_input.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 RequiredMemberInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredMemberInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub required_string: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl RequiredMemberInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn required_string(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.required_string.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl RequiredMemberInput {
   16         -
    /// Creates a new builder-style object to manufacture [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::required_member::builders::RequiredMemberInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::required_member::builders::RequiredMemberInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
          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 RequiredMemberInputBuilder {
   26         -
    pub(crate) required_string: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) required_string: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl RequiredMemberInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
   30         -
    /// This field is required.
          52  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          53  +
    /* BuilderGenerator.kt:291 */
   31     54   
    pub fn required_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   32     56   
        self.required_string = ::std::option::Option::Some(input.into());
          57  +
        /* BuilderGenerator.kt:293 */
   33     58   
        self
          59  +
        /* BuilderGenerator.kt:291 */
   34     60   
    }
          61  +
    /* BuilderGenerator.kt:312 */
   35     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:314 */
   36     64   
    pub fn set_required_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   37     66   
        self.required_string = input;
   38     67   
        self
          68  +
        /* BuilderGenerator.kt:314 */
   39     69   
    }
          70  +
    /* BuilderGenerator.kt:334 */
   40     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* BuilderGenerator.kt:336 */
   41     73   
    pub fn get_required_string(&self) -> &::std::option::Option<::std::string::String> {
          74  +
        /* BuilderGenerator.kt:337 */
   42     75   
        &self.required_string
          76  +
        /* BuilderGenerator.kt:336 */
   43     77   
    }
   44         -
    /// Consumes the builder and constructs a [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredMemberInput`](crate::operation::required_member::RequiredMemberInput).
          79  +
    /* BuilderGenerator.kt:253 */
   45     80   
    pub fn build(
   46     81   
        self,
   47     82   
    ) -> ::std::result::Result<crate::operation::required_member::RequiredMemberInput, ::aws_smithy_types::error::operation::BuildError> {
   48         -
        ::std::result::Result::Ok(crate::operation::required_member::RequiredMemberInput {
   49         -
            required_string: self.required_string,
   50         -
        })
          83  +
        /* BuilderGenerator.kt:254 */
          84  +
        ::std::result::Result::Ok(
          85  +
            /* BuilderGenerator.kt:477 */
          86  +
            crate::operation::required_member::RequiredMemberInput {
          87  +
                /* BuilderGenerator.kt:481 */ required_string: self.required_string,
          88  +
                /* BuilderGenerator.kt:477 */
          89  +
            }, /* BuilderGenerator.kt:254 */
          90  +
        )
          91  +
        /* BuilderGenerator.kt:253 */
   51     92   
    }
          93  +
    /* BuilderGenerator.kt:355 */
   52     94   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member/_required_member_output.rs

@@ -1,1 +60,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 RequiredMemberOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredMemberOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub required_string: ::std::string::String,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl RequiredMemberOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn required_string(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
   12     21   
        use std::ops::Deref;
   13     22   
        self.required_string.deref()
          23  +
        /* StructureGenerator.kt:166 */
   14     24   
    }
          25  +
    /* StructureGenerator.kt:135 */
   15     26   
}
          27  +
/* ClientCodegenVisitor.kt:237 */
   16     28   
impl RequiredMemberOutput {
   17         -
    /// Creates a new builder-style object to manufacture [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
          29  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
          30  +
    /* BuilderGenerator.kt:175 */
   18     31   
    pub fn builder() -> crate::operation::required_member::builders::RequiredMemberOutputBuilder {
          32  +
        /* BuilderGenerator.kt:176 */
   19     33   
        crate::operation::required_member::builders::RequiredMemberOutputBuilder::default()
          34  +
        /* BuilderGenerator.kt:175 */
   20     35   
    }
          36  +
    /* ClientCodegenVisitor.kt:237 */
   21     37   
}
   22     38   
   23         -
/// A builder for [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
          39  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
          40  +
/* RustType.kt:516 */
   24     41   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          42  +
/* RustType.kt:516 */
   25     43   
#[non_exhaustive]
          44  +
/* BuilderGenerator.kt:345 */
   26     45   
pub struct RequiredMemberOutputBuilder {
   27         -
    pub(crate) required_string: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:275 */ pub(crate) required_string: ::std::option::Option<::std::string::String>,
          47  +
    /* BuilderGenerator.kt:345 */
   28     48   
}
          49  +
/* BuilderGenerator.kt:355 */
   29     50   
impl RequiredMemberOutputBuilder {
          51  +
    /* BuilderGenerator.kt:286 */
   30     52   
    #[allow(missing_docs)] // documentation missing in model
   31         -
    /// This field is required.
          53  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          54  +
    /* BuilderGenerator.kt:291 */
   32     55   
    pub fn required_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          56  +
        /* BuilderGenerator.kt:292 */
   33     57   
        self.required_string = ::std::option::Option::Some(input.into());
          58  +
        /* BuilderGenerator.kt:293 */
   34     59   
        self
          60  +
        /* BuilderGenerator.kt:291 */
   35     61   
    }
          62  +
    /* BuilderGenerator.kt:312 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:314 */
   37     65   
    pub fn set_required_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:315 */
   38     67   
        self.required_string = input;
   39     68   
        self
          69  +
        /* BuilderGenerator.kt:314 */
   40     70   
    }
          71  +
    /* BuilderGenerator.kt:334 */
   41     72   
    #[allow(missing_docs)] // documentation missing in model
          73  +
                           /* BuilderGenerator.kt:336 */
   42     74   
    pub fn get_required_string(&self) -> &::std::option::Option<::std::string::String> {
          75  +
        /* BuilderGenerator.kt:337 */
   43     76   
        &self.required_string
          77  +
        /* BuilderGenerator.kt:336 */
   44     78   
    }
   45         -
    /// Consumes the builder and constructs a [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
   46         -
    /// This method will fail if any of the following fields are not set:
   47         -
    /// - [`required_string`](crate::operation::required_member::builders::RequiredMemberOutputBuilder::required_string)
          79  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredMemberOutput`](crate::operation::required_member::RequiredMemberOutput).
          80  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
          81  +
    /// /* BuilderGenerator.kt:246 */- [`required_string`](crate::operation::required_member::builders::RequiredMemberOutputBuilder::required_string)
          82  +
    /* BuilderGenerator.kt:253 */
   48     83   
    pub fn build(
   49     84   
        self,
   50     85   
    ) -> ::std::result::Result<crate::operation::required_member::RequiredMemberOutput, ::aws_smithy_types::error::operation::BuildError> {
   51         -
        ::std::result::Result::Ok(crate::operation::required_member::RequiredMemberOutput {
   52         -
            required_string: self.required_string.ok_or_else(|| {
   53         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   54         -
                    "required_string",
   55         -
                    "required_string was not specified but it is required when building RequiredMemberOutput",
   56         -
                )
   57         -
            })?,
   58         -
        })
          86  +
        /* BuilderGenerator.kt:254 */
          87  +
        ::std::result::Result::Ok(
          88  +
            /* BuilderGenerator.kt:477 */crate::operation::required_member::RequiredMemberOutput {
          89  +
                /* BuilderGenerator.kt:481 */required_string: self.required_string
          90  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
          91  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("required_string", "required_string was not specified but it is required when building RequiredMemberOutput")
          92  +
                    /* BuilderGenerator.kt:494 */)?
          93  +
                ,
          94  +
            /* BuilderGenerator.kt:477 */}
          95  +
        /* BuilderGenerator.kt:254 */)
          96  +
        /* BuilderGenerator.kt:253 */
   59     97   
    }
          98  +
    /* BuilderGenerator.kt:355 */
   60     99   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member/builders.rs

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::required_member::_required_member_output::RequiredMemberOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::required_member::_required_member_input::RequiredMemberInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::required_member::builders::RequiredMemberInputBuilder {
    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::required_member::RequiredMemberOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::required_member::RequiredMemberError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.required_member();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `RequiredMember`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `RequiredMember`.
   24     27   
///
   25         -
/// This operation tests that we can serialize `required` members.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that we can serialize `required` members.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct RequiredMemberFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::required_member::builders::RequiredMemberInputBuilder,
   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::required_member::RequiredMemberOutput,
   35     41   
        crate::operation::required_member::RequiredMemberError,
   36     42   
    > for RequiredMemberFluentBuilder
   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::required_member::RequiredMemberOutput,
   44     50   
            crate::operation::required_member::RequiredMemberError,
   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 RequiredMemberFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `RequiredMemberFluentBuilder`.
   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 RequiredMember as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::required_member::builders::RequiredMemberInputBuilder {
   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::required_member::RequiredMemberOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::required_member::RequiredMemberError,
   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::required_member::RequiredMember::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::required_member::RequiredMember::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::required_member::RequiredMemberOutput,
   97    107   
        crate::operation::required_member::RequiredMemberError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:498 */
  111    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* FluentBuilderGenerator.kt:500 */
  112    125   
    pub fn required_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.required_string(input.into());
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_required_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_required_string(input);
  119    134   
        self
  120    135   
    }
         136  +
    /* FluentBuilderGenerator.kt:518 */
  121    137   
    #[allow(missing_docs)] // documentation missing in model
         138  +
                           /* FluentBuilderGenerator.kt:520 */
  122    139   
    pub fn get_required_string(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_required_string()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}