1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /*
|
3 + | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
4 + | * SPDX-License-Identifier: Apache-2.0
|
5 + | */
|
6 + |
|
7 + | use aws_runtime::sdk_feature::AwsSdkFeature;
|
8 + | use aws_smithy_runtime_api::{
|
9 + | box_error::BoxError,
|
10 + | client::interceptors::{context::BeforeSerializationInterceptorContextRef, Intercept},
|
11 + | };
|
12 + | use aws_smithy_types::config_bag::ConfigBag;
|
13 + | use aws_types::endpoint_config::EndpointUrl;
|
14 + |
|
15 + | /// Interceptor that tracks AWS SDK features for endpoint override.
|
16 + | #[derive(Debug, Default)]
|
17 + | pub(crate) struct EndpointOverrideFeatureTrackerInterceptor;
|
18 + |
|
19 + | impl Intercept for EndpointOverrideFeatureTrackerInterceptor {
|
20 + | fn name(&self) -> &'static str {
|
21 + | "EndpointOverrideFeatureTrackerInterceptor"
|
22 + | }
|
23 + |
|
24 + | fn read_before_execution(&self, _context: &BeforeSerializationInterceptorContextRef<'_>, cfg: &mut ConfigBag) -> Result<(), BoxError> {
|
25 + | if cfg.load::<EndpointUrl>().is_some() {
|
26 + | cfg.interceptor_state().store_append(AwsSdkFeature::EndpointOverride);
|
27 + | }
|
28 + | Ok(())
|
29 + | }
|
30 + | }
|