Unverified Commit cae35b7d authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Move `result` and `connection` from `aws-smithy-http` to `aws-smithy-runtime-api` (#3103)

## Motivation and Context
Implements #3092 

## Description
This PR moves the `connection` and `result` modules from
`aws-smithy-http` to `aws_smithy_runtime_api`. `SdkError` is primarily
used within the context of the orchestrator, hence
`aws_smithy_runtime_api` instead of `aws-smithy-types`.

Like the previous sibling PRs, type aliases for affected pub items are
left in `aws_smithy_http` for backwards compatibility. However, due to
lack of trait aliases, a trait `CreateUnhandledError` needs to be
consumed from `aws_smithy_runtime_api`.

This PR also updates existing places that consumed those moved types so
they now depend on `aws-smithy-runtime-api` to do so.

## Testing
Relied on the existing tests, which ensured no deprecated warnings of
using moved types from the old place were issued.

## Checklist
- [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._
parent 882ebaf7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -498,3 +498,11 @@ message = "`ByteStream::poll_next` is now feature-gated. You can turn on a cargo
references = ["smithy-rs#3033", "smithy-rs#3088"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" }
author = "ysaito1001"

[[smithy-rs]]
message = """
The [`connection`](https://docs.rs/aws-smithy-http/latest/aws_smithy_http/connection/index.html) and [`result`](https://docs.rs/aws-smithy-http/latest/aws_smithy_http/result/index.html) modules in `aws-smithy-http` have been moved to `aws-smithy-runtime-api`. Type aliases for all affected pub items, except for a trait, are left in `aws-smithy-http` for backwards compatibility but are deprecated. Due to lack of trait aliases, the moved trait `CreateUnhandledError` needs to be used from `aws-smithy-runtime-api`.
"""
references = ["smithy-rs#3092", "smithy-rs#3093"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "ysaito1001"
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ allowed_external_types = [
   "aws_smithy_async::time::TimeSource",
   "aws_smithy_http::endpoint",
   "aws_smithy_http::endpoint::error::InvalidEndpointError",
   "aws_smithy_http::result::SdkError",
   "aws_smithy_runtime_api::client::result::SdkError",
   "aws_smithy_runtime::client::identity::cache::IdentityCache",
   "aws_smithy_runtime::client::identity::cache::lazy::LazyCacheBuilder",
   "aws_smithy_runtime_api::client::dns::ResolveDns",
+1 −1
Original line number Diff line number Diff line
@@ -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::result::SdkError;
use aws_smithy_runtime::client::orchestrator::operation::Operation;
use aws_smithy_runtime::client::retries::classifiers::{
    HttpStatusCodeClassifier, TransientErrorClassifier,
@@ -22,6 +21,7 @@ use aws_smithy_runtime_api::client::interceptors::context::{Error, InterceptorCo
use aws_smithy_runtime_api::client::orchestrator::{
    HttpResponse, OrchestratorError, SensitiveOutput,
};
use aws_smithy_runtime_api::client::result::SdkError;
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;
+3 −3
Original line number Diff line number Diff line
@@ -13,8 +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::result::ConnectorError;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime::client::orchestrator::operation::Operation;
use aws_smithy_runtime::client::retries::strategy::StandardRetryStrategy;
use aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams;
@@ -25,6 +23,8 @@ use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;
use aws_smithy_runtime_api::client::orchestrator::{
    HttpRequest, OrchestratorError, SensitiveOutput,
};
use aws_smithy_runtime_api::client::result::ConnectorError;
use aws_smithy_runtime_api::client::result::SdkError;
use aws_smithy_runtime_api::client::retries::classifiers::{
    ClassifyRetry, RetryAction, SharedRetryClassifier,
};
@@ -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::result::ConnectorError;
    use aws_smithy_runtime::client::http::test_util::{
        capture_request, ReplayEvent, StaticReplayClient,
    };
@@ -593,6 +592,7 @@ pub(crate) mod test {
    use aws_smithy_runtime_api::client::orchestrator::{
        HttpRequest, HttpResponse, OrchestratorError,
    };
    use aws_smithy_runtime_api::client::result::ConnectorError;
    use aws_smithy_runtime_api::client::retries::classifiers::{ClassifyRetry, RetryAction};
    use aws_smithy_types::body::SdkBody;
    use aws_smithy_types::error::display::DisplayErrorContext;
+1 −1
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@
//! Error types for [`ImdsClient`](crate::imds::client::Client)

use aws_smithy_http::endpoint::error::InvalidEndpointError;
use aws_smithy_http::result::SdkError;
use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
use aws_smithy_runtime_api::client::result::SdkError;
use aws_smithy_types::body::SdkBody;
use std::error::Error;
use std::fmt;
Loading