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