Client Test

Client Test

rev. 26e0a1e8aaec58e3c7fd18a79449d71bcadaf391 (ignoring whitespace)

Files changed:

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

@@ -222,222 +282,284 @@
  242    242   
#[cfg(test)]
  243    243   
mod map_with_enum_key_op_test {
  244    244   
  245    245   
    /// Test ID: MapWithEnumKeyRequest
  246    246   
    #[::tokio::test]
  247    247   
    #[::tracing_test::traced_test]
  248    248   
    async fn map_with_enum_key_request_request() {
  249    249   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    250   
        let config_builder = crate::config::Config::builder()
  251    251   
            .with_test_defaults()
  252         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         252  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         253  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         254  +
            .allow_no_auth()
  253    255   
            .endpoint_url("https://example.com");
  254    256   
  255    257   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  256    258   
        let result = client
  257    259   
            .map_with_enum_key_op()
  258    260   
            .set_map(::std::option::Option::Some({
  259    261   
                let mut ret = ::std::collections::HashMap::new();
  260    262   
                ret.insert(
  261    263   
                    "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
  262    264   
                    "something".to_owned(),

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

@@ -216,216 +276,278 @@
  236    236   
mod primitive_int_op_test {
  237    237   
  238    238   
    /// Primitive ints should not be serialized when they are unset
  239    239   
    /// Test ID: SerPrimitiveInt
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn ser_primitive_int_request() {
  243    243   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    244   
        let config_builder = crate::config::Config::builder()
  245    245   
            .with_test_defaults()
  246         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         246  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         247  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         248  +
            .allow_no_auth()
  247    249   
            .endpoint_url("https://example.com");
  248    250   
  249    251   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    252   
        let result = client.primitive_int_op().send().await;
  251    253   
        let _ = dbg!(result);
  252    254   
        let http_request = request_receiver.expect_request();
  253    255   
        let expected_headers = [("Content-Type", "application/json")];
  254    256   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  255    257   
        let body = http_request.body().bytes().expect("body should be strict");
  256    258   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(

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

@@ -241,241 +377,383 @@
  261    261   
mod query_precedence_test {
  262    262   
  263    263   
    /// Keys and values must be url encoded
  264    264   
    /// Test ID: UrlParamsKeyEncoding
  265    265   
    #[::tokio::test]
  266    266   
    #[::tracing_test::traced_test]
  267    267   
    async fn url_params_key_encoding_request() {
  268    268   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  269    269   
        let config_builder = crate::config::Config::builder()
  270    270   
            .with_test_defaults()
  271         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         271  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         272  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         273  +
            .allow_no_auth()
  272    274   
            .endpoint_url("https://example.com");
  273    275   
  274    276   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  275    277   
        let result = client
  276    278   
            .query_precedence()
  277    279   
            .set_foo(::std::option::Option::Some("&🐱".to_owned()))
  278    280   
            .set_baz(::std::option::Option::Some({
  279    281   
                let mut ret = ::std::collections::HashMap::new();
  280    282   
                ret.insert("hello there".to_owned(), "how's your encoding?".to_owned());
  281    283   
                ret.insert("a & b & c".to_owned(), "better encode = this".to_owned());
  282    284   
                ret
  283    285   
            }))
  284    286   
            .send()
  285    287   
            .await;
  286    288   
        let _ = dbg!(result);
  287    289   
        let http_request = request_receiver.expect_request();
  288    290   
        let expected_query_params = &[
  289    291   
            "bar=%26%F0%9F%90%B1",
  290    292   
            "hello%20there=how%27s%20your%20encoding%3F",
  291    293   
            "a%20%26%20b%20%26%20c=better%20encode%20%3D%20this",
  292    294   
        ];
  293    295   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  294    296   
        let body = http_request.body().bytes().expect("body should be strict");
  295    297   
        // No body.
  296    298   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  297    299   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  298    300   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  299    301   
        ::pretty_assertions::assert_eq!(uri.path(), "/Precedence", "path was incorrect");
  300    302   
    }
  301    303   
  302    304   
    /// Prefer named query parameters when serializing
  303    305   
    /// Test ID: RestJsonQueryPrecedenceForbid
  304    306   
    #[::tokio::test]
  305    307   
    #[::tracing_test::traced_test]
  306    308   
    async fn rest_json_query_precedence_forbid_request() {
  307    309   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  308    310   
        let config_builder = crate::config::Config::builder()
  309    311   
            .with_test_defaults()
  310         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         312  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         313  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         314  +
            .allow_no_auth()
  311    315   
            .endpoint_url("https://example.com");
  312    316   
  313    317   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  314    318   
        let result = client
  315    319   
            .query_precedence()
  316    320   
            .set_foo(::std::option::Option::Some("named".to_owned()))
  317    321   
            .set_baz(::std::option::Option::Some({
  318    322   
                let mut ret = ::std::collections::HashMap::new();
  319    323   
                ret.insert("bar".to_owned(), "fromMap".to_owned());
  320    324   
                ret.insert("qux".to_owned(), "alsoFromMap".to_owned());
  321    325   
                ret
  322    326   
            }))
  323    327   
            .send()
  324    328   
            .await;
  325    329   
        let _ = dbg!(result);
  326    330   
        let http_request = request_receiver.expect_request();
  327    331   
        let expected_query_params = &["bar=named", "qux=alsoFromMap"];
  328    332   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  329    333   
        let forbid_params = &["bar=fromMap"];
  330    334   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_query_params(&http_request, forbid_params));
  331    335   
        let body = http_request.body().bytes().expect("body should be strict");
  332    336   
        // No body.
  333    337   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  334    338   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  335    339   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  336    340   
        ::pretty_assertions::assert_eq!(uri.path(), "/Precedence", "path was incorrect");
  337    341   
    }
  338    342   
  339    343   
    /// Prefer named query parameters when serializing
  340    344   
    /// Test ID: RestJsonQueryPrecedence
  341    345   
    #[::tokio::test]
  342    346   
    #[::tracing_test::traced_test]
  343    347   
    async fn rest_json_query_precedence_request() {
  344    348   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  345    349   
        let config_builder = crate::config::Config::builder()
  346    350   
            .with_test_defaults()
  347         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         351  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         352  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         353  +
            .allow_no_auth()
  348    354   
            .endpoint_url("https://example.com");
  349    355   
  350    356   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  351    357   
        let result = client
  352    358   
            .query_precedence()
  353    359   
            .set_foo(::std::option::Option::Some("named".to_owned()))
  354    360   
            .set_baz(::std::option::Option::Some({
  355    361   
                let mut ret = ::std::collections::HashMap::new();
  356    362   
                ret.insert("bar".to_owned(), "fromMap".to_owned());
  357    363   
                ret.insert("qux".to_owned(), "alsoFromMap".to_owned());

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

@@ -217,217 +277,279 @@
  237    237   
#[cfg(test)]
  238    238   
mod string_payload_test {
  239    239   
  240    240   
    /// Test ID: StringPayload
  241    241   
    #[::tokio::test]
  242    242   
    #[::tracing_test::traced_test]
  243    243   
    async fn string_payload_request() {
  244    244   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  245    245   
        let config_builder = crate::config::Config::builder()
  246    246   
            .with_test_defaults()
  247         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         247  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         248  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         249  +
            .allow_no_auth()
  248    250   
            .endpoint_url("https://example.com");
  249    251   
  250    252   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  251    253   
        let result = client
  252    254   
            .string_payload()
  253    255   
            .set_payload(::std::option::Option::Some("rawstring".to_owned()))
  254    256   
            .send()
  255    257   
            .await;
  256    258   
        let _ = dbg!(result);
  257    259   
        let http_request = request_receiver.expect_request();

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/config.rs

@@ -366,366 +425,441 @@
  386    386   
  387    387   
    /// Set the auth scheme resolver for the builder
  388    388   
    ///
  389    389   
    /// # Examples
  390    390   
    /// See an example for [`Self::auth_scheme_resolver`].
  391    391   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  392    392   
        self.runtime_components
  393    393   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  394    394   
        self
  395    395   
    }
         396  +
         397  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         398  +
    ///
         399  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         400  +
    pub fn allow_no_auth(mut self) -> Self {
         401  +
        self.set_allow_no_auth();
         402  +
        self
         403  +
    }
         404  +
         405  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         406  +
    ///
         407  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         408  +
    pub fn set_allow_no_auth(&mut self) -> &mut Self {
         409  +
        self.push_runtime_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePluginV2::new().into_shared());
         410  +
        self
         411  +
    }
  396    412   
    /// Set the auth scheme preference for an auth scheme resolver
  397    413   
    /// (typically the default auth scheme resolver).
  398    414   
    ///
  399    415   
    /// Each operation has a predefined order of auth schemes, as determined by the service,
  400    416   
    /// for auth scheme resolution. By using the auth scheme preference, customers
  401    417   
    /// can reorder the schemes resolved by the auth scheme resolver.
  402    418   
    ///
  403    419   
    /// The preference list is intended as a hint rather than a strict override.
  404    420   
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
  405    421   
    ///
@@ -1214,1230 +1273,1290 @@
 1234   1250   
    {
 1235   1251   
        if config.behavior_version.is_none() {
 1236   1252   
            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
 1237   1253   
        }
 1238   1254   
    }
 1239   1255   
 1240   1256   
    let default_retry_partition = "restxmlprotocol";
 1241   1257   
 1242   1258   
    let scope = "rest_xml";
 1243   1259   
        1260  +
    #[allow(deprecated)]
 1244   1261   
                    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1245   1262   
                        // defaults
 1246   1263   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1247   1264   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1248   1265   
                                .with_retry_partition_name(default_retry_partition)
 1249   1266   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
 1250   1267   
                        ))
 1251   1268   
                        // user config
 1252   1269   
                        .with_client_plugin(
 1253   1270   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/config/auth.rs

@@ -71,71 +148,130 @@
   91     91   
    pub fn builder() -> crate::config::auth::ParamsBuilder {
   92     92   
        crate::config::auth::ParamsBuilder::default()
   93     93   
    }
   94     94   
   95     95   
    /// Return the operation name for [`Params`]
   96     96   
    pub fn operation_name(&self) -> &str {
   97     97   
        self.operation_name.as_ref()
   98     98   
    }
   99     99   
}
  100    100   
  101         -
#[cfg(test)]
  102         -
#[derive(Debug)]
  103         -
pub(crate) struct NoAuthSchemeResolver;
  104         -
  105         -
#[cfg(test)]
  106         -
impl ResolveAuthScheme for NoAuthSchemeResolver {
  107         -
    fn resolve_auth_scheme<'a>(
  108         -
        &'a self,
  109         -
        _params: &'a crate::config::auth::Params,
  110         -
        _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag,
  111         -
        _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents,
  112         -
    ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> {
  113         -
        ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(::std::result::Result::Ok(vec![
  114         -
            ::aws_smithy_runtime_api::client::auth::AuthSchemeOption::from(::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID),
  115         -
        ]))
  116         -
    }
  117         -
}
  118         -
  119    101   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  120    102   
/// Builder for [`Params`]
  121    103   
pub struct ParamsBuilder {
  122    104   
    operation_name: ::std::option::Option<::std::borrow::Cow<'static, str>>,
  123    105   
}
  124    106   
impl ParamsBuilder {
  125    107   
    /// Set the operation name for the builder
  126    108   
    pub fn operation_name(self, operation_name: impl Into<::std::borrow::Cow<'static, str>>) -> Self {
  127    109   
        self.set_operation_name(::std::option::Option::Some(operation_name.into()))
  128    110   
    }

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

@@ -381,381 +441,443 @@
  401    401   
mod all_query_string_types_test {
  402    402   
  403    403   
    /// Serializes query string parameters with all supported types
  404    404   
    /// Test ID: AllQueryStringTypes
  405    405   
    #[::tokio::test]
  406    406   
    #[::tracing_test::traced_test]
  407    407   
    async fn all_query_string_types_request() {
  408    408   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  409    409   
        let config_builder = crate::config::Config::builder()
  410    410   
            .with_test_defaults()
  411         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         411  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         412  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         413  +
            .allow_no_auth()
  412    414   
            .endpoint_url("https://example.com");
  413    415   
  414    416   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  415    417   
        let result = client
  416    418   
            .all_query_string_types()
  417    419   
            .set_query_string(::std::option::Option::Some("Hello there".to_owned()))
  418    420   
            .set_query_string_list(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
  419    421   
            .set_query_string_set(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
  420    422   
            .set_query_byte(::std::option::Option::Some(1))
  421    423   
            .set_query_short(::std::option::Option::Some(2))
@@ -477,479 +702,716 @@
  497    499   
    }
  498    500   
  499    501   
    /// Handles query string maps
  500    502   
    /// Test ID: RestXmlQueryStringMap
  501    503   
    #[::tokio::test]
  502    504   
    #[::tracing_test::traced_test]
  503    505   
    async fn rest_xml_query_string_map_request() {
  504    506   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  505    507   
        let config_builder = crate::config::Config::builder()
  506    508   
            .with_test_defaults()
  507         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         509  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         510  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         511  +
            .allow_no_auth()
  508    512   
            .endpoint_url("https://example.com");
  509    513   
  510    514   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  511    515   
        let result = client
  512    516   
            .all_query_string_types()
  513    517   
            .set_query_params_map_of_strings(::std::option::Option::Some({
  514    518   
                let mut ret = ::std::collections::HashMap::new();
  515    519   
                ret.insert("QueryParamsStringKeyA".to_owned(), "Foo".to_owned());
  516    520   
                ret.insert("QueryParamsStringKeyB".to_owned(), "Bar".to_owned());
  517    521   
                ret
  518    522   
            }))
  519    523   
            .send()
  520    524   
            .await;
  521    525   
        let _ = dbg!(result);
  522    526   
        let http_request = request_receiver.expect_request();
  523    527   
        let expected_query_params = &["QueryParamsStringKeyA=Foo", "QueryParamsStringKeyB=Bar"];
  524    528   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  525    529   
        let body = http_request.body().bytes().expect("body should be strict");
  526    530   
        // No body.
  527    531   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  528    532   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  529    533   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  530    534   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  531    535   
    }
  532    536   
  533    537   
    /// Handles escaping all required characters in the query string.
  534    538   
    /// Test ID: RestXmlQueryStringEscaping
  535    539   
    #[::tokio::test]
  536    540   
    #[::tracing_test::traced_test]
  537    541   
    async fn rest_xml_query_string_escaping_request() {
  538    542   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  539    543   
        let config_builder = crate::config::Config::builder()
  540    544   
            .with_test_defaults()
  541         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         545  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         546  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         547  +
            .allow_no_auth()
  542    548   
            .endpoint_url("https://example.com");
  543    549   
  544    550   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  545    551   
        let result = client
  546    552   
            .all_query_string_types()
  547    553   
            .set_query_string(::std::option::Option::Some(" %:/?#[]@!$&'()*+,;=😹".to_owned()))
  548    554   
            .send()
  549    555   
            .await;
  550    556   
        let _ = dbg!(result);
  551    557   
        let http_request = request_receiver.expect_request();
  552    558   
        let expected_query_params = &["String=%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9"];
  553    559   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  554    560   
        let body = http_request.body().bytes().expect("body should be strict");
  555    561   
        // No body.
  556    562   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  557    563   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  558    564   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  559    565   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  560    566   
    }
  561    567   
  562    568   
    /// Supports handling NaN float query values.
  563    569   
    /// Test ID: RestXmlSupportsNaNFloatQueryValues
  564    570   
    #[::tokio::test]
  565    571   
    #[::tracing_test::traced_test]
  566    572   
    async fn rest_xml_supports_na_n_float_query_values_request() {
  567    573   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  568    574   
        let config_builder = crate::config::Config::builder()
  569    575   
            .with_test_defaults()
  570         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         576  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         577  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         578  +
            .allow_no_auth()
  571    579   
            .endpoint_url("https://example.com");
  572    580   
  573    581   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  574    582   
        let result = client
  575    583   
            .all_query_string_types()
  576    584   
            .set_query_float(::std::option::Option::Some(
  577    585   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  578    586   
            ))
  579    587   
            .set_query_double(::std::option::Option::Some(
  580    588   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  581    589   
            ))
  582    590   
            .send()
  583    591   
            .await;
  584    592   
        let _ = dbg!(result);
  585    593   
        let http_request = request_receiver.expect_request();
  586    594   
        let expected_query_params = &["Float=NaN", "Double=NaN"];
  587    595   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  588    596   
        let body = http_request.body().bytes().expect("body should be strict");
  589    597   
        // No body.
  590    598   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  591    599   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  592    600   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  593    601   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  594    602   
    }
  595    603   
  596    604   
    /// Supports handling Infinity float query values.
  597    605   
    /// Test ID: RestXmlSupportsInfinityFloatQueryValues
  598    606   
    #[::tokio::test]
  599    607   
    #[::tracing_test::traced_test]
  600    608   
    async fn rest_xml_supports_infinity_float_query_values_request() {
  601    609   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  602    610   
        let config_builder = crate::config::Config::builder()
  603    611   
            .with_test_defaults()
  604         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         612  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         613  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         614  +
            .allow_no_auth()
  605    615   
            .endpoint_url("https://example.com");
  606    616   
  607    617   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  608    618   
        let result = client
  609    619   
            .all_query_string_types()
  610    620   
            .set_query_float(::std::option::Option::Some(
  611    621   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  612    622   
            ))
  613    623   
            .set_query_double(::std::option::Option::Some(
  614    624   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  615    625   
            ))
  616    626   
            .send()
  617    627   
            .await;
  618    628   
        let _ = dbg!(result);
  619    629   
        let http_request = request_receiver.expect_request();
  620    630   
        let expected_query_params = &["Float=Infinity", "Double=Infinity"];
  621    631   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  622    632   
        let body = http_request.body().bytes().expect("body should be strict");
  623    633   
        // No body.
  624    634   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  625    635   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  626    636   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  627    637   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  628    638   
    }
  629    639   
  630    640   
    /// Supports handling -Infinity float query values.
  631    641   
    /// Test ID: RestXmlSupportsNegativeInfinityFloatQueryValues
  632    642   
    #[::tokio::test]
  633    643   
    #[::tracing_test::traced_test]
  634    644   
    async fn rest_xml_supports_negative_infinity_float_query_values_request() {
  635    645   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  636    646   
        let config_builder = crate::config::Config::builder()
  637    647   
            .with_test_defaults()
  638         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         648  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         649  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         650  +
            .allow_no_auth()
  639    651   
            .endpoint_url("https://example.com");
  640    652   
  641    653   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  642    654   
        let result = client
  643    655   
            .all_query_string_types()
  644    656   
            .set_query_float(::std::option::Option::Some(
  645    657   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  646    658   
            ))
  647    659   
            .set_query_double(::std::option::Option::Some(
  648    660   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  649    661   
            ))
  650    662   
            .send()
  651    663   
            .await;
  652    664   
        let _ = dbg!(result);
  653    665   
        let http_request = request_receiver.expect_request();
  654    666   
        let expected_query_params = &["Float=-Infinity", "Double=-Infinity"];
  655    667   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  656    668   
        let body = http_request.body().bytes().expect("body should be strict");
  657    669   
        // No body.
  658    670   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  659    671   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  660    672   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  661    673   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  662    674   
    }
  663    675   
  664    676   
    /// Query values of 0 and false are serialized
  665    677   
    /// Test ID: RestXmlZeroAndFalseQueryValues
  666    678   
    #[::tokio::test]
  667    679   
    #[::tracing_test::traced_test]
  668    680   
    async fn rest_xml_zero_and_false_query_values_request() {
  669    681   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  670    682   
        let config_builder = crate::config::Config::builder()
  671    683   
            .with_test_defaults()
  672         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         684  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         685  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         686  +
            .allow_no_auth()
  673    687   
            .endpoint_url("https://example.com");
  674    688   
  675    689   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  676    690   
        let result = client
  677    691   
            .all_query_string_types()
  678    692   
            .set_query_integer(::std::option::Option::Some(0))
  679    693   
            .set_query_boolean(::std::option::Option::Some(false))
  680    694   
            .send()
  681    695   
            .await;
  682    696   
        let _ = dbg!(result);

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

@@ -216,216 +276,278 @@
  236    236   
mod body_with_xml_name_test {
  237    237   
  238    238   
    /// Serializes a payload using a wrapper name based on the xmlName
  239    239   
    /// Test ID: BodyWithXmlName
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn body_with_xml_name_request() {
  243    243   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    244   
        let config_builder = crate::config::Config::builder()
  245    245   
            .with_test_defaults()
  246         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         246  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         247  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         248  +
            .allow_no_auth()
  247    249   
            .endpoint_url("https://example.com");
  248    250   
  249    251   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    252   
        let result = client
  251    253   
            .body_with_xml_name()
  252    254   
            .set_nested(::std::option::Option::Some(
  253    255   
                crate::types::PayloadWithXmlName::builder()
  254    256   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  255    257   
                    .build(),
  256    258   
            ))

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

@@ -239,239 +330,334 @@
  259    259   
mod constant_and_variable_query_string_test {
  260    260   
  261    261   
    /// Mixes constant and variable query string parameters
  262    262   
    /// Test ID: ConstantAndVariableQueryStringMissingOneValue
  263    263   
    #[::tokio::test]
  264    264   
    #[::tracing_test::traced_test]
  265    265   
    async fn constant_and_variable_query_string_missing_one_value_request() {
  266    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  267    267   
        let config_builder = crate::config::Config::builder()
  268    268   
            .with_test_defaults()
  269         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         269  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         270  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         271  +
            .allow_no_auth()
  270    272   
            .endpoint_url("https://example.com");
  271    273   
  272    274   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  273    275   
        let result = client
  274    276   
            .constant_and_variable_query_string()
  275    277   
            .set_baz(::std::option::Option::Some("bam".to_owned()))
  276    278   
            .send()
  277    279   
            .await;
  278    280   
        let _ = dbg!(result);
  279    281   
        let http_request = request_receiver.expect_request();
  280    282   
        let expected_query_params = &["foo=bar", "baz=bam"];
  281    283   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  282    284   
        let forbid_params = &["maybeSet"];
  283    285   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_query_params(&http_request, forbid_params));
  284    286   
        let body = http_request.body().bytes().expect("body should be strict");
  285    287   
        // No body.
  286    288   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  287    289   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  288    290   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  289    291   
        ::pretty_assertions::assert_eq!(uri.path(), "/ConstantAndVariableQueryString", "path was incorrect");
  290    292   
    }
  291    293   
  292    294   
    /// Mixes constant and variable query string parameters
  293    295   
    /// Test ID: ConstantAndVariableQueryStringAllValues
  294    296   
    #[::tokio::test]
  295    297   
    #[::tracing_test::traced_test]
  296    298   
    async fn constant_and_variable_query_string_all_values_request() {
  297    299   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  298    300   
        let config_builder = crate::config::Config::builder()
  299    301   
            .with_test_defaults()
  300         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         302  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         303  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         304  +
            .allow_no_auth()
  301    305   
            .endpoint_url("https://example.com");
  302    306   
  303    307   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  304    308   
        let result = client
  305    309   
            .constant_and_variable_query_string()
  306    310   
            .set_baz(::std::option::Option::Some("bam".to_owned()))
  307    311   
            .set_maybe_set(::std::option::Option::Some("yes".to_owned()))
  308    312   
            .send()
  309    313   
            .await;
  310    314   
        let _ = dbg!(result);

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

@@ -239,239 +299,301 @@
  259    259   
mod constant_query_string_test {
  260    260   
  261    261   
    /// Includes constant query string parameters
  262    262   
    /// Test ID: ConstantQueryString
  263    263   
    #[::tokio::test]
  264    264   
    #[::tracing_test::traced_test]
  265    265   
    async fn constant_query_string_request() {
  266    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  267    267   
        let config_builder = crate::config::Config::builder()
  268    268   
            .with_test_defaults()
  269         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         269  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         270  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         271  +
            .allow_no_auth()
  270    272   
            .endpoint_url("https://example.com");
  271    273   
  272    274   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  273    275   
        let result = client
  274    276   
            .constant_query_string()
  275    277   
            .set_hello(::std::option::Option::Some("hi".to_owned()))
  276    278   
            .send()
  277    279   
            .await;
  278    280   
        let _ = dbg!(result);
  279    281   
        let http_request = request_receiver.expect_request();

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

@@ -218,218 +278,280 @@
  238    238   
mod empty_input_and_empty_output_test {
  239    239   
  240    240   
    /// Empty input serializes no payload
  241    241   
    /// Test ID: EmptyInputAndEmptyOutput
  242    242   
    #[::tokio::test]
  243    243   
    #[::tracing_test::traced_test]
  244    244   
    async fn empty_input_and_empty_output_request() {
  245    245   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  246    246   
        let config_builder = crate::config::Config::builder()
  247    247   
            .with_test_defaults()
  248         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         248  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         249  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         250  +
            .allow_no_auth()
  249    251   
            .endpoint_url("https://example.com");
  250    252   
  251    253   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  252    254   
        let result = client.empty_input_and_empty_output().send().await;
  253    255   
        let _ = dbg!(result);
  254    256   
        let http_request = request_receiver.expect_request();
  255    257   
        let body = http_request.body().bytes().expect("body should be strict");
  256    258   
        // No body.
  257    259   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  258    260   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

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

@@ -224,224 +284,286 @@
  244    244   
  245    245   
    /// Operations can prepend to the given host if they define the
  246    246   
    /// endpoint trait.
  247    247   
    /// Test ID: RestXmlEndpointTrait
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_xml_endpoint_trait_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client.endpoint_operation().send().await;
  259    261   
        let _ = dbg!(result);
  260    262   
        let http_request = request_receiver.expect_request();
  261    263   
        let body = http_request.body().bytes().expect("body should be strict");
  262    264   
        // No body.
  263    265   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  264    266   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

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

@@ -246,246 +306,308 @@
  266    266   
    /// further customization based on user input. The label must also
  267    267   
    /// be serialized in into any other location it is bound to, such
  268    268   
    /// as the body or in this case an http header.
  269    269   
    /// Test ID: RestXmlEndpointTraitWithHostLabelAndHttpBinding
  270    270   
    #[::tokio::test]
  271    271   
    #[::tracing_test::traced_test]
  272    272   
    async fn rest_xml_endpoint_trait_with_host_label_and_http_binding_request() {
  273    273   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  274    274   
        let config_builder = crate::config::Config::builder()
  275    275   
            .with_test_defaults()
  276         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         276  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         277  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         278  +
            .allow_no_auth()
  277    279   
            .endpoint_url("https://example.com");
  278    280   
  279    281   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  280    282   
        let result = client
  281    283   
            .endpoint_with_host_label_header_operation()
  282    284   
            .set_account_id(::std::option::Option::Some("bar".to_owned()))
  283    285   
            .send()
  284    286   
            .await;
  285    287   
        let _ = dbg!(result);
  286    288   
        let http_request = request_receiver.expect_request();

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

@@ -244,244 +304,306 @@
  264    264   
    /// Operations can prepend to the given host if they define the
  265    265   
    /// endpoint trait, and can use the host label trait to define
  266    266   
    /// further customization based on user input.
  267    267   
    /// Test ID: RestXmlEndpointTraitWithHostLabel
  268    268   
    #[::tokio::test]
  269    269   
    #[::tracing_test::traced_test]
  270    270   
    async fn rest_xml_endpoint_trait_with_host_label_request() {
  271    271   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  272    272   
        let config_builder = crate::config::Config::builder()
  273    273   
            .with_test_defaults()
  274         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         274  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         275  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         276  +
            .allow_no_auth()
  275    277   
            .endpoint_url("https://example.com");
  276    278   
  277    279   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  278    280   
        let result = client
  279    281   
            .endpoint_with_host_label_operation()
  280    282   
            .set_label(::std::option::Option::Some("bar".to_owned()))
  281    283   
            .send()
  282    284   
            .await;
  283    285   
        let _ = dbg!(result);
  284    286   
        let http_request = request_receiver.expect_request();

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

@@ -216,216 +276,278 @@
  236    236   
mod flattened_xml_map_test {
  237    237   
  238    238   
    /// Serializes flattened XML maps in requests
  239    239   
    /// Test ID: FlattenedXmlMap
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn flattened_xml_map_request() {
  243    243   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    244   
        let config_builder = crate::config::Config::builder()
  245    245   
            .with_test_defaults()
  246         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         246  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         247  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         248  +
            .allow_no_auth()
  247    249   
            .endpoint_url("https://example.com");
  248    250   
  249    251   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    252   
        let result = client
  251    253   
            .flattened_xml_map()
  252    254   
            .set_my_map(::std::option::Option::Some({
  253    255   
                let mut ret = ::std::collections::HashMap::new();
  254    256   
                ret.insert(
  255    257   
                    "foo".to_owned(),
  256    258   
                    "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),

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

@@ -224,224 +284,286 @@
  244    244   
mod flattened_xml_map_with_xml_name_test {
  245    245   
  246    246   
    /// Serializes flattened XML maps in requests that have xmlName on members
  247    247   
    /// Test ID: FlattenedXmlMapWithXmlName
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn flattened_xml_map_with_xml_name_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .flattened_xml_map_with_xml_name()
  260    262   
            .set_my_map(::std::option::Option::Some({
  261    263   
                let mut ret = ::std::collections::HashMap::new();
  262    264   
                ret.insert("a".to_owned(), "A".to_owned());
  263    265   
                ret.insert("b".to_owned(), "B".to_owned());
  264    266   
                ret