diff --git a/aws/rust-runtime/aws-inlineable/src/s3_request_id.rs b/aws/rust-runtime/aws-inlineable/src/s3_request_id.rs index 53b23c3cf21..07aa060d310 100644 --- a/aws/rust-runtime/aws-inlineable/src/s3_request_id.rs +++ b/aws/rust-runtime/aws-inlineable/src/s3_request_id.rs @@ -5,11 +5,7 @@ use aws_smithy_runtime_api::client::result::SdkError; use aws_smithy_runtime_api::http::{Headers, Response}; -use aws_smithy_types::error::metadata::{ - Builder as ErrorMetadataBuilder, ErrorMetadata, ProvideErrorMetadata, -}; -#[allow(deprecated)] -use aws_smithy_types::error::Unhandled; +use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata}; const EXTENDED_REQUEST_ID: &str = "s3_extended_request_id"; @@ -37,13 +33,6 @@ impl RequestIdExt for ErrorMetadata { } } -#[allow(deprecated)] -impl RequestIdExt for Unhandled { - fn extended_request_id(&self) -> Option<&str> { - self.meta().extended_request_id() - } -} - impl RequestIdExt for Response { fn extended_request_id(&self) -> Option<&str> { self.headers().extended_request_id() @@ -92,7 +81,7 @@ mod test { fn handle_missing_header() { let resp = Response::try_from(http::Response::builder().status(400).body("").unwrap()).unwrap(); - let mut builder = aws_smithy_types::Error::builder().message("123"); + let mut builder = ErrorMetadata::builder().message("123"); builder = apply_extended_request_id(builder, resp.headers()); assert_eq!(builder.build().extended_request_id(), None); } diff --git a/aws/rust-runtime/aws-runtime/src/retries/classifiers.rs b/aws/rust-runtime/aws-runtime/src/retries/classifiers.rs index 89e5923c1ef..9655bec82b3 100644 --- a/aws/rust-runtime/aws-runtime/src/retries/classifiers.rs +++ b/aws/rust-runtime/aws-runtime/src/retries/classifiers.rs @@ -167,7 +167,7 @@ mod test { #[test] fn classify_generic() { let policy = AwsErrorCodeClassifier::::new(); - let err = aws_smithy_types::Error::builder().code("SlowDown").build(); + let err = ErrorMetadata::builder().code("SlowDown").build(); let test_response = http::Response::new("OK").map(SdkBody::from); let mut ctx = InterceptorContext::new(Input::doesnt_matter()); @@ -180,7 +180,7 @@ mod test { #[test] fn test_retry_after_header() { let policy = AwsErrorCodeClassifier::::new(); - let err = aws_smithy_types::Error::builder().code("SlowDown").build(); + let err = ErrorMetadata::builder().code("SlowDown").build(); let res = http::Response::builder() .header("x-amz-retry-after", "5000") .body("retry later") diff --git a/aws/rust-runtime/aws-types/src/request_id.rs b/aws/rust-runtime/aws-types/src/request_id.rs index 97dff4b110a..2d5be5a094d 100644 --- a/aws/rust-runtime/aws-types/src/request_id.rs +++ b/aws/rust-runtime/aws-types/src/request_id.rs @@ -8,12 +8,7 @@ use aws_smithy_runtime_api::client::result::SdkError; use aws_smithy_runtime_api::http::Headers; use aws_smithy_runtime_api::http::Response; -use aws_smithy_types::error::metadata::{ - Builder as ErrorMetadataBuilder, ErrorMetadata, ProvideErrorMetadata, -}; - -#[allow(deprecated)] -use aws_smithy_types::error::Unhandled; +use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata}; /// Constant for the [`ErrorMetadata`] extra field that contains the request ID const AWS_REQUEST_ID: &str = "aws_request_id"; @@ -40,13 +35,6 @@ impl RequestId for ErrorMetadata { } } -#[allow(deprecated)] -impl RequestId for Unhandled { - fn request_id(&self) -> Option<&str> { - self.meta().request_id() - } -} - impl RequestId for Response { fn request_id(&self) -> Option<&str> { self.headers().request_id() diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecoratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecoratorTest.kt index b2d7984b2d8..e235144f2d7 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecoratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/HttpAuthDecoratorTest.kt @@ -113,7 +113,6 @@ class HttpAuthDecoratorTest { IdentityFuture, ResolveIdentity, SharedIdentityResolver, }; use aws_smithy_runtime_api::box_error::BoxError; - use aws_smithy_runtime_api::client::auth::Signer; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_runtime_api::client::runtime_components::{ GetIdentityResolver, RuntimeComponentsBuilder, @@ -164,7 +163,7 @@ class HttpAuthDecoratorTest { #[derive(Debug)] struct CustomIdentity(String); - impl Signer for CustomSigner { + impl Sign for CustomSigner { fn sign_http_request( &self, request: &mut HttpRequest, diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/error/OperationErrorGeneratorTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/error/OperationErrorGeneratorTest.kt index 590b7acb9c4..1f1b7032411 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/error/OperationErrorGeneratorTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/error/OperationErrorGeneratorTest.kt @@ -53,11 +53,12 @@ class OperationErrorGeneratorTest { name = "generates_combined_error_enums", test = """ use crate::operation::greeting::GreetingError; + use aws_smithy_types::error::ErrorMetadata; let error = GreetingError::InvalidGreeting( InvalidGreeting::builder() .message("an error") - .meta(aws_smithy_types::Error::builder().code("InvalidGreeting").message("an error").build()) + .meta(ErrorMetadata::builder().code("InvalidGreeting").message("an error").build()) .build() ); assert_eq!(format!("{}", error), "InvalidGreeting: an error"); @@ -71,7 +72,7 @@ class OperationErrorGeneratorTest { assert_eq!(error.is_complex_error(), false); // Unhandled variants properly delegate message. - let error = GreetingError::generic(aws_smithy_types::Error::builder().message("hello").build()); + let error = GreetingError::generic(ErrorMetadata::builder().message("hello").build()); assert_eq!(error.meta().message(), Some("hello")); let error = GreetingError::unhandled("some other error"); diff --git a/rust-runtime/aws-smithy-http/src/body.rs b/rust-runtime/aws-smithy-http/src/body.rs deleted file mode 100644 index efcc29b7125..00000000000 --- a/rust-runtime/aws-smithy-http/src/body.rs +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -//TODO(runtimeCratesVersioningCleanup): Keep the following deprecated type aliases for at least -// one release since 0.56.1 and then remove this module. - -//! Types for representing the body of an HTTP request or response - -/// 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; diff --git a/rust-runtime/aws-smithy-http/src/byte_stream.rs b/rust-runtime/aws-smithy-http/src/byte_stream.rs deleted file mode 100644 index 06da29636b2..00000000000 --- a/rust-runtime/aws-smithy-http/src/byte_stream.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -//TODO(runtimeCratesVersioningCleanup): Keep the following deprecated type aliases for at least -// one release since 0.56.1 and then 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; -} - -/// Builder for creating [`ByteStreams`](aws_smithy_types::byte_stream::ByteStream) from a file/path, with full control over advanced options. -#[cfg(feature = "rt-tokio")] -#[deprecated(note = "Moved to `aws_smithy_types::byte_stream::FsBuilder`.")] -pub type FsBuilder = aws_smithy_types::byte_stream::FsBuilder; - -/// The length (in bytes) to read. Determines whether or not a short read counts as an error. -#[cfg(feature = "rt-tokio")] -#[deprecated(note = "Moved to `aws_smithy_types::byte_stream::Length`.")] -pub type Length = aws_smithy_types::byte_stream::Length; diff --git a/rust-runtime/aws-smithy-http/src/connection.rs b/rust-runtime/aws-smithy-http/src/connection.rs deleted file mode 100644 index e8219a0b60c..00000000000 --- a/rust-runtime/aws-smithy-http/src/connection.rs +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -//TODO(runtimeCratesVersioningCleanup): Keep the following deprecated type alias for at least -// one release since 0.56.1 and then remove this module. - -//! Types related to connection monitoring and management. - -/// Metadata that tracks the state of an active connection. -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::connection::ConnectionMetadata`.")] -pub type ConnectionMetadata = aws_smithy_runtime_api::client::connection::ConnectionMetadata; diff --git a/rust-runtime/aws-smithy-http/src/event_stream/sender.rs b/rust-runtime/aws-smithy-http/src/event_stream/sender.rs index f0dc00fa978..c822da96e1b 100644 --- a/rust-runtime/aws-smithy-http/src/event_stream/sender.rs +++ b/rust-runtime/aws-smithy-http/src/event_stream/sender.rs @@ -5,6 +5,7 @@ use aws_smithy_eventstream::frame::{write_message_to, MarshallMessage, SignMessage}; use aws_smithy_runtime_api::client::result::SdkError; +use aws_smithy_types::error::ErrorMetadata; use bytes::Bytes; use futures_core::Stream; use std::error::Error as StdError; @@ -55,7 +56,7 @@ where #[derive(Debug)] pub struct MessageStreamError { kind: MessageStreamErrorKind, - pub(crate) meta: aws_smithy_types::Error, + pub(crate) meta: ErrorMetadata, } #[derive(Debug)] @@ -72,8 +73,8 @@ impl MessageStreamError { } } - /// Creates the `MessageStreamError::Unhandled` variant from a `aws_smithy_types::Error`. - pub fn generic(err: aws_smithy_types::Error) -> Self { + /// Creates the `MessageStreamError::Unhandled` variant from an [`ErrorMetadata`]. + pub fn generic(err: ErrorMetadata) -> Self { Self { meta: err.clone(), kind: MessageStreamErrorKind::Unhandled(err.into()), @@ -82,7 +83,7 @@ impl MessageStreamError { /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - pub fn meta(&self) -> &aws_smithy_types::Error { + pub fn meta(&self) -> &ErrorMetadata { &self.meta } } diff --git a/rust-runtime/aws-smithy-http/src/lib.rs b/rust-runtime/aws-smithy-http/src/lib.rs index 3b6113037c4..3ff51ea99a6 100644 --- a/rust-runtime/aws-smithy-http/src/lib.rs +++ b/rust-runtime/aws-smithy-http/src/lib.rs @@ -25,8 +25,6 @@ #![allow(clippy::derive_partial_eq_without_eq)] #![cfg_attr(docsrs, feature(doc_cfg))] -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 @@ -40,10 +38,8 @@ pub mod operation; pub mod query; #[doc(hidden)] pub mod query_writer; -pub mod result; #[cfg(feature = "event-stream")] pub mod event_stream; -pub mod connection; mod urlencode; diff --git a/rust-runtime/aws-smithy-http/src/operation.rs b/rust-runtime/aws-smithy-http/src/operation.rs index 7fad89f1e14..cba50828712 100644 --- a/rust-runtime/aws-smithy-http/src/operation.rs +++ b/rust-runtime/aws-smithy-http/src/operation.rs @@ -9,19 +9,6 @@ use aws_smithy_types::config_bag::{Storable, StoreReplace}; use std::borrow::Cow; -//TODO(runtimeCratesVersioningCleanup): Re-point those who use the deprecated type aliases to -// directly depend on `aws_smithy_types` and remove the type aliases below. -/// Errors for operations -pub mod error { - /// An error occurred attempting to build an `Operation` from an input. - #[deprecated(note = "Moved to `aws_smithy_types::error::operation::BuildError`.")] - pub type BuildError = aws_smithy_types::error::operation::BuildError; - - /// An error that occurs when serialization of an operation fails. - #[deprecated(note = "Moved to `aws_smithy_types::error::operation::SerializationError`.")] - pub type SerializationError = aws_smithy_types::error::operation::SerializationError; -} - /// Metadata added to the [`ConfigBag`](aws_smithy_types::config_bag::ConfigBag) that identifies the API being called. #[derive(Clone, Debug)] pub struct Metadata { diff --git a/rust-runtime/aws-smithy-http/src/result.rs b/rust-runtime/aws-smithy-http/src/result.rs deleted file mode 100644 index c7e5458845a..00000000000 --- a/rust-runtime/aws-smithy-http/src/result.rs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -//TODO(runtimeCratesVersioningCleanup): Keep the following deprecated type aliases for at least -// one release since 0.56.1 and then remove this module. - -//! Types for [`error`](aws_smithy_runtime_api::client::result::SdkError) responses. - -/// Builders for `SdkError` variant context. -pub mod builders { - /// Builder for [`ConstructionFailure`](aws_smithy_runtime_api::client::result::ConstructionFailure). - #[deprecated( - note = "Moved to `aws_smithy_runtime_api::client::result::builders::ConstructionFailureBuilder`." - )] - pub type ConstructionFailureBuilder = - aws_smithy_runtime_api::client::result::builders::ConstructionFailureBuilder; - - /// Builder for [`TimeoutError`](aws_smithy_runtime_api::client::result::TimeoutError). - #[deprecated( - note = "Moved to `aws_smithy_runtime_api::client::result::builders::TimeoutErrorBuilder`." - )] - pub type TimeoutErrorBuilder = - aws_smithy_runtime_api::client::result::builders::TimeoutErrorBuilder; - - /// Builder for [`DispatchFailure`](aws_smithy_runtime_api::client::result::DispatchFailure). - #[deprecated( - note = "Moved to `aws_smithy_runtime_api::client::result::builders::DispatchFailureBuilder`." - )] - pub type DispatchFailureBuilder = - aws_smithy_runtime_api::client::result::builders::DispatchFailureBuilder; - - /// Builder for [`ResponseError`](aws_smithy_runtime_api::client::result::ResponseError). - #[deprecated( - note = "Moved to `aws_smithy_runtime_api::client::result::builders::ResponseErrorBuilder`." - )] - pub type ResponseErrorBuilder = - aws_smithy_runtime_api::client::result::builders::ResponseErrorBuilder; - - /// Builder for [`ServiceError`](aws_smithy_runtime_api::client::result::ServiceError). - #[deprecated( - note = "Moved to `aws_smithy_runtime_api::client::result::builders::ServiceErrorBuilder`." - )] - pub type ServiceErrorBuilder = - aws_smithy_runtime_api::client::result::builders::ServiceErrorBuilder; -} - -/// Error context for [`aws_smithy_runtime_api::client::result::ConstructionFailure`] -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::ConstructionFailure`.")] -pub type ConstructionFailure = aws_smithy_runtime_api::client::result::ConstructionFailure; - -/// Error context for [`aws_smithy_runtime_api::client::result::TimeoutError`] -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::TimeoutError`.")] -pub type TimeoutError = aws_smithy_runtime_api::client::result::TimeoutError; - -/// Error context for [`aws_smithy_runtime_api::client::result::DispatchFailure`] -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::DispatchFailure`.")] -pub type DispatchFailure = aws_smithy_runtime_api::client::result::DispatchFailure; - -/// Error context for [`aws_smithy_runtime_api::client::result::ResponseError`] -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::ResponseError`.")] -pub type ResponseError = aws_smithy_runtime_api::client::result::ResponseError; - -/// Failed SDK Result -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::ServiceError`.")] -pub type ServiceError = aws_smithy_runtime_api::client::result::ServiceError; - -/// Failed SDK Result -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::SdkError`.")] -pub type SdkError = aws_smithy_runtime_api::client::result::SdkError; - -/// Error from the underlying Connector -#[deprecated(note = "Moved to `aws_smithy_runtime_api::client::result::ConnectorError`.")] -pub type ConnectorError = aws_smithy_runtime_api::client::result::ConnectorError; diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/auth.rs b/rust-runtime/aws-smithy-runtime-api/src/client/auth.rs index 8cc11806f9e..3c435ae7e4b 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/auth.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/auth.rs @@ -81,9 +81,6 @@ impl Storable for AuthSchemeOptionResolverParams { type Storer = StoreReplace; } -#[deprecated(note = "Renamed to ResolveAuthSchemeOptions.")] -pub use ResolveAuthSchemeOptions as AuthSchemeOptionResolver; - /// Resolver for auth scheme options. /// /// The orchestrator needs to select an auth scheme to sign requests with, and potentially @@ -192,9 +189,6 @@ impl ValidateConfig for SharedAuthScheme {} impl_shared_conversions!(convert SharedAuthScheme from AuthScheme using SharedAuthScheme::new); -#[deprecated(note = "Renamed to Sign.")] -pub use Sign as Signer; - /// Signing implementation for an auth scheme. pub trait Sign: Send + Sync + fmt::Debug { /// Sign the given request with the given identity, components, and config. diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/endpoint.rs b/rust-runtime/aws-smithy-runtime-api/src/client/endpoint.rs index a0818cf4ec4..13e9880a4a5 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/endpoint.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/endpoint.rs @@ -43,9 +43,6 @@ impl Storable for EndpointResolverParams { type Storer = StoreReplace; } -#[deprecated(note = "Renamed to ResolveEndpoint.")] -pub use ResolveEndpoint as EndpointResolver; - /// Configurable endpoint resolver implementation. pub trait ResolveEndpoint: Send + Sync + fmt::Debug { /// Asynchronously resolves an endpoint to use from the given endpoint parameters. diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/http.rs b/rust-runtime/aws-smithy-runtime-api/src/client/http.rs index 2ea777175cf..1e90d40fb17 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/http.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/http.rs @@ -59,26 +59,6 @@ use std::fmt; use std::sync::Arc; use std::time::Duration; -/// Http Request Types -pub mod request { - use aws_smithy_types::body::SdkBody; - /// Deprecated: This type has moved to `aws_smithy_runtime_api::http::HttpError`. - #[deprecated(note = "This type has moved to `aws_smithy_runtime_api::http::HttpError`.")] - pub type HttpError = crate::http::HttpError; - /// Deprecated: This type has moved to `aws_smithy_runtime_api::http::HeaderValue`. - #[deprecated(note = "This type has moved to `aws_smithy_runtime_api::http::HeaderValue`.")] - pub type HeaderValue = crate::http::HeaderValue; - /// Deprecated: This type has moved to `aws_smithy_runtime_api::http::Headers`. - #[deprecated(note = "This type has moved to `aws_smithy_runtime_api::http::Headers`.")] - pub type Headers = crate::http::Headers; - /// Deprecated: This type has moved to `aws_smithy_runtime_api::http::HeadersIter`. - #[deprecated(note = "This type has moved to `aws_smithy_runtime_api::http::HeadersIter`.")] - pub type HeadersIter<'a> = crate::http::HeadersIter<'a>; - /// Deprecated: This type has moved to `aws_smithy_runtime_api::http::Request`. - #[deprecated(note = "This type has moved to `aws_smithy_runtime_api::http::Request`.")] - pub type Request = crate::http::Request; -} - new_type_future! { #[doc = "Future for [`HttpConnector::call`]."] pub struct HttpConnectorFuture<'static, HttpResponse, ConnectorError>; @@ -280,19 +260,3 @@ impl HttpConnectorSettings { self.read_timeout } } - -#[cfg(test)] -mod test { - #[test] - #[allow(deprecated)] - fn re_export_has_default_generic() { - let req1 = super::request::Request::empty(); - let req2 = super::request::Request::<()>::new(()); - fn takes_req(_req: &super::request::Request) {} - fn takes_generic_req(_req: &super::request::Request) {} - - takes_req(&req1); - takes_generic_req(&req1); - takes_generic_req(&req2); - } -} diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/identity.rs b/rust-runtime/aws-smithy-runtime-api/src/client/identity.rs index fae5e860559..669c4490ab2 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/identity.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/identity.rs @@ -139,9 +139,6 @@ impl ValidateConfig for SharedIdentityCache { impl_shared_conversions!(convert SharedIdentityCache from ResolveCachedIdentity using SharedIdentityCache::new); -#[deprecated(note = "Renamed to ResolveIdentity.")] -pub use ResolveIdentity as IdentityResolver; - /// Resolver for identities. /// /// Every [`AuthScheme`](crate::client::auth::AuthScheme) has one or more compatible diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/interceptors.rs b/rust-runtime/aws-smithy-runtime-api/src/client/interceptors.rs index 370742c249d..e4fde15ad47 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/interceptors.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/interceptors.rs @@ -55,9 +55,6 @@ macro_rules! interceptor_trait_fn { }; } -#[deprecated(note = "Renamed to Intercept.")] -pub use Intercept as Interceptor; - /// An interceptor allows injecting code into the SDK ’s request execution pipeline. /// /// ## Terminology: diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/result.rs b/rust-runtime/aws-smithy-runtime-api/src/client/result.rs index 93013abdd81..080940840f7 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/result.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/result.rs @@ -493,7 +493,7 @@ impl ProvideErrorMetadata for SdkError where E: ProvideErrorMetadata, { - fn meta(&self) -> &aws_smithy_types::Error { + fn meta(&self) -> &aws_smithy_types::error::ErrorMetadata { match self { SdkError::ConstructionFailure(_) => &EMPTY_ERROR_METADATA, SdkError::TimeoutError(_) => &EMPTY_ERROR_METADATA, diff --git a/rust-runtime/aws-smithy-runtime-api/src/client/ser_de.rs b/rust-runtime/aws-smithy-runtime-api/src/client/ser_de.rs index 913113c4669..5ca288cbbaf 100644 --- a/rust-runtime/aws-smithy-runtime-api/src/client/ser_de.rs +++ b/rust-runtime/aws-smithy-runtime-api/src/client/ser_de.rs @@ -13,9 +13,6 @@ use aws_smithy_types::config_bag::{ConfigBag, Storable, StoreReplace}; use std::fmt; use std::sync::Arc; -#[deprecated(note = "Renamed to SerializeRequest.")] -pub use SerializeRequest as RequestSerializer; - /// Serialization implementation that converts an [`Input`] into an [`HttpRequest`]. pub trait SerializeRequest: Send + Sync + fmt::Debug { /// Serializes the input into an HTTP request. @@ -54,9 +51,6 @@ impl Storable for SharedRequestSerializer { impl_shared_conversions!(convert SharedRequestSerializer from SerializeRequest using SharedRequestSerializer::new); -#[deprecated(note = "Renamed to DeserializeResponse.")] -pub use DeserializeResponse as ResponseDeserializer; - /// Deserialization implementation that converts an [`HttpResponse`] into an [`Output`] or [`Error`]. pub trait DeserializeResponse: Send + Sync + fmt::Debug { /// For streaming requests, deserializes the response headers. diff --git a/rust-runtime/aws-smithy-runtime/src/client/identity/cache.rs b/rust-runtime/aws-smithy-runtime/src/client/identity/cache.rs index e18d9c0afc6..7e349c78ec1 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/identity/cache.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/identity/cache.rs @@ -4,7 +4,7 @@ */ use aws_smithy_runtime_api::client::identity::{ - IdentityFuture, IdentityResolver, ResolveCachedIdentity, SharedIdentityCache, + IdentityFuture, ResolveCachedIdentity, ResolveIdentity, SharedIdentityCache, SharedIdentityResolver, }; use aws_smithy_runtime_api::shared::IntoShared; diff --git a/rust-runtime/aws-smithy-runtime/src/client/identity/cache/lazy.rs b/rust-runtime/aws-smithy-runtime/src/client/identity/cache/lazy.rs index 1ed06cba18a..990f3d1ec3f 100644 --- a/rust-runtime/aws-smithy-runtime/src/client/identity/cache/lazy.rs +++ b/rust-runtime/aws-smithy-runtime/src/client/identity/cache/lazy.rs @@ -9,7 +9,7 @@ use aws_smithy_async::rt::sleep::{AsyncSleep, SharedAsyncSleep}; use aws_smithy_async::time::{SharedTimeSource, TimeSource}; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::identity::{ - Identity, IdentityCachePartition, IdentityFuture, IdentityResolver, ResolveCachedIdentity, + Identity, IdentityCachePartition, IdentityFuture, ResolveCachedIdentity, ResolveIdentity, SharedIdentityCache, SharedIdentityResolver, }; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; @@ -402,7 +402,7 @@ mod tests { f.write_str("ResolverFn") } } - impl IdentityResolver for ResolverFn + impl ResolveIdentity for ResolverFn where F: Fn() -> IdentityFuture<'static> + Send + Sync, { @@ -428,7 +428,7 @@ mod tests { ) -> (LazyCache, SharedIdentityResolver) { #[derive(Debug)] struct Resolver(Mutex>>); - impl IdentityResolver for Resolver { + impl ResolveIdentity for Resolver { fn resolve_identity<'a>( &'a self, _: &'a RuntimeComponents, diff --git a/rust-runtime/aws-smithy-types/src/byte_stream.rs b/rust-runtime/aws-smithy-types/src/byte_stream.rs index 8a36a9ba1ef..2721b1b6b21 100644 --- a/rust-runtime/aws-smithy-types/src/byte_stream.rs +++ b/rust-runtime/aws-smithy-types/src/byte_stream.rs @@ -403,24 +403,6 @@ impl ByteStream { .await } - /// Create a ByteStream from a file - /// - /// NOTE: This will NOT result in a retryable ByteStream. For a ByteStream that can be retried in the case of - /// upstream failures, use [`ByteStream::from_path`](ByteStream::from_path) - #[deprecated( - since = "0.40.0", - note = "Prefer the more extensible ByteStream::read_from() API" - )] - #[cfg(feature = "rt-tokio")] - pub async fn from_file( - file: tokio::fs::File, - ) -> Result { - crate::byte_stream::FsBuilder::new() - .file(file) - .build() - .await - } - #[cfg(feature = "rt-tokio")] /// Convert this `ByteStream` into a struct that implements [`AsyncBufRead`](tokio::io::AsyncBufRead). /// diff --git a/rust-runtime/aws-smithy-types/src/error.rs b/rust-runtime/aws-smithy-types/src/error.rs index 28838e4b762..e2375ddf3f5 100644 --- a/rust-runtime/aws-smithy-types/src/error.rs +++ b/rust-runtime/aws-smithy-types/src/error.rs @@ -10,13 +10,9 @@ use std::fmt; pub mod display; pub mod metadata; pub mod operation; -mod unhandled; pub use metadata::ErrorMetadata; -#[allow(deprecated)] -pub use unhandled::Unhandled; - #[derive(Debug)] pub(super) enum TryFromNumberErrorKind { /// Used when the conversion from an integer type into a smaller integer type would be lossy. diff --git a/rust-runtime/aws-smithy-types/src/error/metadata.rs b/rust-runtime/aws-smithy-types/src/error/metadata.rs index 6629753733d..4855b6c3ee8 100644 --- a/rust-runtime/aws-smithy-types/src/error/metadata.rs +++ b/rust-runtime/aws-smithy-types/src/error/metadata.rs @@ -75,13 +75,13 @@ impl Builder { /// /// Typically, these will be accessed with an extension trait: /// ```rust - /// use aws_smithy_types::Error; + /// use aws_smithy_types::error::ErrorMetadata; /// const HOST_ID: &str = "host_id"; /// trait S3ErrorExt { /// fn extended_request_id(&self) -> Option<&str>; /// } /// - /// impl S3ErrorExt for Error { + /// impl S3ErrorExt for ErrorMetadata { /// fn extended_request_id(&self) -> Option<&str> { /// self.extra(HOST_ID) /// } @@ -90,7 +90,7 @@ impl Builder { /// fn main() { /// // Extension trait must be brought into scope /// use S3ErrorExt; - /// let sdk_response: Result<(), Error> = Err(Error::builder().custom(HOST_ID, "x-1234").build()); + /// let sdk_response: Result<(), ErrorMetadata> = Err(ErrorMetadata::builder().custom(HOST_ID, "x-1234").build()); /// if let Err(err) = sdk_response { /// println!("extended request id: {:?}", err.extended_request_id()); /// } diff --git a/rust-runtime/aws-smithy-types/src/error/unhandled.rs b/rust-runtime/aws-smithy-types/src/error/unhandled.rs deleted file mode 100644 index f0cce422fcc..00000000000 --- a/rust-runtime/aws-smithy-types/src/error/unhandled.rs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -#![allow(deprecated)] - -//! Unhandled error type. - -use crate::error::{metadata::ProvideErrorMetadata, ErrorMetadata}; -use std::error::Error as StdError; - -#[deprecated(note = "The `Unhandled` type is no longer used by errors.")] -/// Builder for [`Unhandled`] -#[derive(Default, Debug)] -pub struct Builder { - source: Option>, - meta: Option, -} - -impl Builder { - /// Sets the error source - pub fn source(mut self, source: impl Into>) -> Self { - self.source = Some(source.into()); - self - } - - /// Sets the error source - pub fn set_source( - &mut self, - source: Option>, - ) -> &mut Self { - self.source = source; - self - } - - /// Sets the error metadata - pub fn meta(mut self, meta: ErrorMetadata) -> Self { - self.meta = Some(meta); - self - } - - /// Sets the error metadata - pub fn set_meta(&mut self, meta: Option) -> &mut Self { - self.meta = meta; - self - } - - /// Builds the unhandled error - pub fn build(self) -> Unhandled { - Unhandled { - source: self.source.expect("unhandled errors must have a source"), - meta: self.meta.unwrap_or_default(), - } - } -} - -/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). -/// -/// When logging an error from the SDK, it is recommended that you either wrap the error in -/// [`DisplayErrorContext`](crate::error::display::DisplayErrorContext), use another -/// error reporter library that visits the error's cause/source chain, or call -/// [`Error::source`](std::error::Error::source) for more details about the underlying cause. -#[deprecated(note = "This type is no longer used by errors.")] -#[derive(Debug)] -pub struct Unhandled { - source: Box, - meta: ErrorMetadata, -} - -impl Unhandled { - /// Returns a builder to construct an unhandled error. - pub fn builder() -> Builder { - Default::default() - } -} - -impl std::fmt::Display for Unhandled { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "unhandled error") - } -} - -impl StdError for Unhandled { - fn source(&self) -> Option<&(dyn StdError + 'static)> { - Some(self.source.as_ref() as _) - } -} - -impl ProvideErrorMetadata for Unhandled { - fn meta(&self) -> &ErrorMetadata { - &self.meta - } -} diff --git a/rust-runtime/aws-smithy-types/src/lib.rs b/rust-runtime/aws-smithy-types/src/lib.rs index 386c9057337..79c0a13f5b6 100644 --- a/rust-runtime/aws-smithy-types/src/lib.rs +++ b/rust-runtime/aws-smithy-types/src/lib.rs @@ -38,10 +38,4 @@ pub mod str_bytes; pub use blob::Blob; pub use date_time::DateTime; pub use document::Document; -// TODO(deprecated): Remove deprecated re-export -/// Use [error::ErrorMetadata] instead. -#[deprecated( - note = "`aws_smithy_types::Error` has been renamed to `aws_smithy_types::error::ErrorMetadata`" -)] -pub use error::ErrorMetadata as Error; pub use number::Number; diff --git a/rust-runtime/inlineable/src/json_errors.rs b/rust-runtime/inlineable/src/json_errors.rs index 4106762051d..b785bbe63bb 100644 --- a/rust-runtime/inlineable/src/json_errors.rs +++ b/rust-runtime/inlineable/src/json_errors.rs @@ -97,7 +97,7 @@ pub fn parse_error_metadata( mod test { use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code}; use aws_smithy_runtime_api::client::orchestrator::HttpResponse; - use aws_smithy_types::{body::SdkBody, Error}; + use aws_smithy_types::{body::SdkBody, error::ErrorMetadata}; use std::borrow::Cow; #[test] @@ -114,7 +114,7 @@ mod test { parse_error_metadata(response.body().bytes().unwrap(), response.headers()) .unwrap() .build(), - Error::builder() + ErrorMetadata::builder() .code("FooError") .message("Go to foo") .build() @@ -200,7 +200,7 @@ mod test { parse_error_metadata(response.body().bytes().unwrap(), response.headers()) .unwrap() .build(), - Error::builder() + ErrorMetadata::builder() .code("ResourceNotFoundException") .message("Functions from 'us-west-2' are not reachable from us-east-1") .build()