Skip to content

Commit 40612a9

Browse files
ysaito1001jdisanti
andauthored
Move config_bag and type_erasure to aws-smithy-types (#2735)
## Motivation and Context This PR moves types and traits in those modules to the `aws-smithy-types` crate. ## Description This is to prepare for the upcoming refactoring where `SdkConfig` and service configs (and both of their builders) will be backed by `ConfigBag`. ## Testing - [x] Pass tests in CI ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] ~~I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates~~ ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Yuki Saito <awsaito@amazon.com> Co-authored-by: John DiSanti <jdisanti@amazon.com>
1 parent 8c045d2 commit 40612a9

File tree

52 files changed

+163
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+163
-130
lines changed

aws/rust-runtime/aws-inlineable/src/apigateway_interceptors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use aws_smithy_runtime_api::client::interceptors::{
99
BeforeTransmitInterceptorContextMut, BoxError, Interceptor,
1010
};
11-
use aws_smithy_runtime_api::config_bag::ConfigBag;
11+
use aws_smithy_types::config_bag::ConfigBag;
1212
use http::header::ACCEPT;
1313
use http::HeaderValue;
1414

aws/rust-runtime/aws-inlineable/src/glacier_interceptors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use aws_smithy_runtime_api::client::interceptors::{
1515
Interceptor,
1616
};
1717
use aws_smithy_runtime_api::client::orchestrator::LoadedRequestBody;
18-
use aws_smithy_runtime_api::config_bag::ConfigBag;
18+
use aws_smithy_types::config_bag::ConfigBag;
1919
use bytes::Bytes;
2020
use http::header::{HeaderName, HeaderValue};
2121
use http::Request;
@@ -234,7 +234,7 @@ fn compute_hash_tree(mut hashes: Vec<Digest>) -> Digest {
234234
mod account_id_autofill_tests {
235235
use super::*;
236236
use aws_smithy_runtime_api::client::interceptors::InterceptorContext;
237-
use aws_smithy_runtime_api::type_erasure::TypedBox;
237+
use aws_smithy_types::type_erasure::TypedBox;
238238

239239
#[test]
240240
fn autofill_account_id() {
@@ -273,7 +273,7 @@ mod account_id_autofill_tests {
273273
mod api_version_tests {
274274
use super::*;
275275
use aws_smithy_runtime_api::client::interceptors::InterceptorContext;
276-
use aws_smithy_runtime_api::type_erasure::TypedBox;
276+
use aws_smithy_types::type_erasure::TypedBox;
277277

278278
#[test]
279279
fn api_version_interceptor() {

aws/rust-runtime/aws-runtime/src/auth/sigv4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use aws_smithy_runtime_api::client::auth::{
1313
};
1414
use aws_smithy_runtime_api::client::identity::{Identity, IdentityResolver, IdentityResolvers};
1515
use aws_smithy_runtime_api::client::orchestrator::{BoxError, ConfigBagAccessors, HttpRequest};
16-
use aws_smithy_runtime_api::config_bag::ConfigBag;
16+
use aws_smithy_types::config_bag::ConfigBag;
1717
use aws_smithy_types::Document;
1818
use aws_types::region::{Region, SigningRegion};
1919
use aws_types::SigningService;

aws/rust-runtime/aws-runtime/src/identity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub mod credentials {
88
use aws_credential_types::cache::SharedCredentialsCache;
99
use aws_smithy_runtime_api::client::identity::{Identity, IdentityResolver};
1010
use aws_smithy_runtime_api::client::orchestrator::{BoxError, Future};
11-
use aws_smithy_runtime_api::config_bag::ConfigBag;
11+
use aws_smithy_types::config_bag::ConfigBag;
1212

1313
/// Smithy identity resolver for AWS credentials.
1414
#[derive(Debug)]

aws/rust-runtime/aws-runtime/src/invocation_id.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use aws_smithy_runtime_api::client::interceptors::error::BoxError;
77
use aws_smithy_runtime_api::client::interceptors::{
88
BeforeTransmitInterceptorContextMut, Interceptor,
99
};
10-
use aws_smithy_runtime_api::config_bag::ConfigBag;
10+
use aws_smithy_types::config_bag::ConfigBag;
1111
use http::{HeaderName, HeaderValue};
1212
use uuid::Uuid;
1313

@@ -75,8 +75,8 @@ mod tests {
7575
use crate::invocation_id::InvocationIdInterceptor;
7676
use aws_smithy_http::body::SdkBody;
7777
use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext};
78-
use aws_smithy_runtime_api::config_bag::ConfigBag;
79-
use aws_smithy_runtime_api::type_erasure::TypedBox;
78+
use aws_smithy_types::config_bag::ConfigBag;
79+
use aws_smithy_types::type_erasure::TypedBox;
8080
use http::HeaderValue;
8181

8282
fn expect_header<'a>(context: &'a InterceptorContext, header_name: &str) -> &'a HeaderValue {

aws/rust-runtime/aws-runtime/src/recursion_detection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use aws_smithy_runtime_api::client::interceptors::{
77
BeforeTransmitInterceptorContextMut, BoxError, Interceptor,
88
};
9-
use aws_smithy_runtime_api::config_bag::ConfigBag;
9+
use aws_smithy_types::config_bag::ConfigBag;
1010
use aws_types::os_shim_internal::Env;
1111
use http::HeaderValue;
1212
use percent_encoding::{percent_encode, CONTROLS};
@@ -75,7 +75,7 @@ mod tests {
7575
use aws_smithy_http::body::SdkBody;
7676
use aws_smithy_protocol_test::{assert_ok, validate_headers};
7777
use aws_smithy_runtime_api::client::interceptors::InterceptorContext;
78-
use aws_smithy_runtime_api::type_erasure::TypedBox;
78+
use aws_smithy_types::type_erasure::TypedBox;
7979
use aws_types::os_shim_internal::Env;
8080
use http::HeaderValue;
8181
use proptest::{prelude::*, proptest};

aws/rust-runtime/aws-runtime/src/request_info.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use aws_smithy_runtime::client::orchestrator::interceptors::{RequestAttempts, Se
77
use aws_smithy_runtime_api::client::interceptors::{
88
BeforeTransmitInterceptorContextMut, BoxError, Interceptor,
99
};
10-
use aws_smithy_runtime_api::config_bag::ConfigBag;
10+
use aws_smithy_types::config_bag::ConfigBag;
1111
use aws_smithy_types::date_time::Format;
1212
use aws_smithy_types::retry::RetryConfig;
1313
use aws_smithy_types::timeout::TimeoutConfig;
@@ -158,10 +158,10 @@ mod tests {
158158
use aws_smithy_http::body::SdkBody;
159159
use aws_smithy_runtime::client::orchestrator::interceptors::RequestAttempts;
160160
use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext};
161-
use aws_smithy_runtime_api::config_bag::ConfigBag;
162-
use aws_smithy_runtime_api::type_erasure::TypedBox;
161+
use aws_smithy_types::config_bag::ConfigBag;
163162
use aws_smithy_types::retry::RetryConfig;
164163
use aws_smithy_types::timeout::TimeoutConfig;
164+
use aws_smithy_types::type_erasure::TypedBox;
165165
use http::HeaderValue;
166166
use std::time::Duration;
167167

aws/rust-runtime/aws-runtime/src/user_agent.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use aws_smithy_runtime_api::client::interceptors::error::BoxError;
88
use aws_smithy_runtime_api::client::interceptors::{
99
BeforeTransmitInterceptorContextMut, Interceptor,
1010
};
11-
use aws_smithy_runtime_api::config_bag::ConfigBag;
11+
use aws_smithy_types::config_bag::ConfigBag;
1212
use aws_types::app_name::AppName;
1313
use aws_types::os_shim_internal::Env;
1414
use http::header::{InvalidHeaderValue, USER_AGENT};
@@ -110,9 +110,9 @@ mod tests {
110110
use super::*;
111111
use aws_smithy_http::body::SdkBody;
112112
use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext};
113-
use aws_smithy_runtime_api::config_bag::ConfigBag;
114-
use aws_smithy_runtime_api::type_erasure::TypedBox;
113+
use aws_smithy_types::config_bag::ConfigBag;
115114
use aws_smithy_types::error::display::DisplayErrorContext;
115+
use aws_smithy_types::type_erasure::TypedBox;
116116

117117
fn expect_header<'a>(context: &'a InterceptorContext, header_name: &str) -> &'a str {
118118
context

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCustomizableOperationDecorator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CustomizableOperationTestHelpers(runtimeConfig: RuntimeConfig) :
2222
.resolve("user_agent::AwsUserAgent"),
2323
"BeforeTransmitInterceptorContextMut" to RuntimeType.smithyRuntimeApi(runtimeConfig)
2424
.resolve("client::interceptors::BeforeTransmitInterceptorContextMut"),
25-
"ConfigBag" to RuntimeType.smithyRuntimeApi(runtimeConfig).resolve("config_bag::ConfigBag"),
25+
"ConfigBag" to RuntimeType.smithyTypes(runtimeConfig).resolve("config_bag::ConfigBag"),
2626
"ConfigBagAccessors" to RuntimeType.smithyRuntimeApi(runtimeConfig)
2727
.resolve("client::orchestrator::ConfigBagAccessors"),
2828
"http" to CargoDependency.Http.toType(),

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/RetryClassifierDecorator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class OperationRetryClassifiersFeature(
7575
"OperationError" to codegenContext.symbolProvider.symbolForOperationError(operationShape),
7676
"OrchestratorError" to smithyRuntimeApi.resolve("client::orchestrator::OrchestratorError"),
7777
"SdkError" to RuntimeType.smithyHttp(runtimeConfig).resolve("result::SdkError"),
78-
"ErasedError" to RuntimeType.smithyRuntimeApi(runtimeConfig).resolve("type_erasure::TypeErasedError"),
78+
"ErasedError" to RuntimeType.smithyTypes(runtimeConfig).resolve("type_erasure::TypeErasedError"),
7979
)
8080

8181
override fun section(section: OperationRuntimePluginSection) = when (section) {

0 commit comments

Comments
 (0)