Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation.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 `EndpointWithHostLabelOperation`.
           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 EndpointWithHostLabelOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EndpointWithHostLabelOperation {
    7         -
    /// Creates a new `EndpointWithHostLabelOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EndpointWithHostLabelOperation`
          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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +389,465 @@
   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 EndpointWithHostLabelOperation {
   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("EndpointWithHostLabelOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EndpointWithHostLabelOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EndpointWithHostLabelOperationResponseDeserializer,
  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   
            "EndpointWithHostLabelOperation",
  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("EndpointWithHostLabelOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EndpointWithHostLabelOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
  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 EndpointWithHostLabelOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointWithHostLabelOperationResponseDeserializer {
  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_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_response(
  153    165   
                status, headers, body,
  154    166   
            )
  155    167   
        };
  156    168   
        crate::protocol_serde::type_erase_result(parse_result)
  157    169   
    }
  158    170   
}
         171  +
/* RequestSerializerGenerator.kt:67 */
  159    172   
#[derive(Debug)]
  160    173   
struct EndpointWithHostLabelOperationRequestSerializer;
  161    174   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EndpointWithHostLabelOperationRequestSerializer {
  162    175   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  163    176   
    fn serialize_input(
  164    177   
        &self,
  165    178   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  166    179   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  167    180   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  168    181   
        let input = input
  169    182   
            .downcast::<crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput>()
  170    183   
            .expect("correct type");
  171    184   
        let _header_serialization_settings = _cfg
  172    185   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  173    186   
            .cloned()
  174    187   
            .unwrap_or_default();
  175    188   
        let mut request_builder = {
  176    189   
            fn uri_base(
  177    190   
                _input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
  178    191   
                output: &mut ::std::string::String,
  179    192   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180    193   
                use ::std::fmt::Write as _;
  181    194   
                ::std::write!(output, "/EndpointWithHostLabelOperation").expect("formatting should succeed");
  182    195   
                ::std::result::Result::Ok(())
  183    196   
            }
  184    197   
            #[allow(clippy::unnecessary_wraps)]
  185    198   
            fn update_http_builder(
  186    199   
                input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
  187    200   
                builder: ::http::request::Builder,
  188    201   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189    202   
                let mut uri = ::std::string::String::new();
  190    203   
                uri_base(input, &mut uri)?;
  191    204   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192    205   
            }
  193    206   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  194    207   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
  195    208   
            builder
  196    209   
        };
  197    210   
        let body = ::aws_smithy_types::body::SdkBody::from(
  198    211   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_op_input(&input)?,
  199    212   
        );
  200    213   
        if let Some(content_length) = body.content_length() {
  201    214   
            let content_length = content_length.to_string();
  202    215   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  203    216   
        }
  204    217   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  205    218   
    }
  206    219   
}
         220  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  207    221   
#[derive(Debug)]
  208    222   
struct EndpointWithHostLabelOperationEndpointParamsInterceptor;
  209    223   
  210    224   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EndpointWithHostLabelOperationEndpointParamsInterceptor {
  211    225   
    fn name(&self) -> &'static str {
  212    226   
        "EndpointWithHostLabelOperationEndpointParamsInterceptor"
  213    227   
    }
  214    228   
  215    229   
    fn read_before_execution(
  216    230   
        &self,
  217    231   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  218    232   
            '_,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  220    234   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  222    236   
        >,
  223    237   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  224    238   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  225    239   
        let _input = context
  226    240   
            .input()
  227    241   
            .downcast_ref::<EndpointWithHostLabelOperationInput>()
  228    242   
            .ok_or("failed to downcast to EndpointWithHostLabelOperationInput")?;
  229    243   
  230    244   
        let endpoint_prefix = {
  231    245   
            let label = _input.label.as_deref().unwrap_or_default();
  232    246   
            if label.is_empty() {
  233    247   
                return Err(
  234    248   
                    ::aws_smithy_runtime_api::client::endpoint::error::InvalidEndpointError::failed_to_construct_uri(
  235    249   
                        "label was unset or empty but must be set as part of the endpoint prefix",
  236    250   
                    )
  237    251   
                    .into(),
  238    252   
                );
  239    253   
            }
  240    254   
            ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new(format!("foo.{label}.", label = label))
  241    255   
        }
  242    256   
        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err))?;
  243    257   
        cfg.interceptor_state().store_put(endpoint_prefix);
  244    258   
  245    259   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  246    260   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  247    261   
        })?;
  248    262   
        cfg.interceptor_state()
  249    263   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  250    264   
        ::std::result::Result::Ok(())
  251    265   
    }
  252    266   
}
  253    267   
  254    268   
// The get_* functions below are generated from JMESPath expressions in the
  255    269   
// operationContextParams trait. They target the operation's input shape.
  256    270   
         271  +
/* RustType.kt:516 */
  257    272   
#[allow(unreachable_code, unused_variables)]
         273  +
/* RustType.kt:516 */
  258    274   
#[cfg(test)]
         275  +
/* ProtocolTestGenerator.kt:98 */
  259    276   
mod endpoint_with_host_label_operation_test {
  260    277   
  261    278   
    /// Operations can prepend to the given host if they define the
  262    279   
    /// endpoint trait, and can use the host label trait to define
  263    280   
    /// further customization based on user input.
  264    281   
    /// Test ID: RestXmlEndpointTraitWithHostLabel
  265    282   
    #[::tokio::test]
  266    283   
    #[::tracing_test::traced_test]
  267    284   
    async fn rest_xml_endpoint_trait_with_host_label_request() {
  268    285   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  269    286   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  270    287   
  271    288   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  272    289   
        let result = client
  273    290   
            .endpoint_with_host_label_operation()
  274    291   
            .set_label(::std::option::Option::Some("bar".to_owned()))
  275    292   
            .send()
  276    293   
            .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   
            "<EndpointWithHostLabelOperationRequest>\n    <label>bar</label>\n</EndpointWithHostLabelOperationRequest>\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(), "/EndpointWithHostLabelOperation", "path was incorrect");
  288    305   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.bar.example.com");
  289    306   
    }
         307  +
         308  +
    /* ProtocolTestGenerator.kt:98 */
  290    309   
}
  291    310   
         311  +
/* OperationErrorGenerator.kt:79 */
  292    312   
/// Error type for the `EndpointWithHostLabelOperationError` operation.
         313  +
/* RustType.kt:516 */
  293    314   
#[non_exhaustive]
         315  +
/* RustType.kt:516 */
  294    316   
#[derive(::std::fmt::Debug)]
  295         -
pub enum EndpointWithHostLabelOperationError {
         317  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointWithHostLabelOperationError {
         318  +
    /* OperationErrorGenerator.kt:88 */
  296    319   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  297    320   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  298    321   
    variable wildcard pattern and check `.code()`:
  299    322   
     \
  300    323   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  301    324   
     \
  302    325   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointWithHostLabelOperationError) for what information is available for the error.")]
  303    326   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         327  +
    /* OperationErrorGenerator.kt:81 */
  304    328   
}
         329  +
/* OperationErrorGenerator.kt:218 */
  305    330   
impl EndpointWithHostLabelOperationError {
         331  +
    /* OperationErrorGenerator.kt:219 */
  306    332   
    /// Creates the `EndpointWithHostLabelOperationError::Unhandled` variant from any error type.
  307    333   
    pub fn unhandled(
  308    334   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  309    335   
    ) -> Self {
  310    336   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  311    337   
            source: err.into(),
  312    338   
            meta: ::std::default::Default::default(),
  313    339   
        })
  314    340   
    }
  315    341   
  316    342   
    /// Creates the `EndpointWithHostLabelOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  317    343   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  318    344   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  319    345   
            source: err.clone().into(),
  320    346   
            meta: err,
  321    347   
        })
  322    348   
    }
  323         -
    ///
         349  +
    /// /* OperationErrorGenerator.kt:236 */
  324    350   
    /// Returns error metadata, which includes the error code, message,
  325    351   
    /// request ID, and potentially additional information.
  326    352   
    ///
         353  +
    /* OperationErrorGenerator.kt:242 */
  327    354   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         355  +
        /* OperationErrorGenerator.kt:243 */
  328    356   
        match self {
  329         -
            Self::Unhandled(e) => &e.meta,
         357  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         358  +
            /* OperationErrorGenerator.kt:243 */
  330    359   
        }
         360  +
        /* OperationErrorGenerator.kt:242 */
  331    361   
    }
         362  +
    /* OperationErrorGenerator.kt:218 */
  332    363   
}
         364  +
/* OperationErrorGenerator.kt:269 */
  333    365   
impl ::std::error::Error for EndpointWithHostLabelOperationError {
         366  +
    /* OperationErrorGenerator.kt:270 */
  334    367   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         368  +
        /* OperationErrorGenerator.kt:318 */
  335    369   
        match self {
  336         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         370  +
            /* OperationErrorGenerator.kt:326 */
         371  +
            Self::Unhandled(_inner) => {
         372  +
                /* OperationErrorGenerator.kt:279 */
         373  +
                ::std::option::Option::Some(&*_inner.source)
         374  +
                /* OperationErrorGenerator.kt:326 */
         375  +
            } /* OperationErrorGenerator.kt:318 */
  337    376   
        }
         377  +
        /* OperationErrorGenerator.kt:270 */
  338    378   
    }
         379  +
    /* OperationErrorGenerator.kt:269 */
  339    380   
}
         381  +
/* OperationErrorGenerator.kt:133 */
  340    382   
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
         383  +
    /* OperationErrorGenerator.kt:134 */
  341    384   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         385  +
        /* OperationErrorGenerator.kt:318 */
  342    386   
        match self {
         387  +
            /* OperationErrorGenerator.kt:326 */
  343    388   
            Self::Unhandled(_inner) => {
         389  +
                /* OperationErrorGenerator.kt:139 */
  344    390   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  345    391   
                    write!(f, "unhandled error ({code})")
  346    392   
                } else {
  347    393   
                    f.write_str("unhandled error")
  348    394   
                }
         395  +
                /* OperationErrorGenerator.kt:326 */
         396  +
            } /* OperationErrorGenerator.kt:318 */
  349    397   
        }
         398  +
        /* OperationErrorGenerator.kt:134 */
  350    399   
    }
  351         -
    }
         400  +
    /* OperationErrorGenerator.kt:133 */
  352    401   
}
         402  +
/* OperationErrorGenerator.kt:182 */
  353    403   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointWithHostLabelOperationError {
         404  +
    /* OperationErrorGenerator.kt:186 */
  354    405   
    fn code(&self) -> ::std::option::Option<&str> {
         406  +
        /* OperationErrorGenerator.kt:187 */
  355    407   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         408  +
        /* OperationErrorGenerator.kt:186 */
  356    409   
    }
         410  +
    /* OperationErrorGenerator.kt:190 */
  357    411   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         412  +
        /* OperationErrorGenerator.kt:197 */
  358    413   
        ::std::option::Option::None
         414  +
        /* OperationErrorGenerator.kt:190 */
  359    415   
    }
         416  +
    /* OperationErrorGenerator.kt:182 */
  360    417   
}
         418  +
/* OperationErrorGenerator.kt:163 */
  361    419   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointWithHostLabelOperationError {
         420  +
    /* OperationErrorGenerator.kt:164 */
  362    421   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         422  +
        /* OperationErrorGenerator.kt:318 */
  363    423   
        match self {
  364         -
            Self::Unhandled(_inner) => &_inner.meta,
         424  +
            /* OperationErrorGenerator.kt:326 */
         425  +
            Self::Unhandled(_inner) => {
         426  +
                /* OperationErrorGenerator.kt:168 */
         427  +
                &_inner.meta
         428  +
                /* OperationErrorGenerator.kt:326 */
         429  +
            } /* OperationErrorGenerator.kt:318 */
  365    430   
        }
         431  +
        /* OperationErrorGenerator.kt:164 */
  366    432   
    }
         433  +
    /* OperationErrorGenerator.kt:163 */
  367    434   
}
         435  +
/* OperationErrorGenerator.kt:109 */
  368    436   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointWithHostLabelOperationError {
         437  +
    /* OperationErrorGenerator.kt:110 */
  369    438   
    fn create_unhandled_error(
  370    439   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  371    440   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  372    441   
    ) -> Self {
         442  +
        /* OperationErrorGenerator.kt:121 */
  373    443   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  374    444   
            source,
  375    445   
            meta: meta.unwrap_or_default(),
  376    446   
        })
         447  +
        /* OperationErrorGenerator.kt:110 */
  377    448   
    }
         449  +
    /* OperationErrorGenerator.kt:109 */
  378    450   
}
  379    451   
         452  +
/* CodegenDelegator.kt:255 */
  380    453   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_output::EndpointWithHostLabelOperationOutput;
  381    454   
         455  +
/* CodegenDelegator.kt:255 */
  382    456   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_input::EndpointWithHostLabelOperationInput;
  383    457   
         458  +
/* RustModule.kt:172 */
  384    459   
mod _endpoint_with_host_label_operation_input;
  385    460   
         461  +
/* RustModule.kt:172 */
  386    462   
mod _endpoint_with_host_label_operation_output;
  387    463   
  388         -
/// Builders
         464  +
/// /* CodegenDelegator.kt:51 */Builders
  389    465   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation/_endpoint_with_host_label_operation_input.rs

@@ -1,1 +53,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 EndpointWithHostLabelOperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct EndpointWithHostLabelOperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub label: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl EndpointWithHostLabelOperationInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn label(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.label.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl EndpointWithHostLabelOperationInput {
   16         -
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
          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 EndpointWithHostLabelOperationInputBuilder {
   26         -
    pub(crate) label: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) label: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl EndpointWithHostLabelOperationInputBuilder {
          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 label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   32     56   
        self.label = ::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_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   37     66   
        self.label = 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_label(&self) -> &::std::option::Option<::std::string::String> {
          74  +
        /* BuilderGenerator.kt:337 */
   42     75   
        &self.label
          76  +
        /* BuilderGenerator.kt:336 */
   43     77   
    }
   44         -
    /// Consumes the builder and constructs a [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EndpointWithHostLabelOperationInput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput).
          79  +
    /* BuilderGenerator.kt:253 */
   45     80   
    pub fn build(
   46     81   
        self,
   47     82   
    ) -> ::std::result::Result<
   48     83   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   49     84   
        ::aws_smithy_types::error::operation::BuildError,
   50     85   
    > {
   51         -
        ::std::result::Result::Ok(crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput { label: self.label })
          86  +
        /* BuilderGenerator.kt:254 */
          87  +
        ::std::result::Result::Ok(
          88  +
            /* BuilderGenerator.kt:477 */
          89  +
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput {
          90  +
                /* BuilderGenerator.kt:481 */ label: self.label,
          91  +
                /* BuilderGenerator.kt:477 */
          92  +
            }, /* BuilderGenerator.kt:254 */
          93  +
        )
          94  +
        /* BuilderGenerator.kt:253 */
   52     95   
    }
          96  +
    /* BuilderGenerator.kt:355 */
   53     97   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation/_endpoint_with_host_label_operation_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 EndpointWithHostLabelOperationOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct EndpointWithHostLabelOperationOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl EndpointWithHostLabelOperationOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
          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 EndpointWithHostLabelOperationOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct EndpointWithHostLabelOperationOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl EndpointWithHostLabelOperationOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EndpointWithHostLabelOperationOutput`](crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput {
   20         -
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation/builders.rs

@@ -1,1 +124,142 @@
    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::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_output::EndpointWithHostLabelOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_input::EndpointWithHostLabelOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
    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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.endpoint_with_host_label_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EndpointWithHostLabelOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EndpointWithHostLabelOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EndpointWithHostLabelOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder,
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   34     40   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   35     41   
    > for EndpointWithHostLabelOperationFluentBuilder
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   43     49   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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 EndpointWithHostLabelOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EndpointWithHostLabelOperationFluentBuilder`.
   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 EndpointWithHostLabelOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperation::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::endpoint_with_host_label_operation::EndpointWithHostLabelOperation::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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   96    106   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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 label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.label(input.into());
  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_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_label(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_label(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_label()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:282 */
  124    142   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map.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 `FlattenedXmlMap`.
           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 FlattenedXmlMap;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl FlattenedXmlMap {
    7         -
    /// Creates a new `FlattenedXmlMap`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `FlattenedXmlMap`
          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::flattened_xml_map::FlattenedXmlMapInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::flattened_xml_map::FlattenedXmlMapOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::flattened_xml_map::FlattenedXmlMapError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +263,280 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for FlattenedXmlMap {
   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("FlattenedXmlMap");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            FlattenedXmlMapRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            FlattenedXmlMapResponseDeserializer,
   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   
            "FlattenedXmlMap",
  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("FlattenedXmlMap")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(FlattenedXmlMapEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::flattened_xml_map::FlattenedXmlMapError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::flattened_xml_map::FlattenedXmlMapError,
  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 FlattenedXmlMapResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapResponseDeserializer {
  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_flattened_xml_map::de_flattened_xml_map_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_flattened_xml_map::de_flattened_xml_map_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 FlattenedXmlMapRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FlattenedXmlMapRequestSerializer {
  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::flattened_xml_map::FlattenedXmlMapInput>()
  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::flattened_xml_map::FlattenedXmlMapInput,
  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, "/FlattenedXmlMap").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::flattened_xml_map::FlattenedXmlMapInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_flattened_xml_map::ser_flattened_xml_map_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 FlattenedXmlMapEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FlattenedXmlMapEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "FlattenedXmlMapEndpointParamsInterceptor"
  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::<FlattenedXmlMapInput>()
  218    232   
            .ok_or("failed to downcast to FlattenedXmlMapInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* RustType.kt:516 */
  232    247   
#[allow(unreachable_code, unused_variables)]
         248  +
/* RustType.kt:516 */
  233    249   
#[cfg(test)]
         250  +
/* ProtocolTestGenerator.kt:98 */
  234    251   
mod flattened_xml_map_test {
  235    252   
  236    253   
    /// Serializes flattened XML maps in requests
  237    254   
    /// Test ID: FlattenedXmlMap
  238    255   
    #[::tokio::test]
  239    256   
    #[::tracing_test::traced_test]
  240    257   
    async fn flattened_xml_map_request() {
  241    258   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    259   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  243    260   
@@ -294,311 +423,499 @@
  314    331   
                )))
  315    332   
            });
  316    333   
            de.deserialize_nonstreaming(&http_response)
  317    334   
        });
  318    335   
        let parsed = parsed
  319    336   
            .expect("should be successful response")
  320    337   
            .downcast::<crate::operation::flattened_xml_map::FlattenedXmlMapOutput>()
  321    338   
            .unwrap();
  322    339   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  323    340   
    }
         341  +
         342  +
    /* ProtocolTestGenerator.kt:98 */
  324    343   
}
  325    344   
         345  +
/* OperationErrorGenerator.kt:79 */
  326    346   
/// Error type for the `FlattenedXmlMapError` operation.
         347  +
/* RustType.kt:516 */
  327    348   
#[non_exhaustive]
         349  +
/* RustType.kt:516 */
  328    350   
#[derive(::std::fmt::Debug)]
  329         -
pub enum FlattenedXmlMapError {
         351  +
pub /* OperationErrorGenerator.kt:81 */ enum FlattenedXmlMapError {
         352  +
    /* OperationErrorGenerator.kt:88 */
  330    353   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  331    354   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  332    355   
    variable wildcard pattern and check `.code()`:
  333    356   
     \
  334    357   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  335    358   
     \
  336    359   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FlattenedXmlMapError) for what information is available for the error.")]
  337    360   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         361  +
    /* OperationErrorGenerator.kt:81 */
  338    362   
}
         363  +
/* OperationErrorGenerator.kt:218 */
  339    364   
impl FlattenedXmlMapError {
         365  +
    /* OperationErrorGenerator.kt:219 */
  340    366   
    /// Creates the `FlattenedXmlMapError::Unhandled` variant from any error type.
  341    367   
    pub fn unhandled(
  342    368   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  343    369   
    ) -> Self {
  344    370   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  345    371   
            source: err.into(),
  346    372   
            meta: ::std::default::Default::default(),
  347    373   
        })
  348    374   
    }
  349    375   
  350    376   
    /// Creates the `FlattenedXmlMapError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  351    377   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  352    378   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  353    379   
            source: err.clone().into(),
  354    380   
            meta: err,
  355    381   
        })
  356    382   
    }
  357         -
    ///
         383  +
    /// /* OperationErrorGenerator.kt:236 */
  358    384   
    /// Returns error metadata, which includes the error code, message,
  359    385   
    /// request ID, and potentially additional information.
  360    386   
    ///
         387  +
    /* OperationErrorGenerator.kt:242 */
  361    388   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         389  +
        /* OperationErrorGenerator.kt:243 */
  362    390   
        match self {
  363         -
            Self::Unhandled(e) => &e.meta,
         391  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         392  +
            /* OperationErrorGenerator.kt:243 */
  364    393   
        }
         394  +
        /* OperationErrorGenerator.kt:242 */
  365    395   
    }
         396  +
    /* OperationErrorGenerator.kt:218 */
  366    397   
}
         398  +
/* OperationErrorGenerator.kt:269 */
  367    399   
impl ::std::error::Error for FlattenedXmlMapError {
         400  +
    /* OperationErrorGenerator.kt:270 */
  368    401   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         402  +
        /* OperationErrorGenerator.kt:318 */
  369    403   
        match self {
  370         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         404  +
            /* OperationErrorGenerator.kt:326 */
         405  +
            Self::Unhandled(_inner) => {
         406  +
                /* OperationErrorGenerator.kt:279 */
         407  +
                ::std::option::Option::Some(&*_inner.source)
         408  +
                /* OperationErrorGenerator.kt:326 */
         409  +
            } /* OperationErrorGenerator.kt:318 */
  371    410   
        }
         411  +
        /* OperationErrorGenerator.kt:270 */
  372    412   
    }
         413  +
    /* OperationErrorGenerator.kt:269 */
  373    414   
}
         415  +
/* OperationErrorGenerator.kt:133 */
  374    416   
impl ::std::fmt::Display for FlattenedXmlMapError {
         417  +
    /* OperationErrorGenerator.kt:134 */
  375    418   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         419  +
        /* OperationErrorGenerator.kt:318 */
  376    420   
        match self {
         421  +
            /* OperationErrorGenerator.kt:326 */
  377    422   
            Self::Unhandled(_inner) => {
         423  +
                /* OperationErrorGenerator.kt:139 */
  378    424   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  379    425   
                    write!(f, "unhandled error ({code})")
  380    426   
                } else {
  381    427   
                    f.write_str("unhandled error")
  382    428   
                }
         429  +
                /* OperationErrorGenerator.kt:326 */
         430  +
            } /* OperationErrorGenerator.kt:318 */
  383    431   
        }
         432  +
        /* OperationErrorGenerator.kt:134 */
  384    433   
    }
  385         -
    }
         434  +
    /* OperationErrorGenerator.kt:133 */
  386    435   
}
         436  +
/* OperationErrorGenerator.kt:182 */
  387    437   
impl ::aws_smithy_types::retry::ProvideErrorKind for FlattenedXmlMapError {
         438  +
    /* OperationErrorGenerator.kt:186 */
  388    439   
    fn code(&self) -> ::std::option::Option<&str> {
         440  +
        /* OperationErrorGenerator.kt:187 */
  389    441   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         442  +
        /* OperationErrorGenerator.kt:186 */
  390    443   
    }
         444  +
    /* OperationErrorGenerator.kt:190 */
  391    445   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         446  +
        /* OperationErrorGenerator.kt:197 */
  392    447   
        ::std::option::Option::None
         448  +
        /* OperationErrorGenerator.kt:190 */
  393    449   
    }
         450  +
    /* OperationErrorGenerator.kt:182 */
  394    451   
}
         452  +
/* OperationErrorGenerator.kt:163 */
  395    453   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FlattenedXmlMapError {
         454  +
    /* OperationErrorGenerator.kt:164 */
  396    455   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         456  +
        /* OperationErrorGenerator.kt:318 */
  397    457   
        match self {
  398         -
            Self::Unhandled(_inner) => &_inner.meta,
         458  +
            /* OperationErrorGenerator.kt:326 */
         459  +
            Self::Unhandled(_inner) => {
         460  +
                /* OperationErrorGenerator.kt:168 */
         461  +
                &_inner.meta
         462  +
                /* OperationErrorGenerator.kt:326 */
         463  +
            } /* OperationErrorGenerator.kt:318 */
  399    464   
        }
         465  +
        /* OperationErrorGenerator.kt:164 */
  400    466   
    }
         467  +
    /* OperationErrorGenerator.kt:163 */
  401    468   
}
         469  +
/* OperationErrorGenerator.kt:109 */
  402    470   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FlattenedXmlMapError {
         471  +
    /* OperationErrorGenerator.kt:110 */
  403    472   
    fn create_unhandled_error(
  404    473   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  405    474   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  406    475   
    ) -> Self {
         476  +
        /* OperationErrorGenerator.kt:121 */
  407    477   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  408    478   
            source,
  409    479   
            meta: meta.unwrap_or_default(),
  410    480   
        })
         481  +
        /* OperationErrorGenerator.kt:110 */
  411    482   
    }
         483  +
    /* OperationErrorGenerator.kt:109 */
  412    484   
}
  413    485   
         486  +
/* CodegenDelegator.kt:255 */
  414    487   
pub use crate::operation::flattened_xml_map::_flattened_xml_map_output::FlattenedXmlMapOutput;
  415    488   
         489  +
/* CodegenDelegator.kt:255 */
  416    490   
pub use crate::operation::flattened_xml_map::_flattened_xml_map_input::FlattenedXmlMapInput;
  417    491   
         492  +
/* RustModule.kt:172 */
  418    493   
mod _flattened_xml_map_input;
  419    494   
         495  +
/* RustModule.kt:172 */
  420    496   
mod _flattened_xml_map_output;
  421    497   
  422         -
/// Builders
         498  +
/// /* CodegenDelegator.kt:51 */Builders
  423    499   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map/_flattened_xml_map_input.rs

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map/builders.rs

@@ -1,1 +130,148 @@
    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::flattened_xml_map::_flattened_xml_map_output::FlattenedXmlMapOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::flattened_xml_map::_flattened_xml_map_input::FlattenedXmlMapInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::flattened_xml_map::builders::FlattenedXmlMapInputBuilder {
    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::flattened_xml_map::FlattenedXmlMapOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::flattened_xml_map::FlattenedXmlMapError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.flattened_xml_map();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `FlattenedXmlMap`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `FlattenedXmlMap`.
   24     27   
///
   25         -
/// Flattened maps
          28  +
/// /* FluentBuilderGenerator.kt:130 */Flattened maps
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct FlattenedXmlMapFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::flattened_xml_map::builders::FlattenedXmlMapInputBuilder,
   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::flattened_xml_map::FlattenedXmlMapOutput,
   35     41   
        crate::operation::flattened_xml_map::FlattenedXmlMapError,
   36     42   
    > for FlattenedXmlMapFluentBuilder
   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::flattened_xml_map::FlattenedXmlMapOutput,
   44     50   
            crate::operation::flattened_xml_map::FlattenedXmlMapError,
   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 FlattenedXmlMapFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `FlattenedXmlMapFluentBuilder`.
   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 FlattenedXmlMap as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::flattened_xml_map::builders::FlattenedXmlMapInputBuilder {
   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::flattened_xml_map::FlattenedXmlMapOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::flattened_xml_map::FlattenedXmlMapError,
   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::flattened_xml_map::FlattenedXmlMap::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::flattened_xml_map::FlattenedXmlMap::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::flattened_xml_map::FlattenedXmlMapOutput,
   97    107   
        crate::operation::flattened_xml_map::FlattenedXmlMapError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
  111         -
    ///
         122  +
    /// /* FluentBuilderGenerator.kt:466 */
  112    123   
    /// Adds a key-value pair to `myMap`.
  113    124   
    ///
  114    125   
    /// To override the contents of this collection use [`set_my_map`](Self::set_my_map).
  115    126   
    ///
         127  +
    /* FluentBuilderGenerator.kt:473 */
  116    128   
    #[allow(missing_docs)] // documentation missing in model
         129  +
                           /* FluentBuilderGenerator.kt:475 */
  117    130   
    pub fn my_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::FooEnum) -> Self {
  118    131   
        self.inner = self.inner.my_map(k.into(), v);
  119    132   
        self
  120    133   
    }
         134  +
    /* FluentBuilderGenerator.kt:498 */
  121    135   
    #[allow(missing_docs)] // documentation missing in model
         136  +
                           /* FluentBuilderGenerator.kt:500 */
  122    137   
    pub fn set_my_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>) -> Self {
  123    138   
        self.inner = self.inner.set_my_map(input);
  124    139   
        self
  125    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:518 */
  126    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:520 */
  127    144   
    pub fn get_my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>> {
  128    145   
        self.inner.get_my_map()
  129    146   
    }
         147  +
    /* FluentBuilderGenerator.kt:282 */
  130    148   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name.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 `FlattenedXmlMapWithXmlName`.
           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 FlattenedXmlMapWithXmlName;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl FlattenedXmlMapWithXmlName {
    7         -
    /// Creates a new `FlattenedXmlMapWithXmlName`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `FlattenedXmlMapWithXmlName`
          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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +271,288 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for FlattenedXmlMapWithXmlName {
   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("FlattenedXmlMapWithXmlName");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            FlattenedXmlMapWithXmlNameRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            FlattenedXmlMapWithXmlNameResponseDeserializer,
  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   
            "FlattenedXmlMapWithXmlName",
  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("FlattenedXmlMapWithXmlName")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(FlattenedXmlMapWithXmlNameEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
  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 FlattenedXmlMapWithXmlNameResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapWithXmlNameResponseDeserializer {
  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_flattened_xml_map_with_xml_name::de_flattened_xml_map_with_xml_name_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_flattened_xml_map_with_xml_name::de_flattened_xml_map_with_xml_name_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 FlattenedXmlMapWithXmlNameRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FlattenedXmlMapWithXmlNameRequestSerializer {
  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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput>()
  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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
  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, "/FlattenedXmlMapWithXmlName").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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
  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(
  196    209   
            crate::protocol_serde::shape_flattened_xml_map_with_xml_name::ser_flattened_xml_map_with_xml_name_op_input(&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 FlattenedXmlMapWithXmlNameEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FlattenedXmlMapWithXmlNameEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "FlattenedXmlMapWithXmlNameEndpointParamsInterceptor"
  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::<FlattenedXmlMapWithXmlNameInput>()
  226    240   
            .ok_or("failed to downcast to FlattenedXmlMapWithXmlNameInput")?;
  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 flattened_xml_map_with_xml_name_test {
  243    260   
  244    261   
    /// Serializes flattened XML maps in requests that have xmlName on members
  245    262   
    /// Test ID: FlattenedXmlMapWithXmlName
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn flattened_xml_map_with_xml_name_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   
@@ -290,307 +419,495 @@
  310    327   
                )))
  311    328   
            });
  312    329   
            de.deserialize_nonstreaming(&http_response)
  313    330   
        });
  314    331   
        let parsed = parsed
  315    332   
            .expect("should be successful response")
  316    333   
            .downcast::<crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput>()
  317    334   
            .unwrap();
  318    335   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  319    336   
    }
         337  +
         338  +
    /* ProtocolTestGenerator.kt:98 */
  320    339   
}
  321    340   
         341  +
/* OperationErrorGenerator.kt:79 */
  322    342   
/// Error type for the `FlattenedXmlMapWithXmlNameError` operation.
         343  +
/* RustType.kt:516 */
  323    344   
#[non_exhaustive]
         345  +
/* RustType.kt:516 */
  324    346   
#[derive(::std::fmt::Debug)]
  325         -
pub enum FlattenedXmlMapWithXmlNameError {
         347  +
pub /* OperationErrorGenerator.kt:81 */ enum FlattenedXmlMapWithXmlNameError {
         348  +
    /* OperationErrorGenerator.kt:88 */
  326    349   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  327    350   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  328    351   
    variable wildcard pattern and check `.code()`:
  329    352   
     \
  330    353   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  331    354   
     \
  332    355   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FlattenedXmlMapWithXmlNameError) for what information is available for the error.")]
  333    356   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         357  +
    /* OperationErrorGenerator.kt:81 */
  334    358   
}
         359  +
/* OperationErrorGenerator.kt:218 */
  335    360   
impl FlattenedXmlMapWithXmlNameError {
         361  +
    /* OperationErrorGenerator.kt:219 */
  336    362   
    /// Creates the `FlattenedXmlMapWithXmlNameError::Unhandled` variant from any error type.
  337    363   
    pub fn unhandled(
  338    364   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  339    365   
    ) -> Self {
  340    366   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  341    367   
            source: err.into(),
  342    368   
            meta: ::std::default::Default::default(),
  343    369   
        })
  344    370   
    }
  345    371   
  346    372   
    /// Creates the `FlattenedXmlMapWithXmlNameError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  347    373   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  348    374   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  349    375   
            source: err.clone().into(),
  350    376   
            meta: err,
  351    377   
        })
  352    378   
    }
  353         -
    ///
         379  +
    /// /* OperationErrorGenerator.kt:236 */
  354    380   
    /// Returns error metadata, which includes the error code, message,
  355    381   
    /// request ID, and potentially additional information.
  356    382   
    ///
         383  +
    /* OperationErrorGenerator.kt:242 */
  357    384   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         385  +
        /* OperationErrorGenerator.kt:243 */
  358    386   
        match self {
  359         -
            Self::Unhandled(e) => &e.meta,
         387  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         388  +
            /* OperationErrorGenerator.kt:243 */
  360    389   
        }
         390  +
        /* OperationErrorGenerator.kt:242 */
  361    391   
    }
         392  +
    /* OperationErrorGenerator.kt:218 */
  362    393   
}
         394  +
/* OperationErrorGenerator.kt:269 */
  363    395   
impl ::std::error::Error for FlattenedXmlMapWithXmlNameError {
         396  +
    /* OperationErrorGenerator.kt:270 */
  364    397   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         398  +
        /* OperationErrorGenerator.kt:318 */
  365    399   
        match self {
  366         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         400  +
            /* OperationErrorGenerator.kt:326 */
         401  +
            Self::Unhandled(_inner) => {
         402  +
                /* OperationErrorGenerator.kt:279 */
         403  +
                ::std::option::Option::Some(&*_inner.source)
         404  +
                /* OperationErrorGenerator.kt:326 */
         405  +
            } /* OperationErrorGenerator.kt:318 */
  367    406   
        }
         407  +
        /* OperationErrorGenerator.kt:270 */
  368    408   
    }
         409  +
    /* OperationErrorGenerator.kt:269 */
  369    410   
}
         411  +
/* OperationErrorGenerator.kt:133 */
  370    412   
impl ::std::fmt::Display for FlattenedXmlMapWithXmlNameError {
         413  +
    /* OperationErrorGenerator.kt:134 */
  371    414   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         415  +
        /* OperationErrorGenerator.kt:318 */
  372    416   
        match self {
         417  +
            /* OperationErrorGenerator.kt:326 */
  373    418   
            Self::Unhandled(_inner) => {
         419  +
                /* OperationErrorGenerator.kt:139 */
  374    420   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  375    421   
                    write!(f, "unhandled error ({code})")
  376    422   
                } else {
  377    423   
                    f.write_str("unhandled error")
  378    424   
                }
         425  +
                /* OperationErrorGenerator.kt:326 */
         426  +
            } /* OperationErrorGenerator.kt:318 */
  379    427   
        }
         428  +
        /* OperationErrorGenerator.kt:134 */
  380    429   
    }
  381         -
    }
         430  +
    /* OperationErrorGenerator.kt:133 */
  382    431   
}
         432  +
/* OperationErrorGenerator.kt:182 */
  383    433   
impl ::aws_smithy_types::retry::ProvideErrorKind for FlattenedXmlMapWithXmlNameError {
         434  +
    /* OperationErrorGenerator.kt:186 */
  384    435   
    fn code(&self) -> ::std::option::Option<&str> {
         436  +
        /* OperationErrorGenerator.kt:187 */
  385    437   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         438  +
        /* OperationErrorGenerator.kt:186 */
  386    439   
    }
         440  +
    /* OperationErrorGenerator.kt:190 */
  387    441   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         442  +
        /* OperationErrorGenerator.kt:197 */
  388    443   
        ::std::option::Option::None
         444  +
        /* OperationErrorGenerator.kt:190 */
  389    445   
    }
         446  +
    /* OperationErrorGenerator.kt:182 */
  390    447   
}
         448  +
/* OperationErrorGenerator.kt:163 */
  391    449   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FlattenedXmlMapWithXmlNameError {
         450  +
    /* OperationErrorGenerator.kt:164 */
  392    451   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         452  +
        /* OperationErrorGenerator.kt:318 */
  393    453   
        match self {
  394         -
            Self::Unhandled(_inner) => &_inner.meta,
         454  +
            /* OperationErrorGenerator.kt:326 */
         455  +
            Self::Unhandled(_inner) => {
         456  +
                /* OperationErrorGenerator.kt:168 */
         457  +
                &_inner.meta
         458  +
                /* OperationErrorGenerator.kt:326 */
         459  +
            } /* OperationErrorGenerator.kt:318 */
  395    460   
        }
         461  +
        /* OperationErrorGenerator.kt:164 */
  396    462   
    }
         463  +
    /* OperationErrorGenerator.kt:163 */
  397    464   
}
         465  +
/* OperationErrorGenerator.kt:109 */
  398    466   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FlattenedXmlMapWithXmlNameError {
         467  +
    /* OperationErrorGenerator.kt:110 */
  399    468   
    fn create_unhandled_error(
  400    469   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  401    470   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  402    471   
    ) -> Self {
         472  +
        /* OperationErrorGenerator.kt:121 */
  403    473   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  404    474   
            source,
  405    475   
            meta: meta.unwrap_or_default(),
  406    476   
        })
         477  +
        /* OperationErrorGenerator.kt:110 */
  407    478   
    }
         479  +
    /* OperationErrorGenerator.kt:109 */
  408    480   
}
  409    481   
         482  +
/* CodegenDelegator.kt:255 */
  410    483   
pub use crate::operation::flattened_xml_map_with_xml_name::_flattened_xml_map_with_xml_name_output::FlattenedXmlMapWithXmlNameOutput;
  411    484   
         485  +
/* CodegenDelegator.kt:255 */
  412    486   
pub use crate::operation::flattened_xml_map_with_xml_name::_flattened_xml_map_with_xml_name_input::FlattenedXmlMapWithXmlNameInput;
  413    487   
         488  +
/* RustModule.kt:172 */
  414    489   
mod _flattened_xml_map_with_xml_name_input;
  415    490   
         491  +
/* RustModule.kt:172 */
  416    492   
mod _flattened_xml_map_with_xml_name_output;
  417    493   
  418         -
/// Builders
         494  +
/// /* CodegenDelegator.kt:51 */Builders
  419    495   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name/_flattened_xml_map_with_xml_name_input.rs

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name/builders.rs

@@ -1,1 +130,148 @@
    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::flattened_xml_map_with_xml_name::_flattened_xml_map_with_xml_name_output::FlattenedXmlMapWithXmlNameOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::flattened_xml_map_with_xml_name::_flattened_xml_map_with_xml_name_input::FlattenedXmlMapWithXmlNameInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameInputBuilder {
    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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.flattened_xml_map_with_xml_name();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `FlattenedXmlMapWithXmlName`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `FlattenedXmlMapWithXmlName`.
   24     27   
///
   25         -
/// Flattened maps with @xmlName
          28  +
/// /* FluentBuilderGenerator.kt:130 */Flattened maps with @xmlName
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct FlattenedXmlMapWithXmlNameFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameInputBuilder,
   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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   35     41   
        crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   36     42   
    > for FlattenedXmlMapWithXmlNameFluentBuilder
   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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   44     50   
            crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   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 FlattenedXmlMapWithXmlNameFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `FlattenedXmlMapWithXmlNameFluentBuilder`.
   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 FlattenedXmlMapWithXmlName as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameInputBuilder {
   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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlName::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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlName::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::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
   97    107   
        crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
  111         -
    ///
         122  +
    /// /* FluentBuilderGenerator.kt:466 */
  112    123   
    /// Adds a key-value pair to `myMap`.
  113    124   
    ///
  114    125   
    /// To override the contents of this collection use [`set_my_map`](Self::set_my_map).
  115    126   
    ///
         127  +
    /* FluentBuilderGenerator.kt:473 */
  116    128   
    #[allow(missing_docs)] // documentation missing in model
         129  +
                           /* FluentBuilderGenerator.kt:475 */
  117    130   
    pub fn my_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
  118    131   
        self.inner = self.inner.my_map(k.into(), v.into());
  119    132   
        self
  120    133   
    }
         134  +
    /* FluentBuilderGenerator.kt:498 */
  121    135   
    #[allow(missing_docs)] // documentation missing in model
         136  +
                           /* FluentBuilderGenerator.kt:500 */
  122    137   
    pub fn set_my_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
  123    138   
        self.inner = self.inner.set_my_map(input);
  124    139   
        self
  125    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:518 */
  126    142   
    #[allow(missing_docs)] // documentation missing in model
         143  +
                           /* FluentBuilderGenerator.kt:520 */
  127    144   
    pub fn get_my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  128    145   
        self.inner.get_my_map()
  129    146   
    }
         147  +
    /* FluentBuilderGenerator.kt:282 */
  130    148   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_namespace.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 `FlattenedXmlMapWithXmlNamespace`.
           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 FlattenedXmlMapWithXmlNamespace;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl FlattenedXmlMapWithXmlNamespace {
    7         -
    /// Creates a new `FlattenedXmlMapWithXmlNamespace`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `FlattenedXmlMapWithXmlNamespace`
          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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +385,461 @@
   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 FlattenedXmlMapWithXmlNamespace {
   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("FlattenedXmlMapWithXmlNamespace");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            FlattenedXmlMapWithXmlNamespaceRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            FlattenedXmlMapWithXmlNamespaceResponseDeserializer,
  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   
            "FlattenedXmlMapWithXmlNamespace",
  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("FlattenedXmlMapWithXmlNamespace")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(FlattenedXmlMapWithXmlNamespaceEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
  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 FlattenedXmlMapWithXmlNamespaceResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FlattenedXmlMapWithXmlNamespaceResponseDeserializer {
  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_flattened_xml_map_with_xml_namespace::de_flattened_xml_map_with_xml_namespace_http_error(
  151    163   
                status, headers, body,
  152    164   
            )
  153    165   
        } else {
  154    166   
            crate::protocol_serde::shape_flattened_xml_map_with_xml_namespace::de_flattened_xml_map_with_xml_namespace_http_response(
  155    167   
                status, headers, body,
  156    168   
            )
  157    169   
        };
  158    170   
        crate::protocol_serde::type_erase_result(parse_result)
  159    171   
    }
  160    172   
}
         173  +
/* RequestSerializerGenerator.kt:67 */
  161    174   
#[derive(Debug)]
  162    175   
struct FlattenedXmlMapWithXmlNamespaceRequestSerializer;
  163    176   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FlattenedXmlMapWithXmlNamespaceRequestSerializer {
  164    177   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  165    178   
    fn serialize_input(
  166    179   
        &self,
  167    180   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  168    181   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  169    182   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  170    183   
        let input = input
  171    184   
            .downcast::<crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput>()
  172    185   
            .expect("correct type");
  173    186   
        let _header_serialization_settings = _cfg
  174    187   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175    188   
            .cloned()
  176    189   
            .unwrap_or_default();
  177    190   
        let mut request_builder = {
  178    191   
            fn uri_base(
  179    192   
                _input: &crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput,
  180    193   
                output: &mut ::std::string::String,
  181    194   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182    195   
                use ::std::fmt::Write as _;
  183    196   
                ::std::write!(output, "/FlattenedXmlMapWithXmlNamespace").expect("formatting should succeed");
  184    197   
                ::std::result::Result::Ok(())
  185    198   
            }
  186    199   
            #[allow(clippy::unnecessary_wraps)]
  187    200   
            fn update_http_builder(
  188    201   
                input: &crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceInput,
  189    202   
                builder: ::http::request::Builder,
  190    203   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191    204   
                let mut uri = ::std::string::String::new();
  192    205   
                uri_base(input, &mut uri)?;
  193    206   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  194    207   
            }
  195    208   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  196    209   
            builder
  197    210   
        };
  198    211   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  199    212   
  200    213   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    214   
    }
  202    215   
}
         216  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  203    217   
#[derive(Debug)]
  204    218   
struct FlattenedXmlMapWithXmlNamespaceEndpointParamsInterceptor;
  205    219   
  206    220   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FlattenedXmlMapWithXmlNamespaceEndpointParamsInterceptor {
  207    221   
    fn name(&self) -> &'static str {
  208    222   
        "FlattenedXmlMapWithXmlNamespaceEndpointParamsInterceptor"
  209    223   
    }
  210    224   
  211    225   
    fn read_before_execution(
  212    226   
        &self,
  213    227   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  214    228   
            '_,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  218    232   
        >,
  219    233   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  220    234   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  221    235   
        let _input = context
  222    236   
            .input()
  223    237   
            .downcast_ref::<FlattenedXmlMapWithXmlNamespaceInput>()
  224    238   
            .ok_or("failed to downcast to FlattenedXmlMapWithXmlNamespaceInput")?;
  225    239   
  226    240   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  227    241   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  228    242   
        })?;
  229    243   
        cfg.interceptor_state()
  230    244   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  231    245   
        ::std::result::Result::Ok(())
  232    246   
    }
  233    247   
}
  234    248   
  235    249   
// The get_* functions below are generated from JMESPath expressions in the
  236    250   
// operationContextParams trait. They target the operation's input shape.
  237    251   
         252  +
/* RustType.kt:516 */
  238    253   
#[allow(unreachable_code, unused_variables)]
         254  +
/* RustType.kt:516 */
  239    255   
#[cfg(test)]
         256  +
/* ProtocolTestGenerator.kt:98 */
  240    257   
mod flattened_xml_map_with_xml_namespace_test {
  241    258   
  242    259   
    /// Serializes flattened XML maps in responses that have xmlNamespace and xmlName on members
  243    260   
    /// Test ID: RestXmlFlattenedXmlMapWithXmlNamespace
  244    261   
    #[::tokio::test]
  245    262   
    #[::tracing_test::traced_test]
  246    263   
    async fn rest_xml_flattened_xml_map_with_xml_namespace_response() {
  247    264   
        let expected_output = crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput::builder()
  248    265   
            .set_my_map(::std::option::Option::Some({
  249    266   
                let mut ret = ::std::collections::HashMap::new();
  250    267   
                ret.insert("a".to_owned(), "A".to_owned());
  251    268   
                ret.insert("b".to_owned(), "B".to_owned());
  252    269   
                ret
  253    270   
            }))
  254    271   
            .build();
  255    272   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
  256    273   
        .header("Content-Type", "application/xml")
  257    274   
        .status(200)
  258    275   
                    .body(::aws_smithy_types::body::SdkBody::from("<FlattenedXmlMapWithXmlNamespaceOutput>\n    <KVP xmlns=\"https://the-member.example.com\">\n        <K xmlns=\"https://the-key.example.com\">a</K>\n        <V xmlns=\"https://the-value.example.com\">A</V>\n    </KVP>\n    <KVP xmlns=\"https://the-member.example.com\">\n        <K xmlns=\"https://the-key.example.com\">b</K>\n        <V xmlns=\"https://the-value.example.com\">B</V>\n    </KVP>\n</FlattenedXmlMapWithXmlNamespaceOutput>"))
  259    276   
                    .unwrap()
  260    277   
                    ).unwrap();
  261    278   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  262    279   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  263    280   
  264    281   
        let op = crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespace::new();
  265    282   
        let config = op.config().expect("the operation has config");
  266    283   
        let de = config
  267    284   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  268    285   
            .expect("the config must have a deserializer");
  269    286   
  270    287   
        let parsed = de.deserialize_streaming(&mut http_response);
  271    288   
        let parsed = parsed.unwrap_or_else(|| {
  272    289   
            let http_response = http_response.map(|body| {
  273    290   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  274    291   
                    body.bytes().unwrap(),
  275    292   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  276    293   
                )))
  277    294   
            });
  278    295   
            de.deserialize_nonstreaming(&http_response)
  279    296   
        });
  280    297   
        let parsed = parsed
  281    298   
            .expect("should be successful response")
  282    299   
            .downcast::<crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput>()
  283    300   
            .unwrap();
  284    301   
        ::pretty_assertions::assert_eq!(parsed.my_map, expected_output.my_map, "Unexpected value for `my_map`");
  285    302   
    }
         303  +
         304  +
    /* ProtocolTestGenerator.kt:98 */
  286    305   
}
  287    306   
         307  +
/* OperationErrorGenerator.kt:79 */
  288    308   
/// Error type for the `FlattenedXmlMapWithXmlNamespaceError` operation.
         309  +
/* RustType.kt:516 */
  289    310   
#[non_exhaustive]
         311  +
/* RustType.kt:516 */
  290    312   
#[derive(::std::fmt::Debug)]
  291         -
pub enum FlattenedXmlMapWithXmlNamespaceError {
         313  +
pub /* OperationErrorGenerator.kt:81 */ enum FlattenedXmlMapWithXmlNamespaceError {
         314  +
    /* OperationErrorGenerator.kt:88 */
  292    315   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  293    316   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  294    317   
    variable wildcard pattern and check `.code()`:
  295    318   
     \
  296    319   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  297    320   
     \
  298    321   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FlattenedXmlMapWithXmlNamespaceError) for what information is available for the error.")]
  299    322   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         323  +
    /* OperationErrorGenerator.kt:81 */
  300    324   
}
         325  +
/* OperationErrorGenerator.kt:218 */
  301    326   
impl FlattenedXmlMapWithXmlNamespaceError {
         327  +
    /* OperationErrorGenerator.kt:219 */
  302    328   
    /// Creates the `FlattenedXmlMapWithXmlNamespaceError::Unhandled` variant from any error type.
  303    329   
    pub fn unhandled(
  304    330   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  305    331   
    ) -> Self {
  306    332   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  307    333   
            source: err.into(),
  308    334   
            meta: ::std::default::Default::default(),
  309    335   
        })
  310    336   
    }
  311    337   
  312    338   
    /// Creates the `FlattenedXmlMapWithXmlNamespaceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  313    339   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  314    340   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  315    341   
            source: err.clone().into(),
  316    342   
            meta: err,
  317    343   
        })
  318    344   
    }
  319         -
    ///
         345  +
    /// /* OperationErrorGenerator.kt:236 */
  320    346   
    /// Returns error metadata, which includes the error code, message,
  321    347   
    /// request ID, and potentially additional information.
  322    348   
    ///
         349  +
    /* OperationErrorGenerator.kt:242 */
  323    350   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         351  +
        /* OperationErrorGenerator.kt:243 */
  324    352   
        match self {
  325         -
            Self::Unhandled(e) => &e.meta,
         353  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         354  +
            /* OperationErrorGenerator.kt:243 */
  326    355   
        }
         356  +
        /* OperationErrorGenerator.kt:242 */
  327    357   
    }
         358  +
    /* OperationErrorGenerator.kt:218 */
  328    359   
}
         360  +
/* OperationErrorGenerator.kt:269 */
  329    361   
impl ::std::error::Error for FlattenedXmlMapWithXmlNamespaceError {
         362  +
    /* OperationErrorGenerator.kt:270 */
  330    363   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         364  +
        /* OperationErrorGenerator.kt:318 */
  331    365   
        match self {
  332         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         366  +
            /* OperationErrorGenerator.kt:326 */
         367  +
            Self::Unhandled(_inner) => {
         368  +
                /* OperationErrorGenerator.kt:279 */
         369  +
                ::std::option::Option::Some(&*_inner.source)
         370  +
                /* OperationErrorGenerator.kt:326 */
         371  +
            } /* OperationErrorGenerator.kt:318 */
  333    372   
        }
         373  +
        /* OperationErrorGenerator.kt:270 */
  334    374   
    }
         375  +
    /* OperationErrorGenerator.kt:269 */
  335    376   
}
         377  +
/* OperationErrorGenerator.kt:133 */
  336    378   
impl ::std::fmt::Display for FlattenedXmlMapWithXmlNamespaceError {
         379  +
    /* OperationErrorGenerator.kt:134 */
  337    380   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         381  +
        /* OperationErrorGenerator.kt:318 */
  338    382   
        match self {
         383  +
            /* OperationErrorGenerator.kt:326 */
  339    384   
            Self::Unhandled(_inner) => {
         385  +
                /* OperationErrorGenerator.kt:139 */
  340    386   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  341    387   
                    write!(f, "unhandled error ({code})")
  342    388   
                } else {
  343    389   
                    f.write_str("unhandled error")
  344    390   
                }
         391  +
                /* OperationErrorGenerator.kt:326 */
         392  +
            } /* OperationErrorGenerator.kt:318 */
  345    393   
        }
         394  +
        /* OperationErrorGenerator.kt:134 */
  346    395   
    }
  347         -
    }
         396  +
    /* OperationErrorGenerator.kt:133 */
  348    397   
}
         398  +
/* OperationErrorGenerator.kt:182 */
  349    399   
impl ::aws_smithy_types::retry::ProvideErrorKind for FlattenedXmlMapWithXmlNamespaceError {
         400  +
    /* OperationErrorGenerator.kt:186 */
  350    401   
    fn code(&self) -> ::std::option::Option<&str> {
         402  +
        /* OperationErrorGenerator.kt:187 */
  351    403   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         404  +
        /* OperationErrorGenerator.kt:186 */
  352    405   
    }
         406  +
    /* OperationErrorGenerator.kt:190 */
  353    407   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         408  +
        /* OperationErrorGenerator.kt:197 */
  354    409   
        ::std::option::Option::None
         410  +
        /* OperationErrorGenerator.kt:190 */
  355    411   
    }
         412  +
    /* OperationErrorGenerator.kt:182 */
  356    413   
}
         414  +
/* OperationErrorGenerator.kt:163 */
  357    415   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FlattenedXmlMapWithXmlNamespaceError {
         416  +
    /* OperationErrorGenerator.kt:164 */
  358    417   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         418  +
        /* OperationErrorGenerator.kt:318 */
  359    419   
        match self {
  360         -
            Self::Unhandled(_inner) => &_inner.meta,
         420  +
            /* OperationErrorGenerator.kt:326 */
         421  +
            Self::Unhandled(_inner) => {
         422  +
                /* OperationErrorGenerator.kt:168 */
         423  +
                &_inner.meta
         424  +
                /* OperationErrorGenerator.kt:326 */
         425  +
            } /* OperationErrorGenerator.kt:318 */
  361    426   
        }
         427  +
        /* OperationErrorGenerator.kt:164 */
  362    428   
    }
         429  +
    /* OperationErrorGenerator.kt:163 */
  363    430   
}
         431  +
/* OperationErrorGenerator.kt:109 */
  364    432   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FlattenedXmlMapWithXmlNamespaceError {
         433  +
    /* OperationErrorGenerator.kt:110 */
  365    434   
    fn create_unhandled_error(
  366    435   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  367    436   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  368    437   
    ) -> Self {
         438  +
        /* OperationErrorGenerator.kt:121 */
  369    439   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  370    440   
            source,
  371    441   
            meta: meta.unwrap_or_default(),
  372    442   
        })
         443  +
        /* OperationErrorGenerator.kt:110 */
  373    444   
    }
         445  +
    /* OperationErrorGenerator.kt:109 */
  374    446   
}
  375    447   
         448  +
/* CodegenDelegator.kt:255 */
  376    449   
pub use crate::operation::flattened_xml_map_with_xml_namespace::_flattened_xml_map_with_xml_namespace_output::FlattenedXmlMapWithXmlNamespaceOutput;
  377    450   
         451  +
/* CodegenDelegator.kt:255 */
  378    452   
pub use crate::operation::flattened_xml_map_with_xml_namespace::_flattened_xml_map_with_xml_namespace_input::FlattenedXmlMapWithXmlNamespaceInput;
  379    453   
         454  +
/* RustModule.kt:172 */
  380    455   
mod _flattened_xml_map_with_xml_namespace_input;
  381    456   
         457  +
/* RustModule.kt:172 */
  382    458   
mod _flattened_xml_map_with_xml_namespace_output;
  383    459   
  384         -
/// Builders
         460  +
/// /* CodegenDelegator.kt:51 */Builders
  385    461   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_namespace/_flattened_xml_map_with_xml_namespace_input.rs

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_namespace/builders.rs

@@ -1,1 +111,123 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::flattened_xml_map_with_xml_namespace::_flattened_xml_map_with_xml_namespace_output::FlattenedXmlMapWithXmlNamespaceOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::flattened_xml_map_with_xml_namespace::_flattened_xml_map_with_xml_namespace_input::FlattenedXmlMapWithXmlNamespaceInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceInputBuilder {
    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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.flattened_xml_map_with_xml_namespace();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `FlattenedXmlMapWithXmlNamespace`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `FlattenedXmlMapWithXmlNamespace`.
   24     27   
///
   25         -
/// Flattened maps with @xmlNamespace and @xmlName
          28  +
/// /* FluentBuilderGenerator.kt:130 */Flattened maps with @xmlNamespace and @xmlName
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct FlattenedXmlMapWithXmlNamespaceFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceInputBuilder,
   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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   35     41   
        crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   36     42   
    > for FlattenedXmlMapWithXmlNamespaceFluentBuilder
   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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   44     50   
            crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   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 FlattenedXmlMapWithXmlNamespaceFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `FlattenedXmlMapWithXmlNamespaceFluentBuilder`.
   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 FlattenedXmlMapWithXmlNamespace as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::flattened_xml_map_with_xml_namespace::builders::FlattenedXmlMapWithXmlNamespaceInputBuilder {
   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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespace::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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespace::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::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceOutput,
   97    107   
        crate::operation::flattened_xml_map_with_xml_namespace::FlattenedXmlMapWithXmlNamespaceError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:282 */
  111    123   
}