Client Test

Client Test

rev. 27f5e8b60bf63675af6bf16e98290ebbb9e8b747

Files changed:

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -361,366 +420,482 @@
  381    386   
  382    387   
    /// Set the auth scheme resolver for the builder
  383    388   
    ///
  384    389   
    /// # Examples
  385    390   
    /// See an example for [`Self::auth_scheme_resolver`].
  386    391   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  387    392   
        self.runtime_components
  388    393   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  389    394   
        self
  390    395   
    }
         396  +
    /// Set the auth scheme preference for an auth scheme resolver
         397  +
    /// (typically the default auth scheme resolver).
         398  +
    ///
         399  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         400  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         401  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         402  +
    ///
         403  +
    /// The preference list is intended as a hint rather than a strict override.
         404  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         405  +
    ///
         406  +
    /// # Examples
         407  +
    ///
         408  +
    /// ```no_run
         409  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         410  +
    /// let config = rest_json::Config::builder()
         411  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         412  +
    ///     // ...
         413  +
    ///     .build();
         414  +
    /// let client = rest_json::Client::from_conf(config);
         415  +
    /// ```
         416  +
         417  +
    pub fn auth_scheme_preference(
         418  +
        mut self,
         419  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         420  +
    ) -> Self {
         421  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         422  +
        self
         423  +
    }
         424  +
         425  +
    /// Set the auth scheme preference for an auth scheme resolver
         426  +
    /// (typically the default auth scheme resolver).
         427  +
    ///
         428  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         429  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         430  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         431  +
    ///
         432  +
    /// The preference list is intended as a hint rather than a strict override.
         433  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         434  +
    ///
         435  +
    /// # Examples
         436  +
    ///
         437  +
    /// ```no_run
         438  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         439  +
    /// let config = rest_json::Config::builder()
         440  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         441  +
    ///     // ...
         442  +
    ///     .build();
         443  +
    /// let client = rest_json::Client::from_conf(config);
         444  +
    /// ```
         445  +
         446  +
    pub fn set_auth_scheme_preference(
         447  +
        &mut self,
         448  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         449  +
    ) -> &mut Self {
         450  +
        self.config.store_or_unset(preference);
         451  +
        self
         452  +
    }
  391    453   
    /// Set the endpoint URL to use when making requests.
  392    454   
    ///
  393    455   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  394    456   
    ///
  395    457   
    /// # Panics
  396    458   
    /// Panics if an invalid URL is given.
  397    459   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  398    460   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  399    461   
        self
  400    462   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rest_json_extras::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rest_json_extras::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rest_json_extras::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rest_json_extras::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -361,366 +420,482 @@
  381    386   
  382    387   
    /// Set the auth scheme resolver for the builder
  383    388   
    ///
  384    389   
    /// # Examples
  385    390   
    /// See an example for [`Self::auth_scheme_resolver`].
  386    391   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  387    392   
        self.runtime_components
  388    393   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  389    394   
        self
  390    395   
    }
         396  +
    /// Set the auth scheme preference for an auth scheme resolver
         397  +
    /// (typically the default auth scheme resolver).
         398  +
    ///
         399  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         400  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         401  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         402  +
    ///
         403  +
    /// The preference list is intended as a hint rather than a strict override.
         404  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         405  +
    ///
         406  +
    /// # Examples
         407  +
    ///
         408  +
    /// ```no_run
         409  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         410  +
    /// let config = rest_xml::Config::builder()
         411  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         412  +
    ///     // ...
         413  +
    ///     .build();
         414  +
    /// let client = rest_xml::Client::from_conf(config);
         415  +
    /// ```
         416  +
         417  +
    pub fn auth_scheme_preference(
         418  +
        mut self,
         419  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         420  +
    ) -> Self {
         421  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         422  +
        self
         423  +
    }
         424  +
         425  +
    /// Set the auth scheme preference for an auth scheme resolver
         426  +
    /// (typically the default auth scheme resolver).
         427  +
    ///
         428  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         429  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         430  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         431  +
    ///
         432  +
    /// The preference list is intended as a hint rather than a strict override.
         433  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         434  +
    ///
         435  +
    /// # Examples
         436  +
    ///
         437  +
    /// ```no_run
         438  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         439  +
    /// let config = rest_xml::Config::builder()
         440  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         441  +
    ///     // ...
         442  +
    ///     .build();
         443  +
    /// let client = rest_xml::Client::from_conf(config);
         444  +
    /// ```
         445  +
         446  +
    pub fn set_auth_scheme_preference(
         447  +
        &mut self,
         448  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         449  +
    ) -> &mut Self {
         450  +
        self.config.store_or_unset(preference);
         451  +
        self
         452  +
    }
  391    453   
    /// Set the endpoint URL to use when making requests.
  392    454   
    ///
  393    455   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  394    456   
    ///
  395    457   
    /// # Panics
  396    458   
    /// Panics if an invalid URL is given.
  397    459   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  398    460   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  399    461   
        self
  400    462   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rest_xml_extras::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rest_xml_extras::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rest_xml_extras::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rest_xml_extras::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rest_xml_extras_unwrapped::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rest_xml_extras_unwrapped::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rest_xml_extras_unwrapped::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rest_xml_extras_unwrapped::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rest_xml_namespace::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rest_xml_namespace::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rest_xml_namespace::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rest_xml_namespace::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rpcv2cbor::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rpcv2cbor::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rpcv2cbor::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rpcv2cbor::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rpcv2cbor_extras::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rpcv2cbor_extras::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rpcv2cbor_extras::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rpcv2cbor_extras::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rpcv2cbor_non_query_compatible::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rpcv2cbor_non_query_compatible::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rpcv2cbor_non_query_compatible::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rpcv2cbor_non_query_compatible::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = rpcv2cbor_query_compatible::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = rpcv2cbor_query_compatible::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = rpcv2cbor_query_compatible::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = rpcv2cbor_query_compatible::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }

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

@@ -23,23 +82,86 @@
   43     43   
    }
   44     44   
    /// Return the auth schemes configured on this service config
   45     45   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   46     46   
        self.runtime_components.auth_schemes()
   47     47   
    }
   48     48   
   49     49   
    /// Return the auth scheme resolver configured on this service config
   50     50   
    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
   51     51   
        self.runtime_components.auth_scheme_option_resolver()
   52     52   
    }
          53  +
    /// Returns the configured auth scheme preference
          54  +
    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
          55  +
        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
          56  +
    }
   53     57   
    /// Returns the endpoint resolver.
   54     58   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   55     59   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   56     60   
    }
   57     61   
    /// Return a reference to the retry configuration contained in this config, if any.
   58     62   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   59     63   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   60     64   
    }
   61     65   
   62     66   
    /// Return a cloned shared async sleep implementation from this config, if any.
@@ -101,105 +160,165 @@
  121    125   
    ///
  122    126   
    pub fn new() -> Self {
  123    127   
        Self::default()
  124    128   
    }
  125    129   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  126    130   
    /// but not those in runtime components.
  127    131   
    #[allow(unused)]
  128    132   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  129    133   
        let mut builder = Self::new();
  130    134   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         135  +
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  131    136   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  132    137   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  133    138   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  134    139   
        builder
  135    140   
    }
  136    141   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  137    142   
    /// to configure protection for stalled streams.
  138    143   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  139    144   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  140    145   
        self
@@ -345,350 +404,466 @@
  365    370   
  366    371   
    /// Set the auth scheme resolver for the builder
  367    372   
    ///
  368    373   
    /// # Examples
  369    374   
    /// See an example for [`Self::auth_scheme_resolver`].
  370    375   
    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
  371    376   
        self.runtime_components
  372    377   
            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
  373    378   
        self
  374    379   
    }
         380  +
    /// Set the auth scheme preference for an auth scheme resolver
         381  +
    /// (typically the default auth scheme resolver).
         382  +
    ///
         383  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         384  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         385  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         386  +
    ///
         387  +
    /// The preference list is intended as a hint rather than a strict override.
         388  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         389  +
    ///
         390  +
    /// # Examples
         391  +
    ///
         392  +
    /// ```no_run
         393  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         394  +
    /// let config = simple::Config::builder()
         395  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         396  +
    ///     // ...
         397  +
    ///     .build();
         398  +
    /// let client = simple::Client::from_conf(config);
         399  +
    /// ```
         400  +
         401  +
    pub fn auth_scheme_preference(
         402  +
        mut self,
         403  +
        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         404  +
    ) -> Self {
         405  +
        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
         406  +
        self
         407  +
    }
         408  +
         409  +
    /// Set the auth scheme preference for an auth scheme resolver
         410  +
    /// (typically the default auth scheme resolver).
         411  +
    ///
         412  +
    /// Each operation has a predefined order of auth schemes, as determined by the service,
         413  +
    /// for auth scheme resolution. By using the auth scheme preference, customers
         414  +
    /// can reorder the schemes resolved by the auth scheme resolver.
         415  +
    ///
         416  +
    /// The preference list is intended as a hint rather than a strict override.
         417  +
    /// Any schemes not present in the originally resolved auth schemes will be ignored.
         418  +
    ///
         419  +
    /// # Examples
         420  +
    ///
         421  +
    /// ```no_run
         422  +
    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
         423  +
    /// let config = simple::Config::builder()
         424  +
    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
         425  +
    ///     // ...
         426  +
    ///     .build();
         427  +
    /// let client = simple::Client::from_conf(config);
         428  +
    /// ```
         429  +
         430  +
    pub fn set_auth_scheme_preference(
         431  +
        &mut self,
         432  +
        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
         433  +
    ) -> &mut Self {
         434  +
        self.config.store_or_unset(preference);
         435  +
        self
         436  +
    }
  375    437   
    /// Set the endpoint URL to use when making requests.
  376    438   
    ///
  377    439   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  378    440   
    ///
  379    441   
    /// # Panics
  380    442   
    /// Panics if an invalid URL is given.
  381    443   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  382    444   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  383    445   
        self
  384    446   
    }