Re-point those using `ByteStream` and `SdkBody` to smithy-types (#3076)

# Motivation and Context
A follow-up on #3026

## Description
#3026 moved
- `aws_smithy_http::body::{BoxBody, Error, SdkBody}` to
`aws_smithy_types::body::{BoxBody, Error, SdkBody}`
- `aws_smithy_http::byte_stream::{AggregatedBytes, ByteStream,
error::Error}` to `aws_smithy_types::byte_stream::{AggregatedBytes,
ByteStream, error::Error}`

and also left "breadcrumbs", so that customers could still consume
updated types from `aws_smithy_http` after the move.

This PR turns breadcrumbs into deprecation messages (via
`#[deprecated(...)]`) and updates existing places that used to use moved
types from `aws_smithy_http` to directly depend on `aws_smithy_types`.

## Testing
Relied on 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._
This commit is contained in:
ysaito1001 2023-10-19 15:15:32 -05:00 committed by GitHub
parent e447a22794
commit ed8763e5df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 183 additions and 127 deletions

View File

@ -434,3 +434,19 @@ message = """
references = ["smithy-rs#3054", "smithy-rs#3070"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"
[[smithy-rs]]
message = """
`aws_smithy_http::body::{BoxBody, Error, SdkBody}` have been moved to `aws_smithy_types::body::{BoxBody, Error, SdkBody}`. Type aliases for them are left in `aws_smithy_http` for backwards compatibility but are deprecated.
"""
references = ["smithy-rs#3076"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"
[[smithy-rs]]
message = """
`aws_smithy_http::byte_stream::{AggregatedBytes, ByteStream, error::Error}` have been moved to `aws_smithy_types::byte_stream::{AggregatedBytes, ByteStream, error::Error}`. Type aliases for them are left in `aws_smithy_http` for backwards compatibility but are deprecated.
"""
references = ["smithy-rs#3076"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"

View File

@ -442,11 +442,11 @@ mod test {
use aws_credential_types::Credentials;
use aws_smithy_async::future::never::Never;
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_runtime_api::client::dns::DnsFuture;
use aws_smithy_runtime_api::client::http::HttpClient;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
use aws_types::os_shim_internal::Env;
use futures_util::FutureExt;
use http::header::AUTHORIZATION;

View File

@ -12,7 +12,6 @@ use crate::json_credentials::{parse_json_credentials, JsonCredentials, Refreshab
use crate::provider_config::ProviderConfig;
use aws_credential_types::provider::{self, error::CredentialsError};
use aws_credential_types::Credentials;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime::client::orchestrator::operation::Operation;
use aws_smithy_runtime::client::retries::classifiers::{
@ -26,6 +25,7 @@ use aws_smithy_runtime_api::client::orchestrator::{
use aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry;
use aws_smithy_runtime_api::client::retries::classifiers::RetryAction;
use aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::Layer;
use aws_smithy_types::retry::RetryConfig;
use aws_smithy_types::timeout::TimeoutConfig;
@ -220,8 +220,8 @@ impl ClassifyRetry for HttpCredentialRetryClassifier {
mod test {
use super::*;
use aws_credential_types::provider::error::CredentialsError;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use http::{Request, Response, Uri};
use std::time::SystemTime;

View File

@ -13,7 +13,6 @@ use crate::provider_config::ProviderConfig;
use crate::PKG_VERSION;
use aws_http::user_agent::{ApiMetadata, AwsUserAgent};
use aws_runtime::user_agent::UserAgentInterceptor;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::ConnectorError;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime::client::orchestrator::operation::Operation;
@ -31,6 +30,7 @@ use aws_smithy_runtime_api::client::retries::classifiers::{
};
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
use aws_smithy_runtime_api::client::runtime_plugin::{RuntimePlugin, SharedRuntimePlugin};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::{FrozenLayer, Layer};
use aws_smithy_types::endpoint::Endpoint;
use aws_smithy_types::retry::RetryConfig;
@ -583,7 +583,6 @@ pub(crate) mod test {
use crate::provider_config::ProviderConfig;
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_async::test_util::{instant_time_and_sleep, InstantSleep};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::ConnectorError;
use aws_smithy_runtime::client::http::test_util::{
capture_request, ReplayEvent, StaticReplayClient,
@ -596,6 +595,7 @@ pub(crate) mod test {
HttpRequest, HttpResponse, OrchestratorError,
};
use aws_smithy_runtime_api::client::retries::classifiers::{ClassifyRetry, RetryAction};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::error::display::DisplayErrorContext;
use aws_types::os_shim_internal::{Env, Fs};
use http::header::USER_AGENT;

View File

@ -5,10 +5,10 @@
//! Error types for [`ImdsClient`](crate::imds::client::Client)
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::endpoint::error::InvalidEndpointError;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
use aws_smithy_types::body::SdkBody;
use std::error::Error;
use std::fmt;

View File

@ -17,7 +17,6 @@
use crate::imds::client::error::{ImdsError, TokenError, TokenErrorKind};
use aws_credential_types::cache::ExpiringCache;
use aws_smithy_async::time::SharedTimeSource;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::orchestrator::operation::Operation;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver;
@ -32,6 +31,7 @@ use aws_smithy_runtime_api::client::runtime_components::{
GetIdentityResolver, RuntimeComponents, RuntimeComponentsBuilder,
};
use aws_smithy_runtime_api::client::runtime_plugin::{RuntimePlugin, SharedRuntimePlugin};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::ConfigBag;
use http::{HeaderValue, Uri};
use std::borrow::Cow;

View File

@ -289,8 +289,8 @@ mod test {
use crate::provider_config::ProviderConfig;
use aws_credential_types::provider::ProvideCredentials;
use aws_smithy_async::test_util::instant_time_and_sleep;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use std::time::{Duration, UNIX_EPOCH};
use tracing_test::traced_test;

View File

@ -111,8 +111,8 @@ mod test {
use crate::imds::region::ImdsRegionProvider;
use crate::provider_config::ProviderConfig;
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use aws_types::region::Region;
use tracing_test::traced_test;

View File

@ -389,13 +389,13 @@ mod tests {
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_async::test_util::instant_time_and_sleep;
use aws_smithy_async::time::{StaticTimeSource, TimeSource};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{
capture_request, ReplayEvent, StaticReplayClient,
};
use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs;
use aws_smithy_runtime_api::client::http::HttpClient;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::date_time::Format;
use aws_smithy_types::retry::RetryConfig;
use aws_smithy_types::DateTime;

View File

@ -349,11 +349,11 @@ mod test {
use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep};
use aws_smithy_async::test_util::instant_time_and_sleep;
use aws_smithy_async::time::StaticTimeSource;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{
capture_request, ReplayEvent, StaticReplayClient,
};
use aws_smithy_runtime::test_util::capture_test_logs::capture_test_logs;
use aws_smithy_types::body::SdkBody;
use aws_types::os_shim_internal::Env;
use aws_types::region::Region;
use aws_types::SdkConfig;

View File

@ -199,10 +199,10 @@ fn total_rendered_length_of_trailers(trailer_map: Option<&HeaderMap>) -> u64 {
impl<Inner> Body for AwsChunkedBody<Inner>
where
Inner: Body<Data = Bytes, Error = aws_smithy_http::body::Error>,
Inner: Body<Data = Bytes, Error = aws_smithy_types::body::Error>,
{
type Data = Bytes;
type Error = aws_smithy_http::body::Error;
type Error = aws_smithy_types::body::Error;
fn poll_data(
self: Pin<&mut Self>,
@ -354,7 +354,7 @@ mod tests {
AwsChunkedBodyOptions, CHUNK_TERMINATOR, CRLF,
};
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use bytes::{Buf, Bytes};
use bytes_utils::SegmentedBuf;
use http::{HeaderMap, HeaderValue};
@ -382,7 +382,7 @@ mod tests {
impl Body for SputteringBody {
type Data = Bytes;
type Error = aws_smithy_http::body::Error;
type Error = aws_smithy_types::body::Error;
fn poll_data(
self: Pin<&mut Self>,

View File

@ -94,7 +94,7 @@ fn extract_request_id(headers: &HeaderMap<HeaderValue>) -> Option<&str> {
#[cfg(test)]
mod tests {
use super::*;
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use http::Response;
#[test]

View File

@ -15,15 +15,14 @@ use ring::digest::{Context, Digest, SHA256};
use aws_runtime::auth::SigV4OperationSigningConfig;
use aws_sigv4::http_request::SignableBody;
use aws_smithy_http::byte_stream;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
BeforeSerializationInterceptorContextMut, BeforeTransmitInterceptorContextMut,
};
use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, LoadedRequestBody};
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::byte_stream;
use aws_smithy_types::config_bag::ConfigBag;
/// The default account ID when none is set on an input

View File

@ -12,15 +12,14 @@ use aws_runtime::auth::SigV4OperationSigningConfig;
use aws_sigv4::http_request::SignableBody;
use aws_smithy_checksums::ChecksumAlgorithm;
use aws_smithy_checksums::{body::calculate, http::HttpChecksum};
use aws_smithy_http::body::{BoxBody, SdkBody};
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
BeforeSerializationInterceptorContextRef, BeforeTransmitInterceptorContextMut, Input,
};
use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::body::{BoxBody, SdkBody};
use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace};
use aws_smithy_types::error::operation::BuildError;
use http::HeaderValue;
@ -214,10 +213,10 @@ fn wrap_streaming_request_body_in_checksum_calculating_body(
mod tests {
use crate::http_request_checksum::wrap_streaming_request_body_in_checksum_calculating_body;
use aws_smithy_checksums::ChecksumAlgorithm;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::byte_stream::ByteStream;
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_types::base64;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::byte_stream::ByteStream;
use bytes::BytesMut;
use http_body::Body;
use tempfile::NamedTempFile;

View File

@ -8,13 +8,13 @@
//! Interceptor for handling Smithy `@httpChecksum` response checksumming
use aws_smithy_checksums::ChecksumAlgorithm;
use aws_smithy_http::body::{BoxBody, SdkBody};
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
BeforeDeserializationInterceptorContextMut, BeforeSerializationInterceptorContextRef, Input,
};
use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::body::{BoxBody, SdkBody};
use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace};
use http::HeaderValue;
use std::{fmt, mem};
@ -219,8 +219,8 @@ fn is_part_level_checksum(checksum: &str) -> bool {
#[cfg(test)]
mod tests {
use super::{is_part_level_checksum, wrap_body_with_checksum_validator};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::byte_stream::ByteStream;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::byte_stream::ByteStream;
use aws_smithy_types::error::display::DisplayErrorContext;
use bytes::Bytes;

View File

@ -94,8 +94,8 @@ fn extract_extended_request_id(headers: &HeaderMap<HeaderValue>) -> Option<&str>
#[cfg(test)]
mod test {
use super::*;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::SdkError;
use aws_smithy_types::body::SdkBody;
use http::Response;
#[test]

View File

@ -78,10 +78,10 @@ fn encode_header(value: &[u8]) -> HeaderValue {
#[cfg(test)]
mod tests {
use super::*;
use aws_smithy_http::body::SdkBody;
use aws_smithy_protocol_test::{assert_ok, validate_headers};
use aws_smithy_runtime_api::client::interceptors::context::{Input, InterceptorContext};
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
use aws_smithy_types::body::SdkBody;
use aws_types::os_shim_internal::Env;
use http::HeaderValue;
use proptest::{prelude::*, proptest};

View File

@ -111,11 +111,11 @@ where
#[cfg(test)]
mod test {
use crate::retries::classifiers::AwsErrorCodeClassifier;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;
use aws_smithy_runtime_api::client::interceptors::context::{Error, Input};
use aws_smithy_runtime_api::client::orchestrator::OrchestratorError;
use aws_smithy_runtime_api::client::retries::classifiers::{ClassifyRetry, RetryAction};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::error::metadata::ProvideErrorMetadata;
use aws_smithy_types::error::ErrorMetadata;
use aws_smithy_types::retry::ErrorKind;

View File

@ -8,7 +8,7 @@ use async_trait::async_trait;
use aws_config::SdkConfig;
use aws_sdk_s3 as s3;
use aws_sdk_s3::Client;
use aws_smithy_http::byte_stream::AggregatedBytes;
use aws_smithy_types::byte_stream::AggregatedBytes;
use std::fmt;
use std::fs::File;
use std::os::unix::fs::FileExt;

View File

@ -9,7 +9,7 @@ use async_trait::async_trait;
use aws_config::SdkConfig;
use aws_sdk_s3 as s3;
use aws_sdk_s3::Client;
use aws_smithy_http::byte_stream::ByteStream;
use aws_smithy_types::byte_stream::ByteStream;
use s3::types::CompletedMultipartUpload;
use s3::types::CompletedPart;
use std::io::SeekFrom;

View File

@ -4,9 +4,9 @@
*/
use aws_sdk_dynamodb::operation::query::QueryOutput;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
use aws_smithy_runtime_api::client::ser_de::{ResponseDeserializer, SharedResponseDeserializer};
use aws_smithy_types::body::SdkBody;
use criterion::{criterion_group, criterion_main, Criterion};
fn do_bench() {

View File

@ -5,8 +5,8 @@
use aws_sdk_dynamodb as dynamodb;
use aws_smithy_async::assert_elapsed;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use dynamodb::config::{Credentials, Region};
use dynamodb::operation::query::QueryOutput;
use dynamodb::types::{

View File

@ -9,12 +9,12 @@ use std::iter::FromIterator;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_http::body::SdkBody;
use aws_smithy_protocol_test::{assert_ok, validate_body, MediaType};
use aws_smithy_runtime::client::http::test_util::{
capture_request, ReplayEvent, StaticReplayClient,
};
use aws_smithy_runtime_api::client::http::HttpClient;
use aws_smithy_types::body::SdkBody;
use aws_types::region::Region;
fn stub_config(http_client: impl HttpClient + 'static) -> Config {

View File

@ -7,10 +7,10 @@ use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smithy_async::test_util::instant_time_and_sleep;
use aws_smithy_async::time::SharedTimeSource;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_runtime::client::retries::RetryPartition;
use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
use aws_smithy_types::body::SdkBody;
use std::time::{Duration, SystemTime};
fn req() -> http::Request<SdkBody> {

View File

@ -9,9 +9,9 @@ publish = false
[dev-dependencies]
aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] }
aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" }
aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" }
aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] }
aws-smithy-runtime-api = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" }
aws-sdk-ec2 = { path = "../../build/aws-sdk/sdk/ec2" }
tokio = { version = "1.23.1", features = ["full"]}
http = "0.2.0"

View File

@ -4,9 +4,9 @@
*/
use aws_sdk_ec2::{config::Credentials, config::Region, types::InstanceType, Client, Config};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_runtime_api::client::http::HttpClient;
use aws_smithy_types::body::SdkBody;
fn stub_config(http_client: impl HttpClient + 'static) -> Config {
Config::builder()

View File

@ -5,9 +5,9 @@
use aws_sdk_kms as kms;
use aws_sdk_kms::operation::RequestId;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use http::header::AUTHORIZATION;
use http::Uri;
use kms::config::{Config, Credentials, Region};

View File

@ -8,8 +8,8 @@
use aws_sdk_qldbsession::config::{Config, Credentials, Region};
use aws_sdk_qldbsession::types::StartSessionRequest;
use aws_sdk_qldbsession::Client;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use http::Uri;
#[cfg(feature = "test-util")]

View File

@ -11,10 +11,10 @@ use aws_sdk_s3::config::{Credentials, Region};
use aws_sdk_s3::types::ChecksumMode;
use aws_sdk_s3::{operation::get_object::GetObjectOutput, types::ChecksumAlgorithm};
use aws_sdk_s3::{Client, Config};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{
capture_request, ReplayEvent, StaticReplayClient,
};
use aws_smithy_types::body::SdkBody;
use http::header::AUTHORIZATION;
use http::{HeaderValue, Uri};
use std::time::{Duration, UNIX_EPOCH};
@ -315,7 +315,7 @@ async fn test_sha256_checksum_on_streaming_request() {
.await
}
async fn collect_body_into_string(mut body: aws_smithy_http::body::SdkBody) -> String {
async fn collect_body_into_string(mut body: aws_smithy_types::body::SdkBody) -> String {
use bytes::Buf;
use bytes_utils::SegmentedBuf;
use http_body::Body;

View File

@ -8,8 +8,8 @@
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_sdk_s3::Config;
use aws_sdk_s3::{config::Credentials, config::Region, types::ObjectAttributes, Client};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use http::header::AUTHORIZATION;
const RESPONSE_BODY_XML: &[u8] = b"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<GetObjectAttributesResponse xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Checksum><ChecksumSHA1>e1AsOh9IyGCa4hLN+2Od7jlnP14=</ChecksumSHA1></Checksum></GetObjectAttributesResponse>";

View File

@ -6,8 +6,8 @@
use aws_sdk_s3::operation::get_object::GetObjectError;
use aws_sdk_s3::operation::{RequestId, RequestIdExt};
use aws_sdk_s3::{config::Credentials, config::Region, Client, Config};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::capture_request;
use aws_smithy_types::body::SdkBody;
#[tokio::test]
async fn get_request_id_from_modeled_error() {

View File

@ -7,8 +7,8 @@ use aws_sdk_s3::config::interceptors::InterceptorContext;
use aws_sdk_s3::config::retry::{ClassifyRetry, RetryAction, RetryConfig};
use aws_sdk_s3::config::SharedAsyncSleep;
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
use std::sync::{Arc, Mutex};
#[derive(Debug, Clone)]

View File

@ -8,8 +8,8 @@
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_sdk_s3::config::{Credentials, Region};
use aws_sdk_s3::{Client, Config};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
#[tokio::test]
async fn test_signer() {

View File

@ -6,8 +6,8 @@
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_credential_types::Credentials;
use aws_sdk_s3::Client;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::infallible_client_fn;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::error::metadata::ProvideErrorMetadata;
use aws_types::region::Region;
use aws_types::SdkConfig;

View File

@ -20,7 +20,7 @@ aws-http = { path = "../../build/aws-sdk/sdk/aws-http" }
aws-sdk-s3control = { path = "../../build/aws-sdk/sdk/s3control", features = ["test-util"] }
aws-smithy-async = { path = "../../build/aws-sdk/sdk/aws-smithy-async" }
aws-smithy-runtime = { path = "../../build/aws-sdk/sdk/aws-smithy-runtime", features = ["client", "test-util"] }
aws-smithy-http = { path = "../../build/aws-sdk/sdk/aws-smithy-http" }
aws-smithy-types = { path = "../../build/aws-sdk/sdk/aws-smithy-types" }
aws-types = { path = "../../build/aws-sdk/sdk/aws-types" }
bytes = "1.0.0"
http = "0.2.0"

View File

@ -6,8 +6,8 @@
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_sdk_s3control::config::{Credentials, Region};
use aws_sdk_s3control::{Client, Config};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
use aws_smithy_types::body::SdkBody;
#[tokio::test]
async fn test_signer() {

View File

@ -3,13 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::http::{
HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
};
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
pub(crate) fn make_request(_req: http::Request<SdkBody>) -> Result<http::Response<SdkBody>, ()> {
// Consumers here would pass the HTTP request to

View File

@ -43,13 +43,13 @@ internal class StreamingShapeSymbolProviderTest {
modelWithOperationTraits.lookup<MemberShape>("test.synthetic#GenerateSpeechOutput\$data").also { shape ->
symbolProvider.toSymbol(shape).also { symbol ->
symbol.name shouldBe "data"
symbol.rustType() shouldBe RustType.Opaque("ByteStream", "::aws_smithy_http::byte_stream")
symbol.rustType() shouldBe RustType.Opaque("ByteStream", "::aws_smithy_types::byte_stream")
}
}
modelWithOperationTraits.lookup<MemberShape>("test.synthetic#GenerateSpeechInput\$data").also { shape ->
symbolProvider.toSymbol(shape).also { symbol ->
symbol.name shouldBe "data"
symbol.rustType() shouldBe RustType.Opaque("ByteStream", "::aws_smithy_http::byte_stream")
symbol.rustType() shouldBe RustType.Opaque("ByteStream", "::aws_smithy_types::byte_stream")
}
}
}

View File

@ -159,10 +159,10 @@ internal class EndpointTraitBindingsTest {
"""
async fn test_endpoint_prefix() {
use #{capture_request};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::endpoint::EndpointPrefix;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::ConfigBag;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, Mutex};

View File

@ -58,7 +58,7 @@ class AwsQueryCompatibleTest {
##[cfg(test)]
##[#{tokio}::test]
async fn should_parse_code_and_type_fields() {
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
let response = |_: http::Request<SdkBody>| {
http::Response::builder()
@ -138,7 +138,7 @@ class AwsQueryCompatibleTest {
##[cfg(test)]
##[#{tokio}::test]
async fn should_parse_code_from_payload() {
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
let response = |_: http::Request<SdkBody>| {
http::Response::builder()

View File

@ -95,14 +95,14 @@ fun Array<Writable>.join(separator: Writable) = asIterable().join(separator)
* "type_params" to rustTypeParameters(
* symbolProvider.toSymbol(operation),
* RustType.Unit,
* runtimeConfig.smithyHttp().resolve("body::SdkBody"),
* runtimeConfig.smithyTypes().resolve("body::SdkBody"),
* GenericsGenerator(GenericTypeArg("A"), GenericTypeArg("B")),
* )
* )
* ```
* would write out something like:
* ```rust
* some_fn::<crate::operation::SomeOperation, (), aws_smithy_http::body::SdkBody, A, B>();
* some_fn::<crate::operation::SomeOperation, (), aws_smithy_types::body::SdkBody, A, B>();
* ```
*/
fun rustTypeParameters(

View File

@ -394,7 +394,7 @@ data class RuntimeType(val path: String, val dependency: RustDependency? = null)
smithyRuntimeApi(runtimeConfig).resolve("client::interceptors::context::FinalizerInterceptorContextMut")
fun blob(runtimeConfig: RuntimeConfig) = smithyTypes(runtimeConfig).resolve("Blob")
fun byteStream(runtimeConfig: RuntimeConfig) = smithyHttp(runtimeConfig).resolve("byte_stream::ByteStream")
fun byteStream(runtimeConfig: RuntimeConfig) = smithyTypes(runtimeConfig).resolve("byte_stream::ByteStream")
fun dateTime(runtimeConfig: RuntimeConfig) = smithyTypes(runtimeConfig).resolve("DateTime")
fun document(runtimeConfig: RuntimeConfig): RuntimeType = smithyTypes(runtimeConfig).resolve("Document")
fun format(runtimeConfig: RuntimeConfig) = smithyTypes(runtimeConfig).resolve("date_time::Format")
@ -429,7 +429,7 @@ data class RuntimeType(val path: String, val dependency: RustDependency? = null)
smithyTypes(runtimeConfig).resolve("retry::ProvideErrorKind")
fun queryFormat(runtimeConfig: RuntimeConfig, func: String) = smithyHttp(runtimeConfig).resolve("query::$func")
fun sdkBody(runtimeConfig: RuntimeConfig): RuntimeType = smithyHttp(runtimeConfig).resolve("body::SdkBody")
fun sdkBody(runtimeConfig: RuntimeConfig): RuntimeType = smithyTypes(runtimeConfig).resolve("body::SdkBody")
fun sdkError(runtimeConfig: RuntimeConfig): RuntimeType = smithyHttp(runtimeConfig).resolve("result::SdkError")
fun sdkSuccess(runtimeConfig: RuntimeConfig): RuntimeType =
smithyHttp(runtimeConfig).resolve("result::SdkSuccess")

View File

@ -64,10 +64,10 @@ fun pubUseSmithyPrimitives(codegenContext: CodegenContext, model: Model): Writab
pub use #{Error} as ByteStreamError;
pub use #{SdkBody};
""",
"ByteStream" to RuntimeType.smithyHttp(rc).resolve("byte_stream::ByteStream"),
"AggregatedBytes" to RuntimeType.smithyHttp(rc).resolve("byte_stream::AggregatedBytes"),
"Error" to RuntimeType.smithyHttp(rc).resolve("byte_stream::error::Error"),
"SdkBody" to RuntimeType.smithyHttp(rc).resolve("body::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"),
"SdkBody" to RuntimeType.smithyTypes(rc).resolve("body::SdkBody"),
)
}
}

View File

@ -105,7 +105,7 @@ class SmithyTypesPubUseExtraTest {
@Test
fun `it re-exports ByteStream and AggregatedBytes when a model has streaming`() {
val streamingTypes =
listOf("::aws_smithy_http::byte_stream::ByteStream", "::aws_smithy_http::byte_stream::AggregatedBytes")
listOf("::aws_smithy_types::byte_stream::ByteStream", "::aws_smithy_types::byte_stream::AggregatedBytes")
val streamingShape = "@streaming blob Streaming"
this.assertDoesntHaveReexports(reexportsWithEmptyModel(), streamingTypes)

View File

@ -98,7 +98,7 @@ sealed class ServerHttpBoundProtocolSection(name: String) : Section(name) {
* Represent a section for rendering the serialized stream payload.
*
* If the payload does not implement the `futures_core::stream::Stream`, which is the case for
* `aws_smithy_http::byte_stream::ByteStream`, the section needs to be overridden and renders a new-type wrapper
* `aws_smithy_types::byte_stream::ByteStream`, the section needs to be overridden and renders a new-type wrapper
* around the payload to enable the `Stream` trait.
*/
data class WrapStreamPayload(val params: StreamPayloadSerializerParams) :
@ -189,8 +189,8 @@ class ServerHttpBoundProtocolTraitImplGenerator(
"OnceCell" to RuntimeType.OnceCell,
"PercentEncoding" to RuntimeType.PercentEncoding,
"Regex" to RuntimeType.Regex,
"SmithyHttp" to RuntimeType.smithyHttp(runtimeConfig),
"SmithyHttpServer" to ServerCargoDependency.smithyHttpServer(runtimeConfig).toType(),
"SmithyTypes" to RuntimeType.smithyTypes(runtimeConfig),
"RuntimeError" to protocol.runtimeError(runtimeConfig),
"RequestRejection" to protocol.requestRejection(runtimeConfig),
"ResponseRejection" to protocol.responseRejection(runtimeConfig),
@ -1269,7 +1269,7 @@ class ServerHttpBoundProtocolTraitImplGenerator(
private fun streamingBodyTraitBounds(operationShape: OperationShape) =
if (operationShape.inputShape(model).hasStreamingMember(model)) {
"\n B: Into<#{SmithyHttp}::byte_stream::ByteStream>,"
"\n B: Into<#{SmithyTypes}::byte_stream::ByteStream>,"
} else {
""
}

View File

@ -28,7 +28,7 @@ class StreamPayloadSerializerCustomization() : ServerHttpBoundProtocolCustomizat
// implements the `Stream` trait, so no need to wrap it in the new-type.
section.params.payloadGenerator.generatePayload(this, section.params.shapeName, section.params.shape)
} else {
// Otherwise, the stream payload is `aws_smithy_http::byte_stream::ByteStream`. We wrap it in the
// Otherwise, the stream payload is `aws_smithy_types::byte_stream::ByteStream`. We wrap it in the
// new-type to enable the `Stream` trait.
withBlockTemplate(
"#{FuturesStreamCompatByteStream}::new(",

View File

@ -18,8 +18,8 @@ tower = "0.4"
# Local paths
aws-smithy-runtime = { path = "../../rust-runtime/aws-smithy-runtime", features = ["client", "connector-hyper-0-14-x"] }
aws-smithy-runtime-api = { path = "../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-http = { path = "../../rust-runtime/aws-smithy-http" }
aws-smithy-http-server = { path = "../../rust-runtime/aws-smithy-http-server" }
aws-smithy-types = { path = "../../rust-runtime/aws-smithy-types" }
pokemon-service-client = { path = "../pokemon-service-client" }
pokemon-service-server-sdk = { path = "../pokemon-service-server-sdk" }

View File

@ -15,10 +15,10 @@ use std::{
};
use async_stream::stream;
use aws_smithy_http::{body::SdkBody, byte_stream::ByteStream};
use aws_smithy_http_server::Extension;
use aws_smithy_runtime::client::http::hyper_014::HyperConnector;
use aws_smithy_runtime_api::client::http::HttpConnector;
use aws_smithy_types::{body::SdkBody, byte_stream::ByteStream};
use http::Uri;
use pokemon_service_server_sdk::{
error, input, model, model::CapturingPayload, output, types::Blob,

View File

@ -7,8 +7,8 @@
use crate::http::HttpChecksum;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::header::append_merge_header_maps;
use aws_smithy_types::body::SdkBody;
use http::HeaderMap;
use http_body::SizeHint;
@ -38,7 +38,7 @@ impl ChecksumBody<SdkBody> {
impl http_body::Body for ChecksumBody<SdkBody> {
type Data = bytes::Bytes;
type Error = aws_smithy_http::body::Error;
type Error = aws_smithy_types::body::Error;
fn poll_data(
self: Pin<&mut Self>,
@ -99,8 +99,8 @@ impl http_body::Body for ChecksumBody<SdkBody> {
mod tests {
use super::ChecksumBody;
use crate::{http::CRC_32_HEADER_NAME, ChecksumAlgorithm, CRC_32_NAME};
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::base64;
use aws_smithy_types::body::SdkBody;
use bytes::Buf;
use bytes_utils::SegmentedBuf;
use http_body::Body;

View File

@ -8,7 +8,7 @@
use crate::http::HttpChecksum;
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use bytes::Bytes;
use http::{HeaderMap, HeaderValue};
@ -48,7 +48,7 @@ impl ChecksumBody<SdkBody> {
fn poll_inner(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Bytes, aws_smithy_http::body::Error>>> {
) -> Poll<Option<Result<Bytes, aws_smithy_types::body::Error>>> {
use http_body::Body;
let this = self.project();
@ -126,7 +126,7 @@ impl std::error::Error for Error {}
impl http_body::Body for ChecksumBody<SdkBody> {
type Data = Bytes;
type Error = aws_smithy_http::body::Error;
type Error = aws_smithy_types::body::Error;
fn poll_data(
self: Pin<&mut Self>,
@ -155,7 +155,7 @@ impl http_body::Body for ChecksumBody<SdkBody> {
mod tests {
use crate::body::validate::{ChecksumBody, Error};
use crate::ChecksumAlgorithm;
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use bytes::{Buf, Bytes};
use bytes_utils::SegmentedBuf;
use http_body::Body;

View File

@ -10,8 +10,8 @@ use futures_util::stream;
use hyper::Body;
use pyo3::{prelude::*, py_run};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http_server_python::types::ByteStream;
use aws_smithy_types::body::SdkBody;
#[pyo3_asyncio::tokio::test]
fn consuming_stream_on_python_synchronously() -> PyResult<()> {

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
//! Python wrapped types from aws-smithy-types and aws-smithy-http.
//! Python wrapped types from aws-smithy-types.
//!
//! ## `Deref` hacks for Json serializer
//! [aws_smithy_json::serialize::JsonValueWriter] expects references to the types
@ -301,11 +301,11 @@ impl Deref for DateTime {
}
}
/// Python Wrapper for [aws_smithy_http::byte_stream::ByteStream].
/// Python Wrapper for [aws_smithy_types::byte_stream::ByteStream].
///
/// ByteStream provides misuse-resistant primitives to make it easier to handle common patterns with streaming data.
///
/// On the Rust side, The Python implementation wraps the original [ByteStream](aws_smithy_http::byte_stream::ByteStream)
/// On the Rust side, The Python implementation wraps the original [ByteStream](aws_smithy_types::byte_stream::ByteStream)
/// in a clonable structure and implements the [Stream](futures::stream::Stream) trait for it to
/// allow Rust to handle the type transparently.
///
@ -332,17 +332,17 @@ impl Deref for DateTime {
/// effectively maintaining the asyncronous behavior that Rust exposes, while the sync one is blocking the Tokio runtime to be able
/// to await one chunk at a time.
///
/// The original Rust [ByteStream](aws_smithy_http::byte_stream::ByteStream) is wrapped inside a `Arc<Mutex>` to allow the type to be
/// The original Rust [ByteStream](aws_smithy_types::byte_stream::ByteStream) is wrapped inside a `Arc<Mutex>` to allow the type to be
/// [Clone] (required by PyO3) and to allow internal mutability, required to fetch the next chunk of data.
///
/// :param input bytes:
/// :rtype None:
#[pyclass]
#[derive(Debug, Clone)]
pub struct ByteStream(Arc<Mutex<aws_smithy_http::byte_stream::ByteStream>>);
pub struct ByteStream(Arc<Mutex<aws_smithy_types::byte_stream::ByteStream>>);
impl futures::stream::Stream for ByteStream {
type Item = Result<Bytes, aws_smithy_http::byte_stream::error::Error>;
type Item = Result<Bytes, aws_smithy_types::byte_stream::error::Error>;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let stream = self.0.lock();
@ -356,7 +356,7 @@ impl futures::stream::Stream for ByteStream {
/// Return a new data chunk from the stream.
async fn yield_data_chunk(
body: Arc<Mutex<aws_smithy_http::byte_stream::ByteStream>>,
body: Arc<Mutex<aws_smithy_types::byte_stream::ByteStream>>,
) -> PyResult<Option<Bytes>> {
let mut stream = body.lock().await;
stream
@ -367,37 +367,37 @@ async fn yield_data_chunk(
}
impl ByteStream {
/// Construct a new [ByteStream](aws_smithy_http::byte_stream::ByteStream) from a
/// [SdkBody](aws_smithy_http::body::SdkBody).
/// Construct a new [`ByteStream`](aws_smithy_types::byte_stream::ByteStream) from a
/// [`SdkBody`](aws_smithy_types::body::SdkBody).
///
/// This method is available only to Rust and it is required to comply with the
/// interface required by the code generator.
pub fn new(body: aws_smithy_http::body::SdkBody) -> Self {
pub fn new(body: aws_smithy_types::body::SdkBody) -> Self {
Self(Arc::new(Mutex::new(
aws_smithy_http::byte_stream::ByteStream::new(body),
aws_smithy_types::byte_stream::ByteStream::new(body),
)))
}
}
impl Default for ByteStream {
fn default() -> Self {
Self::new(aws_smithy_http::body::SdkBody::from(""))
Self::new(aws_smithy_types::body::SdkBody::from(""))
}
}
#[pymethods]
impl ByteStream {
/// Create a new [ByteStream](aws_smithy_http::byte_stream::ByteStream) from a slice of bytes.
/// Create a new [ByteStream](aws_smithy_types::byte_stream::ByteStream) from a slice of bytes.
#[new]
pub fn newpy(input: &[u8]) -> Self {
Self(Arc::new(Mutex::new(
aws_smithy_http::byte_stream::ByteStream::new(aws_smithy_http::body::SdkBody::from(
aws_smithy_types::byte_stream::ByteStream::new(aws_smithy_types::body::SdkBody::from(
input,
)),
)))
}
/// Create a new [ByteStream](aws_smithy_http::byte_stream::ByteStream) from a path, without
/// Create a new [ByteStream](aws_smithy_types::byte_stream::ByteStream) from a path, without
/// requiring Python to await this method.
///
/// **NOTE:** This method will block the Rust event loop when it is running.
@ -407,7 +407,7 @@ impl ByteStream {
#[staticmethod]
pub fn from_path_blocking(py: Python, path: String) -> PyResult<Py<PyAny>> {
let byte_stream = Handle::current().block_on(async {
aws_smithy_http::byte_stream::ByteStream::from_path(path)
aws_smithy_types::byte_stream::ByteStream::from_path(path)
.await
.map_err(|e| PyRuntimeError::new_err(e.to_string()))
})?;
@ -415,7 +415,7 @@ impl ByteStream {
Ok(result.into_py(py))
}
/// Create a new [ByteStream](aws_smithy_http::byte_stream::ByteStream) from a path, forcing
/// Create a new [ByteStream](aws_smithy_types::byte_stream::ByteStream) from a path, forcing
/// Python to await this coroutine.
///
/// :param path str:
@ -423,7 +423,7 @@ impl ByteStream {
#[staticmethod]
pub fn from_path(py: Python, path: String) -> PyResult<&PyAny> {
pyo3_asyncio::tokio::future_into_py(py, async move {
let byte_stream = aws_smithy_http::byte_stream::ByteStream::from_path(path)
let byte_stream = aws_smithy_types::byte_stream::ByteStream::from_path(path)
.await
.map_err(|e| PyRuntimeError::new_err(e.to_string()))?;
Ok(Self(Arc::new(Mutex::new(byte_stream))))
@ -440,7 +440,7 @@ impl ByteStream {
/// Return the next item from the iterator. If there are no further items, raise the StopIteration exception.
/// PyO3 allows to raise the correct exception using the enum [IterNextOutput](pyo3::pyclass::IterNextOutput).
///
/// To get tnext value of the iterator, the `Arc` inner stream is cloned and the Rust call to `next()` is executed
/// To get the next value of the iterator, the `Arc` inner stream is cloned and the Rust call to `next()` is executed
/// inside a call blocking the Tokio runtime.
///
/// More info: `<https://docs.python.org/3/reference/datamodel.html#object.__next__.>`

View File

@ -0,0 +1,21 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//TODO(runtimeCratesVersioningCleanup): Re-point those who use the deprecated type aliases to
// directly depend on `aws_smithy_types` and remove this module.
//! Types for representing the body of an HTTP request or response
/// A boxed generic HTTP body that, when consumed, will result in [`Bytes`](bytes::Bytes) or an [`Error`](aws_smithy_types::body::Error).
#[deprecated(note = "Moved to `aws_smithy_types::body::BoxBody`.")]
pub type BoxBody = aws_smithy_types::body::BoxBody;
/// A generic, boxed error that's `Send` and `Sync`
#[deprecated(note = "`Moved to `aws_smithy_types::body::Error`.")]
pub type Error = aws_smithy_types::body::Error;
/// SdkBody type
#[deprecated(note = "Moved to `aws_smithy_types::body::SdkBody`.")]
pub type SdkBody = aws_smithy_types::body::SdkBody;

View File

@ -0,0 +1,24 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//TODO(runtimeCratesVersioningCleanup): Re-point those who use the deprecated type aliases to
// directly depend on `aws_smithy_types` and remove this module.
//! ByteStream Abstractions
/// Non-contiguous Binary Data Storage
#[deprecated(note = "Moved to `aws_smithy_types::byte_stream::AggregatedBytes`.")]
pub type AggregatedBytes = aws_smithy_types::byte_stream::AggregatedBytes;
/// Stream of binary data
#[deprecated(note = "Moved to `aws_smithy_types::byte_stream::ByteStream`.")]
pub type ByteStream = aws_smithy_types::byte_stream::ByteStream;
/// Errors related to bytestreams.
pub mod error {
/// An error occurred in the byte stream
#[deprecated(note = "Moved to `aws_smithy_types::byte_stream::error::Error`.")]
pub type Error = aws_smithy_types::byte_stream::error::Error;
}

View File

@ -3,11 +3,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
use crate::body::SdkBody;
use crate::result::{ConnectorError, SdkError};
use aws_smithy_eventstream::frame::{
DecodedFrame, Message, MessageFrameDecoder, UnmarshallMessage, UnmarshalledMessage,
};
use aws_smithy_types::body::SdkBody;
use bytes::Buf;
use bytes::Bytes;
use bytes_utils::SegmentedBuf;
@ -276,10 +276,10 @@ impl<T, E> Receiver<T, E> {
#[cfg(test)]
mod tests {
use super::{Receiver, UnmarshallMessage};
use crate::body::SdkBody;
use crate::result::SdkError;
use aws_smithy_eventstream::error::Error as EventStreamError;
use aws_smithy_eventstream::frame::{Header, HeaderValue, Message, UnmarshalledMessage};
use aws_smithy_types::body::SdkBody;
use bytes::Bytes;
use hyper::body::Body;
use std::error::Error as StdError;

View File

@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
use crate::body::SdkBody;
use crate::byte_stream::error::Error as ByteStreamError;
use crate::byte_stream::ByteStream;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::byte_stream::error::Error as ByteStreamError;
use aws_smithy_types::byte_stream::ByteStream;
use bytes::Bytes;
use futures_core::stream::Stream;
use std::pin::Pin;

View File

@ -25,11 +25,8 @@
#![allow(clippy::derive_partial_eq_without_eq)]
#![cfg_attr(docsrs, feature(doc_cfg))]
//TODO(runtimeCratesVersioningCleanup): Re-point those who use the following reexports to
// directly depend on `aws_smithy_types` and remove the reexports below.
pub use aws_smithy_types::body;
pub use aws_smithy_types::byte_stream;
pub mod body;
pub mod byte_stream;
pub mod endpoint;
// Marked as `doc(hidden)` because a type in the module is used both by this crate and by the code
// generator, but not by external users. Also, by the module being `doc(hidden)` instead of it being

View File

@ -5,8 +5,8 @@
//! Types for [error](SdkError) responses.
use crate::body::SdkBody;
use crate::connection::ConnectionMetadata;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::error::metadata::{ProvideErrorMetadata, EMPTY_ERROR_METADATA};
use aws_smithy_types::error::ErrorMetadata;
use aws_smithy_types::retry::ErrorKind;

View File

@ -5,7 +5,7 @@
//! Http Request Types
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use http as http0;
use http::header::{InvalidHeaderName, InvalidHeaderValue};
use http::uri::InvalidUri;
@ -616,7 +616,7 @@ fn header_value(value: MaybeStatic) -> Result<HeaderValue, HttpError> {
#[cfg(test)]
mod test {
use crate::client::orchestrator::HttpRequest;
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use http::header::{AUTHORIZATION, CONTENT_LENGTH};
use http::{HeaderValue, Uri};

View File

@ -428,7 +428,7 @@ impl fmt::Display for RewindResult {
#[cfg(all(test, feature = "test-util"))]
mod tests {
use super::*;
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use http::header::{AUTHORIZATION, CONTENT_LENGTH};
use http::{HeaderValue, Uri};

View File

@ -20,8 +20,8 @@ use crate::box_error::BoxError;
use crate::client::interceptors::context::phase::Phase;
use crate::client::interceptors::context::Error;
use crate::client::interceptors::InterceptorError;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::{ConnectorError, SdkError};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::{Storable, StoreReplace};
use bytes::Bytes;
use std::error::Error as StdError;

View File

@ -308,7 +308,7 @@ mod tests {
use crate::client::runtime_components::RuntimeComponentsBuilder;
use crate::client::runtime_plugin::{Order, SharedRuntimePlugin};
use crate::shared::IntoShared;
use aws_smithy_http::body::SdkBody;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::ConfigBag;
use http::HeaderValue;
use std::borrow::Cow;

View File

@ -284,9 +284,9 @@ impl Sign for DigestAuthSigner {
#[cfg(test)]
mod tests {
use super::*;
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::identity::http::Login;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
use aws_smithy_types::body::SdkBody;
#[test]
fn test_api_key_signing_headers() {

View File

@ -6,7 +6,6 @@
use crate::client::http::connection_poisoning::CaptureSmithyConnection;
use aws_smithy_async::future::timeout::TimedOutError;
use aws_smithy_async::rt::sleep::{default_async_sleep, AsyncSleep, SharedAsyncSleep};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::connection::ConnectionMetadata;
use aws_smithy_http::result::ConnectorError;
use aws_smithy_runtime_api::box_error::BoxError;
@ -17,6 +16,7 @@ use aws_smithy_runtime_api::client::http::{
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::error::display::DisplayErrorContext;
use aws_smithy_types::retry::ErrorKind;
use http::{Extensions, Uri};

View File

@ -3,13 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::http::{
HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
};
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
use std::fmt::Debug;
use std::sync::{Arc, Mutex};
use tokio::sync::oneshot;

View File

@ -246,9 +246,9 @@ impl From<Bytes> for BodyData {
#[cfg(test)]
mod tests {
use super::*;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::byte_stream::ByteStream;
use aws_smithy_runtime_api::client::http::{HttpConnector, SharedHttpConnector};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::byte_stream::ByteStream;
use bytes::Bytes;
use http::Uri;
use std::error::Error;

View File

@ -7,13 +7,13 @@ use super::{
Action, BodyData, ConnectionId, Direction, Error, Event, NetworkTraffic, Request, Response,
Version,
};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::http::{
HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpConnector,
};
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
use http_body::Body;
use std::path::Path;
use std::sync::atomic::{AtomicUsize, Ordering};

View File

@ -4,7 +4,6 @@
*/
use super::{Action, ConnectionId, Direction, Event, NetworkTraffic};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::ConnectorError;
use aws_smithy_protocol_test::MediaType;
use aws_smithy_runtime_api::client::http::{
@ -13,6 +12,7 @@ use aws_smithy_runtime_api::client::http::{
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::error::display::DisplayErrorContext;
use bytes::{Bytes, BytesMut};
use http::{Request, Version};

View File

@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::ConnectorError;
use aws_smithy_runtime_api::client::http::{
HttpClient, HttpConnector, HttpConnectorFuture, HttpConnectorSettings, SharedHttpClient,
@ -12,6 +11,7 @@ use aws_smithy_runtime_api::client::http::{
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_runtime_api::shared::IntoShared;
use aws_smithy_types::body::SdkBody;
use std::fmt;
use std::sync::Arc;

View File

@ -116,8 +116,8 @@ impl ValidateRequest {
/// # Example
///
/// ```no_run
/// use aws_smithy_http::body::SdkBody;
/// use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
/// use aws_smithy_types::body::SdkBody;
///
/// let http_client = StaticReplayClient::new(vec![
/// // Event that covers the first request/response

View File

@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
BeforeSerializationInterceptorContextRef, BeforeTransmitInterceptorContextMut,
@ -17,6 +16,7 @@ use aws_smithy_runtime_api::client::interceptors::{
};
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::ConfigBag;
use aws_smithy_types::error::display::DisplayErrorContext;
use std::error::Error as StdError;

View File

@ -12,8 +12,6 @@ use crate::client::orchestrator::endpoints::orchestrate_endpoint;
use crate::client::orchestrator::http::{log_response_body, read_body};
use crate::client::timeout::{MaybeTimeout, MaybeTimeoutConfig, TimeoutKind};
use aws_smithy_async::rt::sleep::AsyncSleep;
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::byte_stream::ByteStream;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::http::{HttpClient, HttpConnector, HttpConnectorSettings};
@ -29,6 +27,8 @@ use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins;
use aws_smithy_runtime_api::client::ser_de::{
DeserializeResponse, SerializeRequest, SharedRequestSerializer, SharedResponseDeserializer,
};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::byte_stream::ByteStream;
use aws_smithy_types::config_bag::ConfigBag;
use aws_smithy_types::timeout::TimeoutConfig;
use std::mem;

View File

@ -3,8 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::orchestrator::{HttpResponse, SensitiveOutput};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::config_bag::ConfigBag;
use bytes::{Buf, Bytes};
use http_body::Body;

View File

@ -398,8 +398,8 @@ mod tests {
use crate::client::http::test_util::{capture_request, ReplayEvent, StaticReplayClient};
use crate::client::retries::classifiers::HttpStatusCodeClassifier;
use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep};
use aws_smithy_http::body::SdkBody;
use aws_smithy_http::result::ConnectorError;
use aws_smithy_types::body::SdkBody;
use std::convert::Infallible;
#[tokio::test]

View File

@ -218,10 +218,10 @@ mod test {
use crate::client::retries::classifiers::{
HttpStatusCodeClassifier, ModeledAsRetryableClassifier,
};
use aws_smithy_http::body::SdkBody;
use aws_smithy_runtime_api::client::interceptors::context::{Error, Input, InterceptorContext};
use aws_smithy_runtime_api::client::orchestrator::OrchestratorError;
use aws_smithy_runtime_api::client::retries::classifiers::{ClassifyRetry, RetryAction};
use aws_smithy_types::body::SdkBody;
use aws_smithy_types::retry::{ErrorKind, ProvideErrorKind};
use std::fmt;

View File

@ -13,7 +13,6 @@ use ::aws_smithy_runtime::client::retries::classifiers::{
HttpStatusCodeClassifier, TransientErrorClassifier,
};
use aws_smithy_async::rt::sleep::TokioSleep;
use aws_smithy_http::body::{BoxBody, SdkBody};
use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
use aws_smithy_runtime::client::http::test_util::wire::{
RecordedEvent, ReplayedEvent, WireMockServer,
@ -24,6 +23,7 @@ use aws_smithy_runtime::{ev, match_events};
use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;
use aws_smithy_runtime_api::client::orchestrator::OrchestratorError;
use aws_smithy_runtime_api::client::retries::classifiers::{ClassifyRetry, RetryAction};
use aws_smithy_types::body::{BoxBody, SdkBody};
use aws_smithy_types::retry::{ErrorKind, ProvideErrorKind, ReconnectMode, RetryConfig};
use aws_smithy_types::timeout::TimeoutConfig;
use hyper::client::Builder as HyperBuilder;