Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export ByteStream's Length and FsBuilder in client crates #3796

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changelog/1724096455.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
applies_to:
- client
- aws-sdk-rust
authors:
- ysaito1001
references:
- aws-sdk-rust#820
breaking: false
new_feature: false
bug_fix: true
---
Re-export `ByteStream`'s `Length` and `FsBuilder`. By making these types available directly within a client crate, customers can use `ByteStream::read_from` without needing to import them separately from the `aws-smithy-types` crate.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,17 @@ fun pubUseSmithyPrimitives(
pub use #{ByteStream};
pub use #{AggregatedBytes};
pub use #{Error} as ByteStreamError;
##[cfg(feature = "rt-tokio")]
pub use #{FsBuilder};
##[cfg(feature = "rt-tokio")]
pub use #{Length};
pub use #{SdkBody};
""",
"ByteStream" to RuntimeType.smithyTypes(rc).resolve("byte_stream::ByteStream"),
"AggregatedBytes" to RuntimeType.smithyTypes(rc).resolve("byte_stream::AggregatedBytes"),
"Error" to RuntimeType.smithyTypes(rc).resolve("byte_stream::error::Error"),
"FsBuilder" to RuntimeType.smithyTypes(rc).resolve("byte_stream::FsBuilder"),
"Length" to RuntimeType.smithyTypes(rc).resolve("byte_stream::Length"),
"SdkBody" to RuntimeType.smithyTypes(rc).resolve("body::SdkBody"),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ class SmithyTypesPubUseExtraTest {
@Test
fun `it re-exports ByteStream and AggregatedBytes when a model has streaming`() {
val streamingTypes =
listOf("::aws_smithy_types::byte_stream::ByteStream", "::aws_smithy_types::byte_stream::AggregatedBytes")
listOf(
"::aws_smithy_types::byte_stream::ByteStream",
"::aws_smithy_types::byte_stream::AggregatedBytes",
"::aws_smithy_types::byte_stream::FsBuilder",
"::aws_smithy_types::byte_stream::Length",
)
val streamingShape = "@streaming blob Streaming"

this.assertDoesntHaveReexports(reexportsWithEmptyModel(), streamingTypes)
Expand Down