Client Test

Client Test

rev. 26e0a1e8aaec58e3c7fd18a79449d71bcadaf391

Files changed:

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

@@ -350,350 +409,425 @@
  370    370   
  371    371   
    /// Set the auth scheme resolver for the builder
  372    372   
    ///
  373    373   
    /// # Examples
  374    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  375    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  376    376   
        self.runtime_components
  377    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  378    378   
        self
  379    379   
    }
         380  +
         381  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         382  +
    ///
         383  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         384  +
    pub fn allow_no_auth(mut self) -> Self {
         385  +
        self.set_allow_no_auth();
         386  +
        self
         387  +
    }
         388  +
         389  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         390  +
    ///
         391  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         392  +
    pub fn set_allow_no_auth(&mut self) -> &mut Self {
         393  +
        self.push_runtime_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePluginV2::new().into_shared());
         394  +
        self
         395  +
    }
  380    396   
    /// Set the auth scheme preference for an auth scheme resolver
  381    397   
    /// (typically the default auth scheme resolver).
  382    398   
    ///
  383    399   
    /// Each operation has a predefined order of auth schemes, as determined by the service,
  384    400   
    /// for auth scheme resolution. By using the auth scheme preference, customers
  385    401   
    /// can reorder the schemes resolved by the auth scheme resolver.
  386    402   
    ///
  387    403   
    /// The preference list is intended as a hint rather than a strict override.
  388    404   
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
  389    405   
    ///
@@ -1208,1224 +1268,1285 @@
 1228   1244   
    {
 1229   1245   
        if config.behavior_version.is_none() {
 1230   1246   
            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
 1231   1247   
        }
 1232   1248   
    }
 1233   1249   
 1234   1250   
    let default_retry_partition = "testservice";
 1235   1251   
 1236   1252   
    let scope = "endpoint-rules";
 1237   1253   
 1238         -
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
        1254  +
    #[allow(deprecated)]
        1255  +
                    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1239   1256   
                        // defaults
 1240   1257   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1241   1258   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1242   1259   
                                .with_retry_partition_name(default_retry_partition)
 1243   1260   
                                .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."))
 1244   1261   
                        ))
 1245   1262   
                        // user config
 1246   1263   
                        .with_client_plugin(
 1247   1264   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1248   1265   
                                .with_config(config.config.clone())

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

@@ -350,350 +409,425 @@
  370    370   
  371    371   
    /// Set the auth scheme resolver for the builder
  372    372   
    ///
  373    373   
    /// # Examples
  374    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  375    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  376    376   
        self.runtime_components
  377    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  378    378   
        self
  379    379   
    }
         380  +
         381  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         382  +
    ///
         383  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         384  +
    pub fn allow_no_auth(mut self) -> Self {
         385  +
        self.set_allow_no_auth();
         386  +
        self
         387  +
    }
         388  +
         389  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         390  +
    ///
         391  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         392  +
    pub fn set_allow_no_auth(&mut self) -> &mut Self {
         393  +
        self.push_runtime_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePluginV2::new().into_shared());
         394  +
        self
         395  +
    }
  380    396   
    /// Set the auth scheme preference for an auth scheme resolver
  381    397   
    /// (typically the default auth scheme resolver).
  382    398   
    ///
  383    399   
    /// Each operation has a predefined order of auth schemes, as determined by the service,
  384    400   
    /// for auth scheme resolution. By using the auth scheme preference, customers
  385    401   
    /// can reorder the schemes resolved by the auth scheme resolver.
  386    402   
    ///
  387    403   
    /// The preference list is intended as a hint rather than a strict override.
  388    404   
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
  389    405   
    ///
@@ -1196,1212 +1256,1273 @@
 1216   1232   
    {
 1217   1233   
        if config.behavior_version.is_none() {
 1218   1234   
            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
 1219   1235   
        }
 1220   1236   
    }
 1221   1237   
 1222   1238   
    let default_retry_partition = "jsonrpc10";
 1223   1239   
 1224   1240   
    let scope = "json_rpc10";
 1225   1241   
 1226         -
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
        1242  +
    #[allow(deprecated)]
        1243  +
                    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1227   1244   
                        // defaults
 1228   1245   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1229   1246   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1230   1247   
                                .with_retry_partition_name(default_retry_partition)
 1231   1248   
                                .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."))
 1232   1249   
                        ))
 1233   1250   
                        // user config
 1234   1251   
                        .with_client_plugin(
 1235   1252   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1236   1253   
                                .with_config(config.config.clone())

tmp-codegen-diff/codegen-client-test/json_rpc10/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/json_rpc10/rust-client-codegen/src/operation/empty_input_and_empty_output.rs

@@ -226,226 +286,288 @@
  246    246   
mod empty_input_and_empty_output_test {
  247    247   
  248    248   
    /// Clients must always send an empty object if input is modeled.
  249    249   
    /// Test ID: AwsJson10EmptyInputAndEmptyOutput
  250    250   
    #[::tokio::test]
  251    251   
    #[::tracing_test::traced_test]
  252    252   
    async fn aws_json10_empty_input_and_empty_output_request() {
  253    253   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  254    254   
        let config_builder = crate::config::Config::builder()
  255    255   
            .with_test_defaults()
  256         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         256  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         257  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         258  +
            .allow_no_auth()
  257    259   
            .endpoint_url("https://example.com");
  258    260   
  259    261   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  260    262   
        let result = client.empty_input_and_empty_output().send().await;
  261    263   
        let _ = dbg!(result);
  262    264   
        let http_request = request_receiver.expect_request();
  263    265   
        let expected_headers = [
  264    266   
            ("Content-Type", "application/x-amz-json-1.0"),
  265    267   
            ("X-Amz-Target", "JsonRpc10.EmptyInputAndEmptyOutput"),
  266    268   
        ];

tmp-codegen-diff/codegen-client-test/json_rpc10/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: AwsJson10EndpointTrait
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn aws_json10_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   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  263    265   
            body,
  264    266   
            "{}",

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

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

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

@@ -220,220 +280,282 @@
  240    240   
mod host_with_path_operation_test {
  241    241   
  242    242   
    /// Custom endpoints supplied by users can have paths
  243    243   
    /// Test ID: AwsJson10HostWithPath
  244    244   
    #[::tokio::test]
  245    245   
    #[::tracing_test::traced_test]
  246    246   
    async fn aws_json10_host_with_path_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com/custom");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client.host_with_path_operation().send().await;
  255    257   
        let _ = dbg!(result);
  256    258   
        let http_request = request_receiver.expect_request();
  257    259   
        let body = http_request.body().bytes().expect("body should be strict");
  258    260   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  259    261   
            body,
  260    262   
            "{}",

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

@@ -216,216 +578,598 @@
  236    236   
mod json_unions_test {
  237    237   
  238    238   
    /// Serializes a string union value
  239    239   
    /// Test ID: AwsJson10SerializeStringUnionValue
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn aws_json10_serialize_string_union_value_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   
            .json_unions()
  252    254   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StringValue("foo".to_owned())))
  253    255   
            .send()
  254    256   
            .await;
  255    257   
        let _ = dbg!(result);
  256    258   
        let http_request = request_receiver.expect_request();
  257    259   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  258    260   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  259    261   
        let body = http_request.body().bytes().expect("body should be strict");
  260    262   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  261    263   
            body,
  262    264   
            "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}",
  263    265   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  264    266   
        ));
  265    267   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  266    268   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  267    269   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  268    270   
    }
  269    271   
  270    272   
    /// Serializes a boolean union value
  271    273   
    /// Test ID: AwsJson10SerializeBooleanUnionValue
  272    274   
    #[::tokio::test]
  273    275   
    #[::tracing_test::traced_test]
  274    276   
    async fn aws_json10_serialize_boolean_union_value_request() {
  275    277   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  276    278   
        let config_builder = crate::config::Config::builder()
  277    279   
            .with_test_defaults()
  278         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         280  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         281  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         282  +
            .allow_no_auth()
  279    283   
            .endpoint_url("https://example.com");
  280    284   
  281    285   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  282    286   
        let result = client
  283    287   
            .json_unions()
  284    288   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
  285    289   
            .send()
  286    290   
            .await;
  287    291   
        let _ = dbg!(result);
  288    292   
        let http_request = request_receiver.expect_request();
  289    293   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  290    294   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  291    295   
        let body = http_request.body().bytes().expect("body should be strict");
  292    296   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  293    297   
            body,
  294    298   
            "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
  295    299   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  296    300   
        ));
  297    301   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  298    302   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  299    303   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  300    304   
    }
  301    305   
  302    306   
    /// Serializes a number union value
  303    307   
    /// Test ID: AwsJson10SerializeNumberUnionValue
  304    308   
    #[::tokio::test]
  305    309   
    #[::tracing_test::traced_test]
  306    310   
    async fn aws_json10_serialize_number_union_value_request() {
  307    311   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  308    312   
        let config_builder = crate::config::Config::builder()
  309    313   
            .with_test_defaults()
  310         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         314  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         315  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         316  +
            .allow_no_auth()
  311    317   
            .endpoint_url("https://example.com");
  312    318   
  313    319   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  314    320   
        let result = client
  315    321   
            .json_unions()
  316    322   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
  317    323   
            .send()
  318    324   
            .await;
  319    325   
        let _ = dbg!(result);
  320    326   
        let http_request = request_receiver.expect_request();
  321    327   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  322    328   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  323    329   
        let body = http_request.body().bytes().expect("body should be strict");
  324    330   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  325    331   
            body,
  326    332   
            "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
  327    333   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  328    334   
        ));
  329    335   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  330    336   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  331    337   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  332    338   
    }
  333    339   
  334    340   
    /// Serializes a blob union value
  335    341   
    /// Test ID: AwsJson10SerializeBlobUnionValue
  336    342   
    #[::tokio::test]
  337    343   
    #[::tracing_test::traced_test]
  338    344   
    async fn aws_json10_serialize_blob_union_value_request() {
  339    345   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  340    346   
        let config_builder = crate::config::Config::builder()
  341    347   
            .with_test_defaults()
  342         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         348  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         349  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         350  +
            .allow_no_auth()
  343    351   
            .endpoint_url("https://example.com");
  344    352   
  345    353   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  346    354   
        let result = client
  347    355   
            .json_unions()
  348    356   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
  349    357   
                ::aws_smithy_types::Blob::new("foo"),
  350    358   
            )))
  351    359   
            .send()
  352    360   
            .await;
  353    361   
        let _ = dbg!(result);
  354    362   
        let http_request = request_receiver.expect_request();
  355    363   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  356    364   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  357    365   
        let body = http_request.body().bytes().expect("body should be strict");
  358    366   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  359    367   
            body,
  360    368   
            "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
  361    369   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  362    370   
        ));
  363    371   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  364    372   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  365    373   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  366    374   
    }
  367    375   
  368    376   
    /// Serializes a timestamp union value
  369    377   
    /// Test ID: AwsJson10SerializeTimestampUnionValue
  370    378   
    #[::tokio::test]
  371    379   
    #[::tracing_test::traced_test]
  372    380   
    async fn aws_json10_serialize_timestamp_union_value_request() {
  373    381   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  374    382   
        let config_builder = crate::config::Config::builder()
  375    383   
            .with_test_defaults()
  376         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         384  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         385  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         386  +
            .allow_no_auth()
  377    387   
            .endpoint_url("https://example.com");
  378    388   
  379    389   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  380    390   
        let result = client
  381    391   
            .json_unions()
  382    392   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
  383    393   
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
  384    394   
            )))
  385    395   
            .send()
  386    396   
            .await;
  387    397   
        let _ = dbg!(result);
  388    398   
        let http_request = request_receiver.expect_request();
  389    399   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  390    400   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  391    401   
        let body = http_request.body().bytes().expect("body should be strict");
  392    402   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  393    403   
            body,
  394    404   
            "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
  395    405   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  396    406   
        ));
  397    407   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  398    408   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  399    409   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  400    410   
    }
  401    411   
  402    412   
    /// Serializes an enum union value
  403    413   
    /// Test ID: AwsJson10SerializeEnumUnionValue
  404    414   
    #[::tokio::test]
  405    415   
    #[::tracing_test::traced_test]
  406    416   
    async fn aws_json10_serialize_enum_union_value_request() {
  407    417   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  408    418   
        let config_builder = crate::config::Config::builder()
  409    419   
            .with_test_defaults()
  410         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         420  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         421  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         422  +
            .allow_no_auth()
  411    423   
            .endpoint_url("https://example.com");
  412    424   
  413    425   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  414    426   
        let result = client
  415    427   
            .json_unions()
  416    428   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
  417    429   
                "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  418    430   
            )))
  419    431   
            .send()
  420    432   
            .await;
  421    433   
        let _ = dbg!(result);
  422    434   
        let http_request = request_receiver.expect_request();
  423    435   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  424    436   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  425    437   
        let body = http_request.body().bytes().expect("body should be strict");
  426    438   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  427    439   
            body,
  428    440   
            "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
  429    441   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  430    442   
        ));
  431    443   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  432    444   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  433    445   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  434    446   
    }
  435    447   
  436    448   
    /// Serializes an intEnum union value
  437    449   
    /// Test ID: AwsJson10SerializeIntEnumUnionValue
  438    450   
    #[::tokio::test]
  439    451   
    #[::tracing_test::traced_test]
  440    452   
    async fn aws_json10_serialize_int_enum_union_value_request() {
  441    453   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  442    454   
        let config_builder = crate::config::Config::builder()
  443    455   
            .with_test_defaults()
  444         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         456  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         457  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         458  +
            .allow_no_auth()
  445    459   
            .endpoint_url("https://example.com");
  446    460   
  447    461   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  448    462   
        let result = client
  449    463   
            .json_unions()
  450    464   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::IntEnumValue(1)))
  451    465   
            .send()
  452    466   
            .await;
  453    467   
        let _ = dbg!(result);
  454    468   
        let http_request = request_receiver.expect_request();
  455    469   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  456    470   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  457    471   
        let body = http_request.body().bytes().expect("body should be strict");
  458    472   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  459    473   
            body,
  460    474   
            "{\n    \"contents\": {\n        \"intEnumValue\": 1\n    }\n}",
  461    475   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  462    476   
        ));
  463    477   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  464    478   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  465    479   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  466    480   
    }
  467    481   
  468    482   
    /// Serializes a list union value
  469    483   
    /// Test ID: AwsJson10SerializeListUnionValue
  470    484   
    #[::tokio::test]
  471    485   
    #[::tracing_test::traced_test]
  472    486   
    async fn aws_json10_serialize_list_union_value_request() {
  473    487   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  474    488   
        let config_builder = crate::config::Config::builder()
  475    489   
            .with_test_defaults()
  476         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         490  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         491  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         492  +
            .allow_no_auth()
  477    493   
            .endpoint_url("https://example.com");
  478    494   
  479    495   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  480    496   
        let result = client
  481    497   
            .json_unions()
  482    498   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
  483    499   
                "foo".to_owned(),
  484    500   
                "bar".to_owned(),
  485    501   
            ])))
  486    502   
            .send()
  487    503   
            .await;
  488    504   
        let _ = dbg!(result);
  489    505   
        let http_request = request_receiver.expect_request();
  490    506   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  491    507   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  492    508   
        let body = http_request.body().bytes().expect("body should be strict");
  493    509   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  494    510   
            body,
  495    511   
            "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
  496    512   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  497    513   
        ));
  498    514   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  499    515   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  500    516   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  501    517   
    }
  502    518   
  503    519   
    /// Serializes a map union value
  504    520   
    /// Test ID: AwsJson10SerializeMapUnionValue
  505    521   
    #[::tokio::test]
  506    522   
    #[::tracing_test::traced_test]
  507    523   
    async fn aws_json10_serialize_map_union_value_request() {
  508    524   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  509    525   
        let config_builder = crate::config::Config::builder()
  510    526   
            .with_test_defaults()
  511         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         527  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         528  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         529  +
            .allow_no_auth()
  512    530   
            .endpoint_url("https://example.com");
  513    531   
  514    532   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  515    533   
        let result = client
  516    534   
            .json_unions()
  517    535   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
  518    536   
                let mut ret = ::std::collections::HashMap::new();
  519    537   
                ret.insert("foo".to_owned(), "bar".to_owned());
  520    538   
                ret.insert("spam".to_owned(), "eggs".to_owned());
  521    539   
                ret
  522    540   
            })))
  523    541   
            .send()
  524    542   
            .await;
  525    543   
        let _ = dbg!(result);
  526    544   
        let http_request = request_receiver.expect_request();
  527    545   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0"), ("X-Amz-Target", "JsonRpc10.JsonUnions")];
  528    546   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  529    547   
        let body = http_request.body().bytes().expect("body should be strict");
  530    548   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  531    549   
            body,
  532    550   
            "{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}",
  533    551   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  534    552   
        ));
  535    553   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  536    554   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  537    555   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  538    556   
    }
  539    557   
  540    558   
    /// Serializes a structure union value
  541    559   
    /// Test ID: AwsJson10SerializeStructureUnionValue
  542    560   
    #[::tokio::test]
  543    561   
    #[::tracing_test::traced_test]
  544    562   
    async fn aws_json10_serialize_structure_union_value_request() {
  545    563   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  546    564   
        let config_builder = crate::config::Config::builder()
  547    565   
            .with_test_defaults()
  548         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         566  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         567  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         568  +
            .allow_no_auth()
  549    569   
            .endpoint_url("https://example.com");
  550    570   
  551    571   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  552    572   
        let result = client
  553    573   
            .json_unions()
  554    574   
            .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
  555    575   
                crate::types::GreetingStruct::builder()
  556    576   
                    .set_hi(::std::option::Option::Some("hello".to_owned()))
  557    577   
                    .build(),
  558    578   
            )))

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

@@ -225,225 +285,287 @@
  245    245   
    /// that send `{}`, always sending `{}` from the client is
  246    246   
    /// preferred for forward compatibility in case input is ever
  247    247   
    /// added to an operation.
  248    248   
    /// Test ID: AwsJson10MustAlwaysSendEmptyJsonPayload
  249    249   
    #[::tokio::test]
  250    250   
    #[::tracing_test::traced_test]
  251    251   
    async fn aws_json10_must_always_send_empty_json_payload_request() {
  252    252   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  253    253   
        let config_builder = crate::config::Config::builder()
  254    254   
            .with_test_defaults()
  255         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         255  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         256  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         257  +
            .allow_no_auth()
  256    258   
            .endpoint_url("https://example.com");
  257    259   
  258    260   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  259    261   
        let result = client.no_input_and_no_output().send().await;
  260    262   
        let _ = dbg!(result);
  261    263   
        let http_request = request_receiver.expect_request();
  262    264   
        let expected_headers = [
  263    265   
            ("Content-Type", "application/x-amz-json-1.0"),
  264    266   
            ("X-Amz-Target", "JsonRpc10.NoInputAndNoOutput"),
  265    267   
        ];

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

@@ -218,218 +278,280 @@
  238    238   
mod no_input_and_output_test {
  239    239   
  240    240   
    /// A client should always send and empty JSON object payload.
  241    241   
    /// Test ID: AwsJson10NoInputAndOutput
  242    242   
    #[::tokio::test]
  243    243   
    #[::tracing_test::traced_test]
  244    244   
    async fn aws_json10_no_input_and_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.no_input_and_output().send().await;
  253    255   
        let _ = dbg!(result);
  254    256   
        let http_request = request_receiver.expect_request();
  255    257   
        let expected_headers = [
  256    258   
            ("Content-Type", "application/x-amz-json-1.0"),
  257    259   
            ("X-Amz-Target", "JsonRpc10.NoInputAndOutput"),
  258    260   
        ];

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

@@ -225,225 +344,350 @@
  245    245   
  246    246   
    /// Client populates default values in input.
  247    247   
    /// Test ID: AwsJson10ClientPopulatesDefaultValuesInInput
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    #[should_panic]
  251    251   
    async fn aws_json10_client_populates_default_values_in_input_request() {
  252    252   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  253    253   
        let config_builder = crate::config::Config::builder()
  254    254   
            .with_test_defaults()
  255         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         255  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         256  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         257  +
            .allow_no_auth()
  256    258   
            .endpoint_url("https://example.com");
  257    259   
  258    260   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  259    261   
        let result = client
  260    262   
            .operation_with_defaults()
  261    263   
            .set_defaults(::std::option::Option::Some(crate::types::Defaults::builder().build()))
  262    264   
            .send()
  263    265   
            .await;
  264    266   
        let _ = dbg!(result);
  265    267   
        let http_request = request_receiver.expect_request();
  266    268   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  268    270   
        let body = http_request.body().bytes().expect("body should be strict");
  269    271   
        ::aws_smithy_protocol_test::assert_ok(
  270    272   
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"defaults\": {\n        \"defaultString\": \"hi\",\n        \"defaultBoolean\": true,\n        \"defaultList\": [],\n        \"defaultDocumentMap\": {},\n        \"defaultDocumentString\": \"hi\",\n        \"defaultDocumentBoolean\": true,\n        \"defaultDocumentList\": [],\n        \"defaultTimestamp\": 0,\n        \"defaultBlob\": \"YWJj\",\n        \"defaultByte\": 1,\n        \"defaultShort\": 1,\n        \"defaultInteger\": 10,\n        \"defaultLong\": 100,\n        \"defaultFloat\": 1.0,\n        \"defaultDouble\": 1.0,\n        \"defaultMap\": {},\n        \"defaultEnum\": \"FOO\",\n        \"defaultIntEnum\": 1,\n        \"emptyString\": \"\",\n        \"falseBoolean\": false,\n        \"emptyBlob\": \"\",\n        \"zeroByte\": 0,\n        \"zeroShort\": 0,\n        \"zeroInteger\": 0,\n        \"zeroLong\": 0,\n        \"zeroFloat\": 0.0,\n        \"zeroDouble\": 0.0\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  271    273   
        );
  272    274   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  273    275   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  274    276   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  275    277   
    }
  276    278   
  277    279   
    /// Client skips top level default values in input.
  278    280   
    /// Test ID: AwsJson10ClientSkipsTopLevelDefaultValuesInInput
  279    281   
    #[::tokio::test]
  280    282   
    #[::tracing_test::traced_test]
  281    283   
    async fn aws_json10_client_skips_top_level_default_values_in_input_request() {
  282    284   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  283    285   
        let config_builder = crate::config::Config::builder()
  284    286   
            .with_test_defaults()
  285         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         287  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         288  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         289  +
            .allow_no_auth()
  286    290   
            .endpoint_url("https://example.com");
  287    291   
  288    292   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  289    293   
        let result = client.operation_with_defaults().send().await;
  290    294   
        let _ = dbg!(result);
  291    295   
        let http_request = request_receiver.expect_request();
  292    296   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  293    297   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  294    298   
        let body = http_request.body().bytes().expect("body should be strict");
  295    299   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  296    300   
            body,
  297    301   
            "{\n}",
  298    302   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  299    303   
        ));
  300    304   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  301    305   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  302    306   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  303    307   
    }
  304    308   
  305    309   
    /// Client uses explicitly provided member values over defaults
  306    310   
    /// Test ID: AwsJson10ClientUsesExplicitlyProvidedMemberValuesOverDefaults
  307    311   
    #[::tokio::test]
  308    312   
    #[::tracing_test::traced_test]
  309    313   
    #[should_panic]
  310    314   
    async fn aws_json10_client_uses_explicitly_provided_member_values_over_defaults_request() {
  311    315   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  312    316   
        let config_builder = crate::config::Config::builder()
  313    317   
            .with_test_defaults()
  314         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         318  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         319  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         320  +
            .allow_no_auth()
  315    321   
            .endpoint_url("https://example.com");
  316    322   
  317    323   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  318    324   
        let result = client
  319    325   
            .operation_with_defaults()
  320    326   
            .set_defaults(::std::option::Option::Some(
  321    327   
                crate::types::Defaults::builder()
  322    328   
                    .set_default_string(::std::option::Option::Some("bye".to_owned()))
  323    329   
                    .set_default_boolean(::std::option::Option::Some(true))
  324    330   
                    .set_default_list(::std::option::Option::Some(vec!["a".to_owned()]))
@@ -375,381 +468,478 @@
  395    401   
    }
  396    402   
  397    403   
    /// Any time a value is provided for a member in the top level of input, it is used, regardless of if its the default.
  398    404   
    /// Test ID: AwsJson10ClientUsesExplicitlyProvidedValuesInTopLevel
  399    405   
    #[::tokio::test]
  400    406   
    #[::tracing_test::traced_test]
  401    407   
    async fn aws_json10_client_uses_explicitly_provided_values_in_top_level_request() {
  402    408   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  403    409   
        let config_builder = crate::config::Config::builder()
  404    410   
            .with_test_defaults()
  405         -
            .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()
  406    414   
            .endpoint_url("https://example.com");
  407    415   
  408    416   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  409    417   
        let result = client
  410    418   
            .operation_with_defaults()
  411    419   
            .set_top_level_default(::std::option::Option::Some("hi".to_owned()))
  412    420   
            .set_other_top_level_default(::std::option::Option::Some(0))
  413    421   
            .send()
  414    422   
            .await;
  415    423   
        let _ = dbg!(result);
  416    424   
        let http_request = request_receiver.expect_request();
  417    425   
        let expected_headers = [("Content-Type", "application/x-amz-json-1.0")];
  418    426   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  419    427   
        let body = http_request.body().bytes().expect("body should be strict");
  420    428   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  421    429   
            body,
  422    430   
            "{\n    \"topLevelDefault\": \"hi\",\n    \"otherTopLevelDefault\": 0\n}",
  423    431   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  424    432   
        ));
  425    433   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  426    434   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  427    435   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  428    436   
    }
  429    437   
  430    438   
    /// Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored.
  431    439   
    /// Test ID: AwsJson10ClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional
  432    440   
    #[::tokio::test]
  433    441   
    #[::tracing_test::traced_test]
  434    442   
    async fn aws_json10_client_ignores_non_top_level_defaults_on_members_with_client_optional_request() {
  435    443   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  436    444   
        let config_builder = crate::config::Config::builder()
  437    445   
            .with_test_defaults()
  438         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         446  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         447  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         448  +
            .allow_no_auth()
  439    449   
            .endpoint_url("https://example.com");
  440    450   
  441    451   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  442    452   
        let result = client
  443    453   
            .operation_with_defaults()
  444    454   
            .set_client_optional_defaults(::std::option::Option::Some(crate::types::ClientOptionalDefaults::builder().build()))
  445    455   
            .send()
  446    456   
            .await;
  447    457   
        let _ = dbg!(result);
  448    458   
        let http_request = request_receiver.expect_request();

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

@@ -229,229 +289,291 @@
  249    249   
mod operation_with_nested_structure_test {
  250    250   
  251    251   
    /// Client populates nested default values when missing.
  252    252   
    /// Test ID: AwsJson10ClientPopulatesNestedDefaultValuesWhenMissing
  253    253   
    #[::tokio::test]
  254    254   
    #[::tracing_test::traced_test]
  255    255   
    async fn aws_json10_client_populates_nested_default_values_when_missing_request() {
  256    256   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  257    257   
        let config_builder = crate::config::Config::builder()
  258    258   
            .with_test_defaults()
  259         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         259  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         260  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         261  +
            .allow_no_auth()
  260    262   
            .endpoint_url("https://example.com");
  261    263   
  262    264   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  263    265   
        let result = client
  264    266   
            .operation_with_nested_structure()
  265    267   
            .set_top_level(::std::option::Option::Some(
  266    268   
                crate::types::TopLevel::builder()
  267    269   
                    .set_dialog(::std::option::Option::Some(
  268    270   
                        crate::types::Dialog::builder()
  269    271   
                            .set_language(::std::option::Option::Some("en".to_owned()))

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

@@ -229,229 +320,324 @@
  249    249   
mod put_with_content_encoding_test {
  250    250   
  251    251   
    /// Compression algorithm encoding is appended to the Content-Encoding header.
  252    252   
    /// Test ID: SDKAppliedContentEncoding_awsJson1_0
  253    253   
    #[::tokio::test]
  254    254   
    #[::tracing_test::traced_test]
  255    255   
    async fn sdk_applied_content_encoding_aws_json1_0_request() {
  256    256   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  257    257   
        let config_builder = crate::config::Config::builder()
  258    258   
            .with_test_defaults()
  259         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         259  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         260  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         261  +
            .allow_no_auth()
  260    262   
            .endpoint_url("https://example.com");
  261    263   
  262    264   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  263    265   
        let result = client.put_with_content_encoding()
  264    266   
        .set_data(
  265    267   
            ::std::option::Option::Some(
  266    268   
                "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKU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rlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n".to_owned()
  267    269   
            )
  268    270   
        )
  269    271   
        .send().await;
  270    272   
        let _ = dbg!(result);
  271    273   
        let http_request = request_receiver.expect_request();
  272    274   
        let expected_headers = [("Content-Encoding", "gzip")];
  273    275   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  274    276   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  275    277   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  276    278   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  277    279   
    }
  278    280   
  279    281   
    /// Compression algorithm encoding is appended to the Content-Encoding header, and the
  280    282   
    /// user-provided content-encoding is NOT in the Content-Encoding header since HTTP binding
  281    283   
    /// traits are ignored in the awsJson1_0 protocol.
  282    284   
    ///
  283    285   
    /// Test ID: SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0
  284    286   
    #[::tokio::test]
  285    287   
    #[::tracing_test::traced_test]
  286    288   
    async fn sdk_appends_gzip_and_ignores_http_provided_encoding_aws_json1_0_request() {
  287    289   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  288    290   
        let config_builder = crate::config::Config::builder()
  289    291   
            .with_test_defaults()
  290         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         292  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         293  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         294  +
            .allow_no_auth()
  291    295   
            .endpoint_url("https://example.com");
  292    296   
  293    297   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  294    298   
        let result = client.put_with_content_encoding()
  295    299   
        .set_encoding(
  296    300   
            ::std::option::Option::Some(
  297    301   
                "custom".to_owned()
  298    302   
            )
  299    303   
        )
  300    304   
        .set_data(

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

@@ -226,226 +286,288 @@
  246    246   
mod query_incompatible_operation_test {
  247    247   
  248    248   
    /// The query mode header MUST NOT be set on non-query-compatible services.
  249    249   
    /// Test ID: NonQueryCompatibleAwsJson10ForbidsQueryModeHeader
  250    250   
    #[::tokio::test]
  251    251   
    #[::tracing_test::traced_test]
  252    252   
    async fn non_query_compatible_aws_json10_forbids_query_mode_header_request() {
  253    253   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  254    254   
        let config_builder = crate::config::Config::builder()
  255    255   
            .with_test_defaults()
  256         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         256  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         257  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         258  +
            .allow_no_auth()
  257    259   
            .endpoint_url("https://example.com");
  258    260   
  259    261   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  260    262   
        let result = client.query_incompatible_operation().send().await;
  261    263   
        let _ = dbg!(result);
  262    264   
        let http_request = request_receiver.expect_request();
  263    265   
        let expected_headers = [
  264    266   
            ("Content-Type", "application/x-amz-json-1.0"),
  265    267   
            ("X-Amz-Target", "JsonRpc10.QueryIncompatibleOperation"),
  266    268   
        ];

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

@@ -230,230 +370,376 @@
  250    250   
    use ::aws_smithy_protocol_test::FloatEquals;
  251    251   
  252    252   
    /// Supports handling NaN float values.
  253    253   
    /// Test ID: AwsJson10SupportsNaNFloatInputs
  254    254   
    #[::tokio::test]
  255    255   
    #[::tracing_test::traced_test]
  256    256   
    async fn aws_json10_supports_na_n_float_inputs_request() {
  257    257   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  258    258   
        let config_builder = crate::config::Config::builder()
  259    259   
            .with_test_defaults()
  260         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         260  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         261  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         262  +
            .allow_no_auth()
  261    263   
            .endpoint_url("https://example.com");
  262    264   
  263    265   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  264    266   
        let result = client
  265    267   
            .simple_scalar_properties()
  266    268   
            .set_float_value(::std::option::Option::Some(
  267    269   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  268    270   
            ))
  269    271   
            .set_double_value(::std::option::Option::Some(
  270    272   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  271    273   
            ))
  272    274   
            .send()
  273    275   
            .await;
  274    276   
        let _ = dbg!(result);
  275    277   
        let http_request = request_receiver.expect_request();
  276    278   
        let expected_headers = [
  277    279   
            ("Content-Type", "application/x-amz-json-1.0"),
  278    280   
            ("X-Amz-Target", "JsonRpc10.SimpleScalarProperties"),
  279    281   
        ];
  280    282   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  281    283   
        let body = http_request.body().bytes().expect("body should be strict");
  282    284   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  283    285   
            body,
  284    286   
            "{\n    \"floatValue\": \"NaN\",\n    \"doubleValue\": \"NaN\"\n}",
  285    287   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  286    288   
        ));
  287    289   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  288    290   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  289    291   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  290    292   
    }
  291    293   
  292    294   
    /// Supports handling Infinity float values.
  293    295   
    /// Test ID: AwsJson10SupportsInfinityFloatInputs
  294    296   
    #[::tokio::test]
  295    297   
    #[::tracing_test::traced_test]
  296    298   
    async fn aws_json10_supports_infinity_float_inputs_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   
            .simple_scalar_properties()
  306    310   
            .set_float_value(::std::option::Option::Some(
  307    311   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  308    312   
            ))
  309    313   
            .set_double_value(::std::option::Option::Some(
  310    314   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  311    315   
            ))
  312    316   
            .send()
  313    317   
            .await;
  314    318   
        let _ = dbg!(result);
  315    319   
        let http_request = request_receiver.expect_request();
  316    320   
        let expected_headers = [
  317    321   
            ("Content-Type", "application/x-amz-json-1.0"),
  318    322   
            ("X-Amz-Target", "JsonRpc10.SimpleScalarProperties"),
  319    323   
        ];
  320    324   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  321    325   
        let body = http_request.body().bytes().expect("body should be strict");
  322    326   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  323    327   
            body,
  324    328   
            "{\n    \"floatValue\": \"Infinity\",\n    \"doubleValue\": \"Infinity\"\n}",
  325    329   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  326    330   
        ));
  327    331   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  328    332   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  329    333   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  330    334   
    }
  331    335   
  332    336   
    /// Supports handling -Infinity float values.
  333    337   
    /// Test ID: AwsJson10SupportsNegativeInfinityFloatInputs
  334    338   
    #[::tokio::test]
  335    339   
    #[::tracing_test::traced_test]
  336    340   
    async fn aws_json10_supports_negative_infinity_float_inputs_request() {
  337    341   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  338    342   
        let config_builder = crate::config::Config::builder()
  339    343   
            .with_test_defaults()
  340         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         344  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         345  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         346  +
            .allow_no_auth()
  341    347   
            .endpoint_url("https://example.com");
  342    348   
  343    349   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  344    350   
        let result = client
  345    351   
            .simple_scalar_properties()
  346    352   
            .set_float_value(::std::option::Option::Some(
  347    353   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  348    354   
            ))
  349    355   
            .set_double_value(::std::option::Option::Some(
  350    356   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),

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

@@ -350,350 +409,425 @@
  370    370   
  371    371   
    /// Set the auth scheme resolver for the builder
  372    372   
    ///
  373    373   
    /// # Examples
  374    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  375    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  376    376   
        self.runtime_components
  377    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  378    378   
        self
  379    379   
    }
         380  +
         381  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         382  +
    ///
         383  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         384  +
    pub fn allow_no_auth(mut self) -> Self {
         385  +
        self.set_allow_no_auth();
         386  +
        self
         387  +
    }
         388  +
         389  +
    /// Add [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback for operations that don't require authentication
         390  +
    ///
         391  +
    /// The auth scheme resolver will use this when no other auth schemes are applicable.
         392  +
    pub fn set_allow_no_auth(&mut self) -> &mut Self {
         393  +
        self.push_runtime_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePluginV2::new().into_shared());
         394  +
        self
         395  +
    }
  380    396   
    /// Set the auth scheme preference for an auth scheme resolver
  381    397   
    /// (typically the default auth scheme resolver).
  382    398   
    ///
  383    399   
    /// Each operation has a predefined order of auth schemes, as determined by the service,
  384    400   
    /// for auth scheme resolution. By using the auth scheme preference, customers
  385    401   
    /// can reorder the schemes resolved by the auth scheme resolver.
  386    402   
    ///
  387    403   
    /// The preference list is intended as a hint rather than a strict override.
  388    404   
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
  389    405   
    ///
@@ -1196,1212 +1256,1273 @@
 1216   1232   
    {
 1217   1233   
        if config.behavior_version.is_none() {
 1218   1234   
            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
 1219   1235   
        }
 1220   1236   
    }
 1221   1237   
 1222   1238   
    let default_retry_partition = "jsonprotocol";
 1223   1239   
 1224   1240   
    let scope = "json_rpc11";
 1225   1241   
 1226         -
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
        1242  +
    #[allow(deprecated)]
        1243  +
                    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1227   1244   
                        // defaults
 1228   1245   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1229   1246   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1230   1247   
                                .with_retry_partition_name(default_retry_partition)
 1231   1248   
                                .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."))
 1232   1249   
                        ))
 1233   1250   
                        // user config
 1234   1251   
                        .with_client_plugin(
 1235   1252   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1236   1253   
                                .with_config(config.config.clone())