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