File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
aws/rust-runtime/aws-runtime/src Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ //! Endpoint override detection for business metrics tracking
7+
8+ use aws_smithy_runtime_api:: client:: runtime_plugin:: RuntimePlugin ;
9+ use aws_smithy_types:: config_bag:: { FrozenLayer , Layer } ;
10+
11+ use crate :: sdk_feature:: AwsSdkFeature ;
12+
13+ /// Runtime plugin that tracks when a custom endpoint URL has been configured.
14+ #[ derive( Debug , Default ) ]
15+ #[ non_exhaustive]
16+ pub struct EndpointOverrideRuntimePlugin {
17+ config : Option < FrozenLayer > ,
18+ }
19+
20+ impl EndpointOverrideRuntimePlugin {
21+ /// Creates a new `EndpointOverrideRuntimePlugin` with the endpoint override feature flag set
22+ pub fn new_with_feature_flag ( ) -> Self {
23+ let mut layer = Layer :: new ( "endpoint_override" ) ;
24+ layer. store_append ( AwsSdkFeature :: EndpointOverride ) ;
25+ Self {
26+ config : Some ( layer. freeze ( ) ) ,
27+ }
28+ }
29+ }
30+
31+ impl RuntimePlugin for EndpointOverrideRuntimePlugin {
32+ fn config ( & self ) -> Option < FrozenLayer > {
33+ self . config . clone ( )
34+ }
35+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ pub mod content_encoding;
2626/// Supporting code for recursion detection in the AWS SDK.
2727pub mod recursion_detection;
2828
29+ /// Supporting code for endpoint override detection in the AWS SDK.
30+ pub mod endpoint_override;
31+
2932/// Supporting code for user agent headers in the AWS SDK.
3033pub mod user_agent;
3134
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ pub enum AwsSdkFeature {
2424 SsoLoginDevice ,
2525 /// Calling an SSO-OIDC operation as part of the SSO login flow, when using the OAuth2.0 authorization code grant
2626 SsoLoginAuth ,
27+ /// Indicates that a custom endpoint URL was configured
28+ EndpointOverride ,
2729}
2830
2931impl Storable for AwsSdkFeature {
You can’t perform that action at this time.
0 commit comments