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-point those using ByteStream and SdkBody to smithy-types #3076

Merged
Show file tree
Hide file tree
Changes from 5 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
16 changes: 16 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,19 @@ message = "The `idempotency_provider` field has been removed from config as a pu
references = ["smithy-rs#3072"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "rcoh"

[[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 being 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 being deprecated.
"""
references = ["smithy-rs#3076"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-config/src/http_credential_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-config/src/imds/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -582,7 +582,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,
Expand All @@ -595,6 +594,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;
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/imds/client/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/imds/client/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/imds/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/imds/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/sso/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/sts/assume_role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions aws/rust-runtime/aws-http/src/content_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-http/src/request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ 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_http::operation::error::BuildError;
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_types::body::{BoxBody, SdkBody};

use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
Expand Down Expand Up @@ -214,10 +214,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-inlineable/src/s3_request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/src/recursion_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/src/retries/classifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/dynamodb/tests/movies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/dynamodb/tests/paginators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/ec2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/ec2/tests/paginators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading
Loading