Skip to main content

aws_sdk_agentregistry/
config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#![allow(clippy::empty_line_after_doc_comments)]
3/// Configuration for a aws_sdk_agentregistry service client.
4///
5/// Service configuration allows for customization of endpoints, region, credentials providers,
6/// and retry configuration. Generally, it is constructed automatically for you from a shared
7/// configuration loaded by the `aws-config` crate. For example:
8///
9/// ```ignore
10/// // Load a shared config from the environment
11/// let shared_config = aws_config::from_env().load().await;
12/// // The client constructor automatically converts the shared config into the service config
13/// let client = Client::new(&shared_config);
14/// ```
15///
16/// The service config can also be constructed manually using its builder.
17///
18#[derive(::std::clone::Clone, ::std::fmt::Debug)]
19pub struct Config {
20    // Both `config` and `cloneable` are the same config, but the cloneable one
21    // is kept around so that it is possible to convert back into a builder. This can be
22    // optimized in the future.
23    pub(crate) config: crate::config::FrozenLayer,
24    cloneable: ::aws_smithy_types::config_bag::CloneableLayer,
25    pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder,
26    pub(crate) runtime_plugins: ::std::vec::Vec<crate::config::SharedRuntimePlugin>,
27    pub(crate) behavior_version: ::std::option::Option<crate::config::BehaviorVersion>,
28}
29impl Config {
30    ///
31    /// Constructs a config builder.
32    /// <div class="warning">
33    /// Note that a config created from this builder will not have the same safe defaults as one created by
34    /// the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
35    /// </div>
36    ///
37    pub fn builder() -> Builder {
38        Builder::default()
39    }
40    /// Converts this config back into a builder so that it can be tweaked.
41    pub fn to_builder(&self) -> Builder {
42        Builder {
43            config: self.cloneable.clone(),
44            runtime_components: self.runtime_components.clone(),
45            runtime_plugins: self.runtime_plugins.clone(),
46            behavior_version: self.behavior_version,
47        }
48    }
49    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
50    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
51        self.config.load::<crate::config::StalledStreamProtectionConfig>()
52    }
53    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
54    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
55        self.runtime_components.http_client()
56    }
57    /// Return the auth schemes configured on this service config
58    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
59        self.runtime_components.auth_schemes()
60    }
61
62    /// Return the auth scheme resolver configured on this service config
63    pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> {
64        self.runtime_components.auth_scheme_option_resolver()
65    }
66    /// Returns the configured auth scheme preference
67    pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> {
68        self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>()
69    }
70    /// Returns the endpoint resolver.
71    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
72        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
73    }
74    /// Return a reference to the retry configuration contained in this config, if any.
75    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
76        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
77    }
78
79    /// Return a cloned shared async sleep implementation from this config, if any.
80    pub fn sleep_impl(&self) -> ::std::option::Option<crate::config::SharedAsyncSleep> {
81        self.runtime_components.sleep_impl()
82    }
83
84    /// Return a reference to the timeout configuration contained in this config, if any.
85    pub fn timeout_config(&self) -> ::std::option::Option<&::aws_smithy_types::timeout::TimeoutConfig> {
86        self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>()
87    }
88
89    /// Returns a reference to the retry partition contained in this config, if any.
90    ///
91    /// WARNING: This method is unstable and may be removed at any time. Do not rely on this
92    /// method for anything!
93    pub fn retry_partition(&self) -> ::std::option::Option<&::aws_smithy_runtime::client::retries::RetryPartition> {
94        self.config.load::<::aws_smithy_runtime::client::retries::RetryPartition>()
95    }
96    /// Returns the configured identity cache for auth.
97    pub fn identity_cache(&self) -> ::std::option::Option<crate::config::SharedIdentityCache> {
98        self.runtime_components.identity_cache()
99    }
100    /// Returns interceptors currently registered by the user.
101    pub fn interceptors(&self) -> impl Iterator<Item = crate::config::SharedInterceptor> + '_ {
102        self.runtime_components.interceptors()
103    }
104    /// Return time source used for this service.
105    pub fn time_source(&self) -> ::std::option::Option<::aws_smithy_async::time::SharedTimeSource> {
106        self.runtime_components.time_source()
107    }
108    /// Returns retry classifiers currently registered by the user.
109    pub fn retry_classifiers(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier> + '_ {
110        self.runtime_components.retry_classifiers()
111    }
112    /// Returns the name of the app that is using the client, if it was provided.
113    ///
114    /// This _optional_ name is used to identify the application in the user agent that
115    /// gets sent along with requests.
116    pub fn app_name(&self) -> ::std::option::Option<&::aws_types::app_name::AppName> {
117        self.config.load::<::aws_types::app_name::AppName>()
118    }
119    /// Returns the framework metadata that has been configured, if any.
120    ///
121    /// This _optional_ metadata identifies software frameworks or third-party libraries
122    /// being used with the client, rendered into the user agent as `lib/{name}/{version}`.
123    /// Entries are returned in first-seen (insertion) order, matching the order they are
124    /// rendered into the user agent.
125    pub fn framework_metadata(&self) -> ::std::vec::Vec<&::aws_types::sdk_ua_metadata::FrameworkMetadata> {
126        // `StoreAppend` loads entries newest-first; reverse to first-seen order so
127        // this getter agrees with both the user agent and `SdkConfig::framework_metadata`.
128        let mut entries: ::std::vec::Vec<&::aws_types::sdk_ua_metadata::FrameworkMetadata> =
129            self.config.load::<::aws_types::sdk_ua_metadata::FrameworkMetadata>().collect();
130        entries.reverse();
131        entries
132    }
133    /// Returns the invocation ID generator if one was given in config.
134    ///
135    /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic.
136    pub fn invocation_id_generator(&self) -> ::std::option::Option<::aws_runtime::invocation_id::SharedInvocationIdGenerator> {
137        self.config.load::<::aws_runtime::invocation_id::SharedInvocationIdGenerator>().cloned()
138    }
139    /// Creates a new [service config](crate::Config) from a [shared `config`](::aws_types::sdk_config::SdkConfig).
140    pub fn new(config: &::aws_types::sdk_config::SdkConfig) -> Self {
141        Builder::from(config).build()
142    }
143    /// The signature version 4 service signing name to use in the credential scope when signing requests.
144    ///
145    /// The signing service may be overridden by the `Endpoint`, or by specifying a custom
146    /// [`SigningName`](aws_types::SigningName) during operation construction
147    pub fn signing_name(&self) -> &'static str {
148        "agent-registry"
149    }
150    /// Returns the AWS region, if it was provided.
151    pub fn region(&self) -> ::std::option::Option<&crate::config::Region> {
152        self.config.load::<crate::config::Region>()
153    }
154    /// This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use.
155    #[deprecated(
156        note = "This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use."
157    )]
158    pub fn credentials_provider(&self) -> Option<crate::config::SharedCredentialsProvider> {
159        ::std::option::Option::None
160    }
161}
162/// Builder for creating a `Config`.
163#[derive(::std::clone::Clone, ::std::fmt::Debug)]
164pub struct Builder {
165    pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer,
166    pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder,
167    pub(crate) runtime_plugins: ::std::vec::Vec<crate::config::SharedRuntimePlugin>,
168    pub(crate) behavior_version: ::std::option::Option<crate::config::BehaviorVersion>,
169}
170impl ::std::default::Default for Builder {
171    fn default() -> Self {
172        Self {
173            config: ::std::default::Default::default(),
174            runtime_components: crate::config::RuntimeComponentsBuilder::new("service config"),
175            runtime_plugins: ::std::default::Default::default(),
176            behavior_version: ::std::default::Default::default(),
177        }
178    }
179}
180impl Builder {
181    ///
182    /// Constructs a config builder.
183    /// <div class="warning">
184    /// Note that a config created from this builder will not have the same safe defaults as one created by
185    /// the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
186    /// </div>
187    ///
188    pub fn new() -> Self {
189        Self::default()
190    }
191    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
192    /// but not those in runtime components.
193    #[allow(unused)]
194    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
195        let mut builder = Self::new();
196        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
197        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
198        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
199        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
200        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
201        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
202        for framework_metadata in config_bag.load::<::aws_types::sdk_ua_metadata::FrameworkMetadata>() {
203            builder.push_framework_metadata(framework_metadata.clone());
204        }
205        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
206        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
207        builder
208    }
209    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
210    /// to configure protection for stalled streams.
211    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
212        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
213        self
214    }
215    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
216    /// to configure protection for stalled streams.
217    pub fn set_stalled_stream_protection(
218        &mut self,
219        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
220    ) -> &mut Self {
221        self.config.store_or_unset(stalled_stream_protection_config);
222        self
223    }
224    /// Sets the HTTP client to use when making requests.
225    ///
226    /// # Examples
227    /// ```no_run
228    /// # #[cfg(test)]
229    /// # mod tests {
230    /// # #[test]
231    /// # fn example() {
232    /// use std::time::Duration;
233    /// use aws_sdk_agentregistry::config::Config;
234    /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
235    ///
236    /// let https_connector = hyper_rustls::HttpsConnectorBuilder::new()
237    ///     .with_webpki_roots()
238    ///     .https_only()
239    ///     .enable_http1()
240    ///     .enable_http2()
241    ///     .build();
242    /// let hyper_client = HyperClientBuilder::new().build(https_connector);
243    ///
244    /// // This connector can then be given to a generated service Config
245    /// let config = my_service_client::Config::builder()
246    ///     .endpoint_url("https://example.com")
247    ///     .http_client(hyper_client)
248    ///     .build();
249    /// let client = my_service_client::Client::from_conf(config);
250    /// # }
251    /// # }
252    /// ```
253    pub fn http_client(mut self, http_client: impl crate::config::HttpClient + 'static) -> Self {
254        self.set_http_client(::std::option::Option::Some(crate::config::IntoShared::into_shared(http_client)));
255        self
256    }
257
258    /// Sets the HTTP client to use when making requests.
259    ///
260    /// # Examples
261    /// ```no_run
262    /// # #[cfg(test)]
263    /// # mod tests {
264    /// # #[test]
265    /// # fn example() {
266    /// use std::time::Duration;
267    /// use aws_sdk_agentregistry::config::{Builder, Config};
268    /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
269    ///
270    /// fn override_http_client(builder: &mut Builder) {
271    ///     let https_connector = hyper_rustls::HttpsConnectorBuilder::new()
272    ///         .with_webpki_roots()
273    ///         .https_only()
274    ///         .enable_http1()
275    ///         .enable_http2()
276    ///         .build();
277    ///     let hyper_client = HyperClientBuilder::new().build(https_connector);
278    ///     builder.set_http_client(Some(hyper_client));
279    /// }
280    ///
281    /// let mut builder = aws_sdk_agentregistry::Config::builder();
282    /// override_http_client(&mut builder);
283    /// let config = builder.build();
284    /// # }
285    /// # }
286    /// ```
287    pub fn set_http_client(&mut self, http_client: Option<crate::config::SharedHttpClient>) -> &mut Self {
288        self.runtime_components.set_http_client(http_client);
289        self
290    }
291    /// Adds an auth scheme to the builder
292    ///
293    /// If `auth_scheme` has an existing [AuthSchemeId](aws_smithy_runtime_api::client::auth::AuthSchemeId) in the runtime, the current identity
294    /// resolver and signer for that scheme will be replaced by those from `auth_scheme`.
295    ///
296    /// _Important:_ When introducing a custom auth scheme, ensure you override either
297    /// [`Self::auth_scheme_resolver`] or [`Self::set_auth_scheme_resolver`]
298    /// so that the custom auth scheme is included in the list of resolved auth scheme options.
299    /// [The default auth scheme resolver](crate::config::auth::DefaultAuthSchemeResolver) will not recognize your custom auth scheme.
300    ///
301    /// # Examples
302    /// ```no_run
303    /// # use aws_smithy_runtime_api::{
304    /// #     box_error::BoxError,
305    /// #     client::{
306    /// #         auth::{
307    /// #             AuthScheme, AuthSchemeEndpointConfig, AuthSchemeId, AuthSchemeOption,
308    /// #             AuthSchemeOptionsFuture, Sign,
309    /// #         },
310    /// #         identity::{Identity, IdentityFuture, ResolveIdentity, SharedIdentityResolver},
311    /// #         orchestrator::HttpRequest,
312    /// #         runtime_components::{GetIdentityResolver, RuntimeComponents},
313    /// #   },
314    /// #   shared::IntoShared,
315    /// # };
316    /// # use aws_smithy_types::config_bag::ConfigBag;
317    /// // Auth scheme with customer identity resolver and signer
318    /// #[derive(Debug)]
319    /// struct CustomAuthScheme {
320    ///     id: AuthSchemeId,
321    ///     identity_resolver: SharedIdentityResolver,
322    ///     signer: CustomSigner,
323    /// }
324    /// impl Default for CustomAuthScheme {
325    ///     fn default() -> Self {
326    ///         Self {
327    ///             id: AuthSchemeId::new("custom"),
328    ///             identity_resolver: CustomIdentityResolver.into_shared(),
329    ///             signer: CustomSigner,
330    ///         }
331    ///     }
332    /// }
333    /// impl AuthScheme for CustomAuthScheme {
334    ///     fn scheme_id(&self) -> AuthSchemeId {
335    ///         self.id.clone()
336    ///     }
337    ///     fn identity_resolver(
338    ///         &self,
339    ///         _identity_resolvers: &dyn GetIdentityResolver,
340    ///     ) -> Option<SharedIdentityResolver> {
341    ///         Some(self.identity_resolver.clone())
342    ///     }
343    ///     fn signer(&self) -> &dyn Sign {
344    ///         &self.signer
345    ///     }
346    /// }
347    ///
348    /// #[derive(Debug, Default)]
349    /// struct CustomSigner;
350    /// impl Sign for CustomSigner {
351    ///     fn sign_http_request(
352    ///         &self,
353    ///         _request: &mut HttpRequest,
354    ///         _identity: &Identity,
355    ///         _auth_scheme_endpoint_config: AuthSchemeEndpointConfig<'_>,
356    ///         _runtime_components: &RuntimeComponents,
357    ///         _config_bag: &ConfigBag,
358    ///     ) -> Result<(), BoxError> {
359    ///         // --snip--
360    /// #      todo!()
361    ///     }
362    /// }
363    ///
364    /// #[derive(Debug)]
365    /// struct CustomIdentityResolver;
366    /// impl ResolveIdentity for CustomIdentityResolver {
367    ///     fn resolve_identity<'a>(
368    ///         &'a self,
369    ///         _runtime_components: &'a RuntimeComponents,
370    ///         _config_bag: &'a ConfigBag,
371    ///     ) -> IdentityFuture<'a> {
372    ///         // --snip--
373    /// #      todo!()
374    ///     }
375    /// }
376    ///
377    /// // Auth scheme resolver that favors `CustomAuthScheme`
378    /// #[derive(Debug)]
379    /// struct CustomAuthSchemeResolver;
380    /// impl aws_sdk_agentregistry::config::auth::ResolveAuthScheme for CustomAuthSchemeResolver {
381    ///     fn resolve_auth_scheme<'a>(
382    ///         &'a self,
383    ///         _params: &'a aws_sdk_agentregistry::config::auth::Params,
384    ///         _cfg: &'a ConfigBag,
385    ///         _runtime_components: &'a RuntimeComponents,
386    ///     ) -> AuthSchemeOptionsFuture<'a> {
387    ///         AuthSchemeOptionsFuture::ready(Ok(vec![AuthSchemeOption::from(AuthSchemeId::new(
388    ///             "custom",
389    ///         ))]))
390    ///     }
391    /// }
392    ///
393    /// let config = aws_sdk_agentregistry::Config::builder()
394    ///     .push_auth_scheme(CustomAuthScheme::default())
395    ///     .auth_scheme_resolver(CustomAuthSchemeResolver)
396    ///     // other configurations
397    ///     .build();
398    /// ```
399    pub fn push_auth_scheme(mut self, auth_scheme: impl ::aws_smithy_runtime_api::client::auth::AuthScheme + 'static) -> Self {
400        self.runtime_components.push_auth_scheme(auth_scheme);
401        self
402    }
403
404    /// Set the auth scheme resolver for the builder
405    ///
406    /// # Examples
407    /// ```no_run
408    /// # use aws_smithy_runtime_api::{
409    /// #     client::{
410    /// #         auth::AuthSchemeOptionsFuture,
411    /// #         runtime_components::RuntimeComponents,
412    /// #   },
413    /// # };
414    /// # use aws_smithy_types::config_bag::ConfigBag;
415    /// #[derive(Debug)]
416    /// struct CustomAuthSchemeResolver;
417    /// impl aws_sdk_agentregistry::config::auth::ResolveAuthScheme for CustomAuthSchemeResolver {
418    ///     fn resolve_auth_scheme<'a>(
419    ///         &'a self,
420    ///         _params: &'a aws_sdk_agentregistry::config::auth::Params,
421    ///         _cfg: &'a ConfigBag,
422    ///         _runtime_components: &'a RuntimeComponents,
423    ///     ) -> AuthSchemeOptionsFuture<'a> {
424    ///         // --snip--
425    /// #      todo!()
426    ///     }
427    /// }
428    ///
429    /// let config = aws_sdk_agentregistry::Config::builder()
430    ///     .auth_scheme_resolver(CustomAuthSchemeResolver)
431    ///     // other configurations
432    ///     .build();
433    /// ```
434    pub fn auth_scheme_resolver(mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> Self {
435        self.set_auth_scheme_resolver(auth_scheme_resolver);
436        self
437    }
438
439    /// Set the auth scheme resolver for the builder
440    ///
441    /// # Examples
442    /// See an example for [`Self::auth_scheme_resolver`].
443    pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self {
444        self.runtime_components
445            .set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver()));
446        self
447    }
448
449    /// Enable no authentication regardless of what authentication mechanisms operations support
450    ///
451    /// This adds [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback
452    /// and the auth scheme resolver will use it when no other auth schemes are applicable.
453    pub fn allow_no_auth(mut self) -> Self {
454        self.set_allow_no_auth();
455        self
456    }
457
458    /// Enable no authentication regardless of what authentication mechanisms operations support
459    ///
460    /// This adds [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback
461    /// and the auth scheme resolver will use it when no other auth schemes are applicable.
462    pub fn set_allow_no_auth(&mut self) -> &mut Self {
463        self.push_runtime_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePluginV2::new().into_shared());
464        self
465    }
466    /// Set the auth scheme preference for an auth scheme resolver
467    /// (typically the default auth scheme resolver).
468    ///
469    /// Each operation has a predefined order of auth schemes, as determined by the service,
470    /// for auth scheme resolution. By using the auth scheme preference, customers
471    /// can reorder the schemes resolved by the auth scheme resolver.
472    ///
473    /// The preference list is intended as a hint rather than a strict override.
474    /// Any schemes not present in the originally resolved auth schemes will be ignored.
475    ///
476    /// # Examples
477    ///
478    /// ```no_run
479    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
480    /// let config = aws_sdk_agentregistry::Config::builder()
481    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
482    ///     // ...
483    ///     .build();
484    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
485    /// ```
486
487    pub fn auth_scheme_preference(
488        mut self,
489        preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
490    ) -> Self {
491        self.set_auth_scheme_preference(::std::option::Option::Some(preference.into()));
492        self
493    }
494
495    /// Set the auth scheme preference for an auth scheme resolver
496    /// (typically the default auth scheme resolver).
497    ///
498    /// Each operation has a predefined order of auth schemes, as determined by the service,
499    /// for auth scheme resolution. By using the auth scheme preference, customers
500    /// can reorder the schemes resolved by the auth scheme resolver.
501    ///
502    /// The preference list is intended as a hint rather than a strict override.
503    /// Any schemes not present in the originally resolved auth schemes will be ignored.
504    ///
505    /// # Examples
506    ///
507    /// ```no_run
508    /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId;
509    /// let config = aws_sdk_agentregistry::Config::builder()
510    ///     .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")])
511    ///     // ...
512    ///     .build();
513    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
514    /// ```
515
516    pub fn set_auth_scheme_preference(
517        &mut self,
518        preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>,
519    ) -> &mut Self {
520        self.config.store_or_unset(preference);
521        self
522    }
523    /// Sets the endpoint resolver to use when making requests.
524    ///
525    ///
526    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
527    /// rules for `aws_sdk_agentregistry`.
528    ///
529    ///
530    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
531    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
532    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
533    ///
534    /// # Examples
535    /// Create a custom endpoint resolver that resolves a different endpoing per-stage, e.g. staging vs. production.
536    /// ```no_run
537    /// use aws_sdk_agentregistry::config::endpoint::{ResolveEndpoint, EndpointFuture, Params, Endpoint};
538    /// #[derive(Debug)]
539    /// struct StageResolver { stage: String }
540    /// impl ResolveEndpoint for StageResolver {
541    ///     fn resolve_endpoint(&self, params: &Params) -> EndpointFuture<'_> {
542    ///         let stage = &self.stage;
543    ///         EndpointFuture::ready(Ok(Endpoint::builder().url(format!("{stage}.myservice.com")).build()))
544    ///     }
545    /// }
546    /// let resolver = StageResolver { stage: std::env::var("STAGE").unwrap() };
547    /// let config = aws_sdk_agentregistry::Config::builder().endpoint_resolver(resolver).build();
548    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
549    /// ```
550    pub fn endpoint_resolver(mut self, endpoint_resolver: impl crate::config::endpoint::ResolveEndpoint + 'static) -> Self {
551        self.set_endpoint_resolver(::std::option::Option::Some(endpoint_resolver.into_shared_resolver()));
552        self
553    }
554
555    /// Sets the endpoint resolver to use when making requests.
556    ///
557    ///
558    /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution
559    /// rules for `aws_sdk_agentregistry`.
560    ///
561    pub fn set_endpoint_resolver(
562        &mut self,
563        endpoint_resolver: ::std::option::Option<::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver>,
564    ) -> &mut Self {
565        self.runtime_components.set_endpoint_resolver(endpoint_resolver);
566        self
567    }
568    /// Set the retry_config for the builder
569    ///
570    /// # Examples
571    /// ```no_run
572    /// use aws_sdk_agentregistry::config::Config;
573    /// use aws_sdk_agentregistry::config::retry::RetryConfig;
574    ///
575    /// let retry_config = RetryConfig::standard().with_max_attempts(5);
576    /// let config = Config::builder().retry_config(retry_config).build();
577    /// ```
578    pub fn retry_config(mut self, retry_config: ::aws_smithy_types::retry::RetryConfig) -> Self {
579        self.set_retry_config(Some(retry_config));
580        self
581    }
582
583    /// Set the retry_config for the builder
584    ///
585    /// # Examples
586    /// ```no_run
587    /// use aws_sdk_agentregistry::config::{Builder, Config};
588    /// use aws_sdk_agentregistry::config::retry::RetryConfig;
589    ///
590    /// fn disable_retries(builder: &mut Builder) {
591    ///     let retry_config = RetryConfig::standard().with_max_attempts(1);
592    ///     builder.set_retry_config(Some(retry_config));
593    /// }
594    ///
595    /// let mut builder = Config::builder();
596    /// disable_retries(&mut builder);
597    /// let config = builder.build();
598    /// ```
599    pub fn set_retry_config(&mut self, retry_config: ::std::option::Option<::aws_smithy_types::retry::RetryConfig>) -> &mut Self {
600        retry_config.map(|r| self.config.store_put(r));
601        self
602    }
603    /// Set the sleep_impl for the builder
604    ///
605    /// # Examples
606    ///
607    /// ```no_run
608    /// use aws_sdk_agentregistry::config::{AsyncSleep, Config, SharedAsyncSleep, Sleep};
609    ///
610    /// #[derive(Debug)]
611    /// pub struct ForeverSleep;
612    ///
613    /// impl AsyncSleep for ForeverSleep {
614    ///     fn sleep(&self, duration: std::time::Duration) -> Sleep {
615    ///         Sleep::new(std::future::pending())
616    ///     }
617    /// }
618    ///
619    /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep);
620    /// let config = Config::builder().sleep_impl(sleep_impl).build();
621    /// ```
622    pub fn sleep_impl(mut self, sleep_impl: impl crate::config::AsyncSleep + 'static) -> Self {
623        self.set_sleep_impl(Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(sleep_impl)));
624        self
625    }
626
627    /// Set the sleep_impl for the builder
628    ///
629    /// # Examples
630    ///
631    /// ```no_run
632    /// use aws_sdk_agentregistry::config::{AsyncSleep, Builder, Config, SharedAsyncSleep, Sleep};
633    ///
634    /// #[derive(Debug)]
635    /// pub struct ForeverSleep;
636    ///
637    /// impl AsyncSleep for ForeverSleep {
638    ///     fn sleep(&self, duration: std::time::Duration) -> Sleep {
639    ///         Sleep::new(std::future::pending())
640    ///     }
641    /// }
642    ///
643    /// fn set_never_ending_sleep_impl(builder: &mut Builder) {
644    ///     let sleep_impl = SharedAsyncSleep::new(ForeverSleep);
645    ///     builder.set_sleep_impl(Some(sleep_impl));
646    /// }
647    ///
648    /// let mut builder = Config::builder();
649    /// set_never_ending_sleep_impl(&mut builder);
650    /// let config = builder.build();
651    /// ```
652    pub fn set_sleep_impl(&mut self, sleep_impl: ::std::option::Option<crate::config::SharedAsyncSleep>) -> &mut Self {
653        self.runtime_components.set_sleep_impl(sleep_impl);
654        self
655    }
656    /// Set the timeout_config for the builder
657    ///
658    /// # Examples
659    ///
660    /// ```no_run
661    /// # use std::time::Duration;
662    /// use aws_sdk_agentregistry::config::Config;
663    /// use aws_sdk_agentregistry::config::timeout::TimeoutConfig;
664    ///
665    /// let timeout_config = TimeoutConfig::builder()
666    ///     .operation_attempt_timeout(Duration::from_secs(1))
667    ///     .build();
668    /// let config = Config::builder().timeout_config(timeout_config).build();
669    /// ```
670    pub fn timeout_config(mut self, timeout_config: ::aws_smithy_types::timeout::TimeoutConfig) -> Self {
671        self.set_timeout_config(Some(timeout_config));
672        self
673    }
674
675    /// Set the timeout_config for the builder.
676    ///
677    /// Setting this to `None` has no effect if another source of configuration has set timeouts. If you
678    /// are attempting to disable timeouts, use [`TimeoutConfig::disabled`](::aws_smithy_types::timeout::TimeoutConfig::disabled)
679    ///
680    ///
681    /// # Examples
682    ///
683    /// ```no_run
684    /// # use std::time::Duration;
685    /// use aws_sdk_agentregistry::config::{Builder, Config};
686    /// use aws_sdk_agentregistry::config::timeout::TimeoutConfig;
687    ///
688    /// fn set_request_timeout(builder: &mut Builder) {
689    ///     let timeout_config = TimeoutConfig::builder()
690    ///         .operation_attempt_timeout(Duration::from_secs(1))
691    ///         .build();
692    ///     builder.set_timeout_config(Some(timeout_config));
693    /// }
694    ///
695    /// let mut builder = Config::builder();
696    /// set_request_timeout(&mut builder);
697    /// let config = builder.build();
698    /// ```
699    pub fn set_timeout_config(&mut self, timeout_config: ::std::option::Option<::aws_smithy_types::timeout::TimeoutConfig>) -> &mut Self {
700        // passing None has no impact.
701        let Some(mut timeout_config) = timeout_config else { return self };
702
703        if let Some(base) = self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() {
704            timeout_config.take_defaults_from(base);
705        }
706        self.config.store_put(timeout_config);
707        self
708    }
709    /// Set the partition for retry-related state. When clients share a retry partition, they will
710    /// also share components such as token buckets and client rate limiters.
711    /// See the [`RetryPartition`](::aws_smithy_runtime::client::retries::RetryPartition) documentation for more details.
712    ///
713    /// # Default Behavior
714    ///
715    /// When no retry partition is explicitly set, the SDK automatically creates a default retry partition named `agentregistry`
716    /// (or `agentregistry-<region>` if a region is configured).
717    /// All Agent Registry clients without an explicit retry partition will share this default partition.
718    ///
719    /// # Notes
720    ///
721    /// - This is an advanced setting — most users won't need to modify it.
722    /// - A configured client rate limiter has no effect unless [`RetryConfig::adaptive`](::aws_smithy_types::retry::RetryConfig::adaptive) is used.
723    ///
724    /// # Examples
725    ///
726    /// Creating a custom retry partition with a token bucket:
727    /// ```no_run
728    /// use aws_sdk_agentregistry::config::Config;
729    /// use aws_sdk_agentregistry::config::retry::{RetryPartition, TokenBucket};
730    ///
731    /// let token_bucket = TokenBucket::new(10);
732    /// let config = Config::builder()
733    ///     .retry_partition(RetryPartition::custom("custom")
734    ///         .token_bucket(token_bucket)
735    ///         .build()
736    ///     )
737    ///     .build();
738    /// ```
739    ///
740    /// Configuring a client rate limiter with adaptive retry mode:
741    /// ```no_run
742    /// use aws_sdk_agentregistry::config::Config;
743    /// use aws_sdk_agentregistry::config::retry::{ClientRateLimiter, RetryConfig, RetryPartition};
744    ///
745    /// let client_rate_limiter = ClientRateLimiter::new(10.0);
746    /// let config = Config::builder()
747    ///     .retry_partition(RetryPartition::custom("custom")
748    ///         .client_rate_limiter(client_rate_limiter)
749    ///         .build()
750    ///     )
751    ///     .retry_config(RetryConfig::adaptive())
752    ///     .build();
753    /// ```
754    pub fn retry_partition(mut self, retry_partition: ::aws_smithy_runtime::client::retries::RetryPartition) -> Self {
755        self.set_retry_partition(Some(retry_partition));
756        self
757    }
758    /// Like [`Self::retry_partition`], but takes a mutable reference to the builder and an optional `RetryPartition`
759    pub fn set_retry_partition(
760        &mut self,
761        retry_partition: ::std::option::Option<::aws_smithy_runtime::client::retries::RetryPartition>,
762    ) -> &mut Self {
763        retry_partition.map(|r| self.config.store_put(r));
764        self
765    }
766    /// Set the identity cache for auth.
767    ///
768    /// The identity cache defaults to a lazy caching implementation that will resolve
769    /// an identity when it is requested, and place it in the cache thereafter. Subsequent
770    /// requests will take the value from the cache while it is still valid. Once it expires,
771    /// the next request will result in refreshing the identity.
772    ///
773    /// This configuration allows you to disable or change the default caching mechanism.
774    /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity)
775    /// trait and pass that implementation into this function.
776    ///
777    /// # Examples
778    ///
779    /// Disabling identity caching:
780    /// ```no_run
781    /// use aws_sdk_agentregistry::config::IdentityCache;
782    ///
783    /// let config = aws_sdk_agentregistry::Config::builder()
784    ///     .identity_cache(IdentityCache::no_cache())
785    ///     // ...
786    ///     .build();
787    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
788    /// ```
789    ///
790    /// Customizing lazy caching:
791    /// ```no_run
792    /// use aws_sdk_agentregistry::config::IdentityCache;
793    /// use std::time::Duration;
794    ///
795    /// let config = aws_sdk_agentregistry::Config::builder()
796    ///     .identity_cache(
797    ///         IdentityCache::lazy()
798    ///             // change the load timeout to 10 seconds
799    ///             .load_timeout(Duration::from_secs(10))
800    ///             .build()
801    ///     )
802    ///     // ...
803    ///     .build();
804    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
805    /// ```
806    ///
807    pub fn identity_cache(mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> Self {
808        self.set_identity_cache(identity_cache);
809        self
810    }
811
812    /// Set the identity cache for auth.
813    ///
814    /// The identity cache defaults to a lazy caching implementation that will resolve
815    /// an identity when it is requested, and place it in the cache thereafter. Subsequent
816    /// requests will take the value from the cache while it is still valid. Once it expires,
817    /// the next request will result in refreshing the identity.
818    ///
819    /// This configuration allows you to disable or change the default caching mechanism.
820    /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity)
821    /// trait and pass that implementation into this function.
822    ///
823    /// # Examples
824    ///
825    /// Disabling identity caching:
826    /// ```no_run
827    /// use aws_sdk_agentregistry::config::IdentityCache;
828    ///
829    /// let config = aws_sdk_agentregistry::Config::builder()
830    ///     .identity_cache(IdentityCache::no_cache())
831    ///     // ...
832    ///     .build();
833    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
834    /// ```
835    ///
836    /// Customizing lazy caching:
837    /// ```no_run
838    /// use aws_sdk_agentregistry::config::IdentityCache;
839    /// use std::time::Duration;
840    ///
841    /// let config = aws_sdk_agentregistry::Config::builder()
842    ///     .identity_cache(
843    ///         IdentityCache::lazy()
844    ///             // change the load timeout to 10 seconds
845    ///             .load_timeout(Duration::from_secs(10))
846    ///             .build()
847    ///     )
848    ///     // ...
849    ///     .build();
850    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
851    /// ```
852    ///
853    pub fn set_identity_cache(&mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> &mut Self {
854        self.runtime_components.set_identity_cache(::std::option::Option::Some(identity_cache));
855        self
856    }
857    /// Add an [interceptor](crate::config::Intercept) that runs at specific stages of the request execution pipeline.
858    ///
859    /// Interceptors targeted at a certain stage are executed according to the pre-defined priority.
860    /// The SDK provides a default set of interceptors. An interceptor configured by this method
861    /// will run after those default interceptors.
862    ///
863    /// # Examples
864    /// ```no_run
865    /// # fn example() {
866    /// use aws_smithy_runtime_api::box_error::BoxError;
867    /// use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
868    /// use aws_smithy_runtime_api::client::interceptors::Intercept;
869    /// use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
870    /// use aws_smithy_types::config_bag::ConfigBag;
871    /// use aws_sdk_agentregistry::config::Config;
872    /// use ::http::uri::Uri;
873    ///
874    /// fn base_url() -> String {
875    ///     // ...
876    ///     # String::new()
877    /// }
878    ///
879    /// #[derive(Debug)]
880    /// pub struct UriModifierInterceptor;
881    /// impl Intercept for UriModifierInterceptor {
882    ///     fn name(&self) -> &'static str {
883    ///         "UriModifierInterceptor"
884    ///     }
885    ///     fn modify_before_signing(
886    ///         &self,
887    ///         context: &mut BeforeTransmitInterceptorContextMut<'_>,
888    ///         _runtime_components: &RuntimeComponents,
889    ///         _cfg: &mut ConfigBag,
890    ///     ) -> Result<(), BoxError> {
891    ///         let request = context.request_mut();
892    ///         let uri = format!("{}{}", base_url(), request.uri());
893    ///         *request.uri_mut() = uri.parse::<Uri>()?.into();
894    ///
895    ///         Ok(())
896    ///     }
897    /// }
898    ///
899    /// let config = Config::builder()
900    ///     .interceptor(UriModifierInterceptor)
901    ///     .build();
902    /// # }
903    /// ```
904    pub fn interceptor(mut self, interceptor: impl crate::config::Intercept + 'static) -> Self {
905        self.push_interceptor(crate::config::SharedInterceptor::new(interceptor));
906        self
907    }
908
909    /// Like [`Self::interceptor`], but takes a [`SharedInterceptor`](crate::config::SharedInterceptor).
910    pub fn push_interceptor(&mut self, interceptor: crate::config::SharedInterceptor) -> &mut Self {
911        self.runtime_components.push_interceptor(interceptor);
912        self
913    }
914
915    /// Set [`SharedInterceptor`](crate::config::SharedInterceptor)s for the builder.
916    pub fn set_interceptors(&mut self, interceptors: impl IntoIterator<Item = crate::config::SharedInterceptor>) -> &mut Self {
917        self.runtime_components.set_interceptors(interceptors.into_iter());
918        self
919    }
920    /// Sets the time source used for this service
921    pub fn time_source(mut self, time_source: impl ::aws_smithy_async::time::TimeSource + 'static) -> Self {
922        self.set_time_source(::std::option::Option::Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(
923            time_source,
924        )));
925        self
926    }
927    /// Sets the time source used for this service
928    pub fn set_time_source(&mut self, time_source: ::std::option::Option<::aws_smithy_async::time::SharedTimeSource>) -> &mut Self {
929        self.runtime_components.set_time_source(time_source);
930        self
931    }
932    /// Add type implementing [`ClassifyRetry`](::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry) that will be used by the
933    /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried.
934    ///
935    /// A retry classifier configured by this method will run according to its [priority](::aws_smithy_runtime_api::client::retries::classifiers::RetryClassifierPriority).
936    ///
937    /// # Examples
938    /// ```no_run
939    /// # fn example() {
940    /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;
941    /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError;
942    /// use aws_smithy_runtime_api::client::retries::classifiers::{
943    ///     ClassifyRetry, RetryAction, RetryClassifierPriority,
944    /// };
945    /// use aws_smithy_types::error::metadata::ProvideErrorMetadata;
946    /// use aws_smithy_types::retry::ErrorKind;
947    /// use std::error::Error as StdError;
948    /// use std::marker::PhantomData;
949    /// use std::fmt;
950    /// use aws_sdk_agentregistry::config::Config;
951    /// # #[derive(Debug)]
952    /// # struct SomeOperationError {}
953    /// # impl StdError for SomeOperationError {}
954    /// # impl fmt::Display for SomeOperationError {
955    /// #    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { todo!() }
956    /// # }
957    /// # impl ProvideErrorMetadata for SomeOperationError {
958    /// #    fn meta(&self) -> &aws_sdk_agentregistry::error::ErrorMetadata { todo!() }
959    /// # }
960    ///
961    /// const RETRYABLE_ERROR_CODES: &[&str] = &[
962    ///     // List error codes to be retried here...
963    /// ];
964    ///
965    /// // When classifying at an operation's error type, classifiers require a generic parameter.
966    /// // When classifying the HTTP response alone, no generic is needed.
967    /// #[derive(Debug, Default)]
968    /// pub struct ExampleErrorCodeClassifier<E> {
969    ///     _inner: PhantomData<E>,
970    /// }
971    ///
972    /// impl<E> ExampleErrorCodeClassifier<E> {
973    ///     pub fn new() -> Self {
974    ///         Self {
975    ///             _inner: PhantomData,
976    ///         }
977    ///     }
978    /// }
979    ///
980    /// impl<E> ClassifyRetry for ExampleErrorCodeClassifier<E>
981    /// where
982    ///     // Adding a trait bound for ProvideErrorMetadata allows us to inspect the error code.
983    ///     E: StdError + ProvideErrorMetadata + Send + Sync + 'static,
984    /// {
985    ///     fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction {
986    ///         // Check for a result
987    ///         let output_or_error = ctx.output_or_error();
988    ///         // Check for an error
989    ///         let error = match output_or_error {
990    ///             Some(Ok(_)) | None => return RetryAction::NoActionIndicated,
991    ///               Some(Err(err)) => err,
992    ///         };
993    ///
994    ///         // Downcast the generic error and extract the code
995    ///         let error_code = OrchestratorError::as_operation_error(error)
996    ///             .and_then(|err| err.downcast_ref::<E>())
997    ///             .and_then(|err| err.code());
998    ///
999    ///         // If this error's code is in our list, return an action that tells the RetryStrategy to retry this request.
1000    ///         if let Some(error_code) = error_code {
1001    ///             if RETRYABLE_ERROR_CODES.contains(&error_code) {
1002    ///                 return RetryAction::transient_error();
1003    ///             }
1004    ///         }
1005    ///
1006    ///         // Otherwise, return that no action is indicated i.e. that this classifier doesn't require a retry.
1007    ///         // Another classifier may still classify this response as retryable.
1008    ///         RetryAction::NoActionIndicated
1009    ///     }
1010    ///
1011    ///     fn name(&self) -> &'static str { "Example Error Code Classifier" }
1012    /// }
1013    ///
1014    /// let config = Config::builder()
1015    ///     .retry_classifier(ExampleErrorCodeClassifier::<SomeOperationError>::new())
1016    ///     .build();
1017    /// # }
1018    /// ```
1019    pub fn retry_classifier(
1020        mut self,
1021        retry_classifier: impl ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry + 'static,
1022    ) -> Self {
1023        self.push_retry_classifier(::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier::new(
1024            retry_classifier,
1025        ));
1026        self
1027    }
1028
1029    /// Like [`Self::retry_classifier`], but takes a [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier).
1030    pub fn push_retry_classifier(
1031        &mut self,
1032        retry_classifier: ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier,
1033    ) -> &mut Self {
1034        self.runtime_components.push_retry_classifier(retry_classifier);
1035        self
1036    }
1037
1038    /// Set [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier)s for the builder, replacing any that
1039    /// were previously set.
1040    pub fn set_retry_classifiers(
1041        &mut self,
1042        retry_classifiers: impl IntoIterator<Item = ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier>,
1043    ) -> &mut Self {
1044        self.runtime_components.set_retry_classifiers(retry_classifiers.into_iter());
1045        self
1046    }
1047    /// Sets the name of the app that is using the client.
1048    ///
1049    /// This _optional_ name is used to identify the application in the user agent that
1050    /// gets sent along with requests.
1051    pub fn app_name(mut self, app_name: ::aws_types::app_name::AppName) -> Self {
1052        self.set_app_name(Some(app_name));
1053        self
1054    }
1055    /// Sets the name of the app that is using the client.
1056    ///
1057    /// This _optional_ name is used to identify the application in the user agent that
1058    /// gets sent along with requests.
1059    pub fn set_app_name(&mut self, app_name: ::std::option::Option<::aws_types::app_name::AppName>) -> &mut Self {
1060        self.config.store_or_unset(app_name);
1061        self
1062    }
1063    /// Appends framework metadata to the user agent.
1064    ///
1065    /// This _optional_ metadata identifies a software framework or third-party library
1066    /// that is being used with the client. It is rendered into the user agent string
1067    /// (as `lib/{name}/{version}`) so that libraries built on top of the AWS SDK can
1068    /// self-identify in the requests they make. Multiple entries may be added; each call
1069    /// appends another entry rather than replacing previous ones.
1070    ///
1071    /// Entries are de-duplicated on `(name, version)`, rendered in first-seen order, and
1072    /// the total number of unique entries included in the user agent is capped (currently
1073    /// at 10); additional entries beyond the cap are dropped with a warning.
1074    pub fn framework_metadata(mut self, framework_metadata: ::aws_types::sdk_ua_metadata::FrameworkMetadata) -> Self {
1075        self.push_framework_metadata(framework_metadata);
1076        self
1077    }
1078    /// Appends framework metadata to the user agent.
1079    ///
1080    /// This _optional_ metadata identifies a software framework or third-party library
1081    /// that is being used with the client. It is rendered into the user agent string
1082    /// (as `lib/{name}/{version}`) so that libraries built on top of the AWS SDK can
1083    /// self-identify in the requests they make. Multiple entries may be added; each call
1084    /// appends another entry rather than replacing previous ones.
1085    pub fn push_framework_metadata(&mut self, framework_metadata: ::aws_types::sdk_ua_metadata::FrameworkMetadata) -> &mut Self {
1086        self.config.store_append(framework_metadata);
1087        self
1088    }
1089    /// Overrides the default invocation ID generator.
1090    ///
1091    /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic.
1092    pub fn invocation_id_generator(mut self, gen: impl ::aws_runtime::invocation_id::InvocationIdGenerator + 'static) -> Self {
1093        self.set_invocation_id_generator(::std::option::Option::Some(
1094            ::aws_runtime::invocation_id::SharedInvocationIdGenerator::new(gen),
1095        ));
1096        self
1097    }
1098    /// Overrides the default invocation ID generator.
1099    ///
1100    /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic.
1101    pub fn set_invocation_id_generator(
1102        &mut self,
1103        gen: ::std::option::Option<::aws_runtime::invocation_id::SharedInvocationIdGenerator>,
1104    ) -> &mut Self {
1105        self.config.store_or_unset(gen);
1106        self
1107    }
1108    /// Sets the endpoint URL used to communicate with this service.
1109    ///
1110    /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix
1111    /// will be prefixed onto this URL. To fully override the endpoint resolver, use
1112    /// [`Builder::endpoint_resolver`].
1113    pub fn endpoint_url(mut self, endpoint_url: impl Into<::std::string::String>) -> Self {
1114        self.set_endpoint_url(Some(endpoint_url.into()));
1115        self
1116    }
1117    /// Sets the endpoint URL used to communicate with this service.
1118    ///
1119    /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix
1120    /// will be prefixed onto this URL. To fully override the endpoint resolver, use
1121    /// [`Builder::endpoint_resolver`].
1122    pub fn set_endpoint_url(&mut self, endpoint_url: Option<::std::string::String>) -> &mut Self {
1123        self.config.store_or_unset(endpoint_url.map(::aws_types::endpoint_config::EndpointUrl));
1124        self
1125    }
1126    /// Sets the AWS region to use when making requests.
1127    ///
1128    /// # Examples
1129    /// ```no_run
1130    /// use aws_types::region::Region;
1131    /// use aws_sdk_agentregistry::config::{Builder, Config};
1132    ///
1133    /// let config = aws_sdk_agentregistry::Config::builder()
1134    ///     .region(Region::new("us-east-1"))
1135    ///     .build();
1136    /// ```
1137    pub fn region(mut self, region: impl ::std::convert::Into<::std::option::Option<crate::config::Region>>) -> Self {
1138        self.set_region(region.into());
1139        self
1140    }
1141    /// Sets the AWS region to use when making requests.
1142    pub fn set_region(&mut self, region: ::std::option::Option<crate::config::Region>) -> &mut Self {
1143        self.config.store_or_unset(region);
1144        self
1145    }
1146    /// Sets the credentials provider for this service
1147    pub fn credentials_provider(mut self, credentials_provider: impl crate::config::ProvideCredentials + 'static) -> Self {
1148        self.set_credentials_provider(::std::option::Option::Some(crate::config::SharedCredentialsProvider::new(
1149            credentials_provider,
1150        )));
1151        self
1152    }
1153    /// Sets the credentials provider for this service
1154    pub fn set_credentials_provider(&mut self, credentials_provider: ::std::option::Option<crate::config::SharedCredentialsProvider>) -> &mut Self {
1155        if let Some(credentials_provider) = credentials_provider {
1156            self.runtime_components
1157                .set_identity_resolver(::aws_runtime::auth::sigv4::SCHEME_ID, credentials_provider);
1158        }
1159        self
1160    }
1161    /// Sets the [`behavior major version`](crate::config::BehaviorVersion).
1162    ///
1163    /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards
1164    /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for
1165    /// all operations might be the ideal behavior but could break existing applications.
1166    ///
1167    /// # Examples
1168    ///
1169    /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature.
1170    /// ```no_run
1171    /// use aws_sdk_agentregistry::config::BehaviorVersion;
1172    ///
1173    /// let config = aws_sdk_agentregistry::Config::builder()
1174    ///     .behavior_version(BehaviorVersion::latest())
1175    ///     // ...
1176    ///     .build();
1177    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
1178    /// ```
1179    ///
1180    /// Customizing behavior major version:
1181    /// ```no_run
1182    /// use aws_sdk_agentregistry::config::BehaviorVersion;
1183    ///
1184    /// let config = aws_sdk_agentregistry::Config::builder()
1185    ///     .behavior_version(BehaviorVersion::v2023_11_09())
1186    ///     // ...
1187    ///     .build();
1188    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
1189    /// ```
1190    ///
1191    pub fn behavior_version(mut self, behavior_version: crate::config::BehaviorVersion) -> Self {
1192        self.set_behavior_version(Some(behavior_version));
1193        self
1194    }
1195
1196    /// Sets the [`behavior major version`](crate::config::BehaviorVersion).
1197    ///
1198    /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards
1199    /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for
1200    /// all operations might be the ideal behavior but could break existing applications.
1201    ///
1202    /// # Examples
1203    ///
1204    /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature.
1205    /// ```no_run
1206    /// use aws_sdk_agentregistry::config::BehaviorVersion;
1207    ///
1208    /// let config = aws_sdk_agentregistry::Config::builder()
1209    ///     .behavior_version(BehaviorVersion::latest())
1210    ///     // ...
1211    ///     .build();
1212    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
1213    /// ```
1214    ///
1215    /// Customizing behavior major version:
1216    /// ```no_run
1217    /// use aws_sdk_agentregistry::config::BehaviorVersion;
1218    ///
1219    /// let config = aws_sdk_agentregistry::Config::builder()
1220    ///     .behavior_version(BehaviorVersion::v2023_11_09())
1221    ///     // ...
1222    ///     .build();
1223    /// let client = aws_sdk_agentregistry::Client::from_conf(config);
1224    /// ```
1225    ///
1226    pub fn set_behavior_version(&mut self, behavior_version: Option<crate::config::BehaviorVersion>) -> &mut Self {
1227        self.behavior_version = behavior_version;
1228        self
1229    }
1230
1231    /// Convenience method to set the latest behavior major version
1232    ///
1233    /// This is equivalent to enabling the `behavior-version-latest` Cargo feature
1234    pub fn behavior_version_latest(mut self) -> Self {
1235        self.set_behavior_version(Some(crate::config::BehaviorVersion::latest()));
1236        self
1237    }
1238    /// Adds a runtime plugin to the config.
1239    #[allow(unused)]
1240    pub(crate) fn runtime_plugin(mut self, plugin: impl crate::config::RuntimePlugin + 'static) -> Self {
1241        self.push_runtime_plugin(crate::config::SharedRuntimePlugin::new(plugin));
1242        self
1243    }
1244    /// Adds a runtime plugin to the config.
1245    #[allow(unused)]
1246    pub(crate) fn push_runtime_plugin(&mut self, plugin: crate::config::SharedRuntimePlugin) -> &mut Self {
1247        self.runtime_plugins.push(plugin);
1248        self
1249    }
1250    #[cfg(any(feature = "test-util", test))]
1251    #[allow(unused_mut)]
1252    /// Apply test defaults to the builder. NOTE: Consider migrating to use `apply_test_defaults_v2` instead.
1253    pub fn apply_test_defaults(&mut self) -> &mut Self {
1254        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
1255            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
1256        )));
1257        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
1258        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
1259            ::aws_credential_types::Credentials::for_tests(),
1260        )));
1261        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
1262        self
1263    }
1264    #[cfg(any(feature = "test-util", test))]
1265    #[allow(unused_mut)]
1266    /// Apply test defaults to the builder. NOTE: Consider migrating to use `with_test_defaults_v2` instead.
1267    pub fn with_test_defaults(mut self) -> Self {
1268        self.apply_test_defaults();
1269        self
1270    }
1271    #[cfg(any(feature = "test-util", test))]
1272    #[allow(unused_mut)]
1273    /// Apply test defaults to the builder. V2 of this function sets additional test defaults such as region configuration (if applicable).
1274    pub fn apply_test_defaults_v2(&mut self) -> &mut Self {
1275        self.apply_test_defaults();
1276        if self.config.load::<crate::config::Region>().is_none() {
1277            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
1278        }
1279        self
1280    }
1281    #[cfg(any(feature = "test-util", test))]
1282    #[allow(unused_mut)]
1283    /// Apply test defaults to the builder. V2 of this function sets additional test defaults such as region configuration (if applicable).
1284    pub fn with_test_defaults_v2(mut self) -> Self {
1285        self.apply_test_defaults_v2();
1286        self
1287    }
1288    /// Builds a [`Config`].
1289    #[allow(unused_mut)]
1290    pub fn build(mut self) -> Config {
1291        let mut layer = self.config;
1292        if self.runtime_components.time_source().is_none() {
1293            self.runtime_components
1294                .set_time_source(::std::option::Option::Some(::std::default::Default::default()));
1295        }
1296        layer.store_put(crate::meta::API_METADATA.clone());
1297        layer.store_put(::aws_types::SigningName::from_static("agent-registry"));
1298        layer
1299            .load::<::aws_types::region::Region>()
1300            .cloned()
1301            .map(|r| layer.store_put(::aws_types::region::SigningRegion::from(r)));
1302        Config {
1303            config: crate::config::Layer::from(layer.clone())
1304                .with_name("aws_sdk_agentregistry::config::Config")
1305                .freeze(),
1306            cloneable: layer,
1307            runtime_components: self.runtime_components,
1308            runtime_plugins: self.runtime_plugins,
1309            behavior_version: self.behavior_version,
1310        }
1311    }
1312}
1313#[derive(::std::fmt::Debug)]
1314pub(crate) struct ServiceRuntimePlugin {
1315    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
1316    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
1317}
1318
1319impl ServiceRuntimePlugin {
1320    pub fn new(_service_config: crate::config::Config) -> Self {
1321        let config = {
1322            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AgentRegistry");
1323            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
1324            ::std::option::Option::Some(cfg.freeze())
1325        };
1326        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
1327        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
1328            use crate::config::auth::ResolveAuthScheme;
1329            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
1330        }));
1331        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
1332            use crate::config::endpoint::ResolveEndpoint;
1333            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
1334        }));
1335        runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
1336            ::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new(),
1337        ));
1338        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
1339        runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
1340            crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new(),
1341        ));
1342        runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
1343            ::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new(),
1344        ));
1345        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
1346        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
1347        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
1348        runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
1349            ::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new(),
1350        ));
1351        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
1352            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
1353        ));
1354        runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
1355            crate::config::endpoint::EndpointOverrideFeatureTrackerInterceptor,
1356        ));
1357        runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
1358            crate::observability_feature::ObservabilityFeatureTrackerInterceptor,
1359        ));
1360        Self { config, runtime_components }
1361    }
1362}
1363
1364impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
1365    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
1366        self.config.clone()
1367    }
1368
1369    fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
1370        ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
1371    }
1372
1373    fn runtime_components(
1374        &self,
1375        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
1376    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
1377        ::std::borrow::Cow::Borrowed(&self.runtime_components)
1378    }
1379}
1380
1381// Cross-operation shared-state singletons
1382
1383/// A plugin that enables configuration for a single operation invocation
1384///
1385/// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
1386/// In the case of default values requested, they will be obtained from `client_config`.
1387#[derive(Debug)]
1388pub(crate) struct ConfigOverrideRuntimePlugin {
1389    pub(crate) config: ::aws_smithy_types::config_bag::FrozenLayer,
1390    pub(crate) components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
1391}
1392
1393impl ConfigOverrideRuntimePlugin {
1394    #[allow(dead_code)] // unused when a service does not provide any operations
1395    pub(crate) fn new(
1396        config_override: Builder,
1397        initial_config: ::aws_smithy_types::config_bag::FrozenLayer,
1398        initial_components: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
1399    ) -> Self {
1400        let mut layer = config_override.config;
1401        let mut components = config_override.runtime_components;
1402        #[allow(unused_mut)]
1403        let mut resolver =
1404            ::aws_smithy_runtime::client::config_override::Resolver::overrid(initial_config, initial_components, &mut layer, &mut components);
1405
1406        resolver
1407            .config_mut()
1408            .load::<::aws_types::region::Region>()
1409            .cloned()
1410            .map(|r| resolver.config_mut().store_put(::aws_types::region::SigningRegion::from(r)));
1411
1412        let _ = resolver;
1413
1414        // When the config override supplies an identity resolver for any auth scheme
1415        // known to the client or the override itself, we give this operation its own
1416        // short-lived identity cache so that new partitions don't accumulate in the
1417        // shared client cache. A lazy cache (not `no_cache`) is used so that resolved
1418        // identities are served from the short-lived identity cache on retries.
1419        //
1420        // This is skipped if the override already sets its own identity cache.
1421        if components.has_identity_resolvers() && components.identity_cache().is_none() {
1422            components.set_identity_cache(::std::option::Option::Some(
1423                ::aws_smithy_runtime::client::identity::IdentityCache::lazy().max_partitions(1).build(),
1424            ));
1425        }
1426
1427        Self {
1428            config: ::aws_smithy_types::config_bag::Layer::from(layer)
1429                .with_name("aws_sdk_agentregistry::config::ConfigOverrideRuntimePlugin")
1430                .freeze(),
1431            components,
1432        }
1433    }
1434}
1435
1436impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
1437    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
1438        Some(self.config.clone())
1439    }
1440
1441    fn runtime_components(
1442        &self,
1443        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
1444    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
1445        ::std::borrow::Cow::Borrowed(&self.components)
1446    }
1447}
1448
1449pub use ::aws_smithy_runtime::client::identity::IdentityCache;
1450pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
1451pub use ::aws_smithy_types::config_bag::ConfigBag;
1452
1453pub use ::aws_credential_types::Credentials;
1454
1455impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
1456    fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
1457        let mut builder = Builder::default();
1458        builder.set_credentials_provider(input.credentials_provider());
1459        builder = builder.region(input.region().cloned());
1460        if input.get_origin("endpoint_url").is_client_config() {
1461            builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
1462        } else {
1463            builder.set_endpoint_url(
1464                input
1465                    .service_config()
1466                    .and_then(|conf| {
1467                        conf.load_config(service_config_key("Agent Registry", "AWS_ENDPOINT_URL", "endpoint_url"))
1468                            .map(|it| it.parse().unwrap())
1469                    })
1470                    .or_else(|| input.endpoint_url().map(|s| s.to_string())),
1471            );
1472        }
1473        // resiliency
1474        builder.set_retry_config(input.retry_config().cloned());
1475        builder.set_timeout_config(input.timeout_config().cloned());
1476        builder.set_sleep_impl(input.sleep_impl());
1477
1478        builder.set_http_client(input.http_client());
1479        builder.set_time_source(input.time_source());
1480        builder.set_behavior_version(input.behavior_version());
1481        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
1482        // setting `None` here removes the default
1483        if let Some(config) = input.stalled_stream_protection() {
1484            builder.set_stalled_stream_protection(Some(config));
1485        }
1486
1487        if let Some(cache) = input.identity_cache() {
1488            builder.set_identity_cache(cache);
1489        }
1490        builder.set_app_name(input.app_name().cloned());
1491        for framework_metadata in input.framework_metadata() {
1492            builder.push_framework_metadata(framework_metadata.clone());
1493        }
1494
1495        builder
1496    }
1497}
1498
1499impl From<&::aws_types::sdk_config::SdkConfig> for Config {
1500    fn from(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
1501        Builder::from(sdk_config).build()
1502    }
1503}
1504
1505pub use ::aws_types::app_name::AppName;
1506pub use ::aws_types::sdk_ua_metadata::FrameworkMetadata;
1507
1508#[allow(dead_code)]
1509fn service_config_key<'a>(service_id: &'a str, env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> {
1510    ::aws_types::service_config::ServiceConfigKey::builder()
1511        .service_id(service_id)
1512        .env(env)
1513        .profile(profile)
1514        .build()
1515        .expect("all field sets explicitly, can't fail")
1516}
1517
1518pub use ::aws_smithy_async::rt::sleep::Sleep;
1519
1520pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
1521    let mut configured_plugins = ::std::vec::Vec::new();
1522    ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins);
1523    #[cfg(feature = "behavior-version-latest")]
1524    {
1525        if config.behavior_version.is_none() {
1526            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
1527        }
1528    }
1529
1530    let default_retry_partition = "agentregistry";
1531    let default_retry_partition = match config.region() {
1532        Some(region) => ::std::borrow::Cow::from(format!("{default_retry_partition}-{region}")),
1533        None => ::std::borrow::Cow::from(default_retry_partition),
1534    };
1535
1536    let scope = "aws-sdk-agentregistry";
1537
1538    #[allow(deprecated)]
1539                    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
1540                        // defaults
1541                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
1542                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
1543                                .with_retry_partition_name(default_retry_partition)
1544                                .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."))
1545                                .with_is_aws_sdk(true)
1546                        ))
1547                        // user config
1548                        .with_client_plugin(
1549                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
1550                                .with_config(config.config.clone())
1551                                .with_runtime_components(config.runtime_components.clone())
1552                        )
1553                        // codegen config
1554                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
1555                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())
1556                        .with_client_plugin(
1557                            ::aws_smithy_runtime::client::metrics::MetricsRuntimePlugin::builder()
1558                                .with_scope(scope)
1559                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
1560                                .build()
1561                                .expect("All required fields have been set")
1562                        );
1563
1564    for plugin in configured_plugins {
1565        plugins = plugins.with_client_plugin(plugin);
1566    }
1567    plugins
1568}
1569
1570pub use ::aws_smithy_types::config_bag::FrozenLayer;
1571
1572pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
1573
1574pub use ::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin;
1575
1576pub use ::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
1577
1578pub use ::aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
1579
1580pub use ::aws_smithy_runtime_api::client::http::SharedHttpClient;
1581
1582pub use ::aws_smithy_async::rt::sleep::SharedAsyncSleep;
1583
1584pub use ::aws_smithy_runtime_api::client::identity::SharedIdentityCache;
1585
1586pub use ::aws_smithy_runtime_api::client::interceptors::SharedInterceptor;
1587
1588pub use ::aws_types::region::Region;
1589
1590pub use ::aws_credential_types::provider::SharedCredentialsProvider;
1591
1592pub use ::aws_smithy_runtime_api::client::http::HttpClient;
1593
1594pub use ::aws_smithy_runtime_api::shared::IntoShared;
1595
1596pub use ::aws_smithy_async::rt::sleep::AsyncSleep;
1597
1598pub use ::aws_smithy_runtime_api::client::identity::ResolveCachedIdentity;
1599
1600pub use ::aws_smithy_runtime_api::client::interceptors::Intercept;
1601
1602pub use ::aws_credential_types::provider::ProvideCredentials;
1603
1604pub use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
1605
1606pub use ::aws_smithy_types::config_bag::Layer;
1607
1608/// Types needed to configure endpoint resolution.
1609pub mod endpoint;
1610
1611/// HTTP request and response types.
1612pub mod http;
1613
1614/// Types needed to implement [`Intercept`](crate::config::Intercept).
1615pub mod interceptors;
1616
1617/// Retry configuration.
1618pub mod retry;
1619
1620/// Timeout configuration.
1621pub mod timeout;
1622
1623/// Types needed to configure auth scheme resolution.
1624pub mod auth;