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