Unverified Commit d4e2745c authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Move `RequestId` to aws-types (#3160)

This PR moves `RequestId` into the aws-types stable crate.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent a94a5e08
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -107,3 +107,9 @@ message = "ProvideCredentials and SharedCredentialsProvider are now re-exported.
references = ["smithy-rs#3173", "smithy-rs#3155"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "rcoh"

[[aws-sdk-rust]]
message = "The `RequestId` trait has moved from the aws-http crate into aws-types."
references = ["smithy-rs#3160"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "jdisanti"
+1 −2
Original line number Diff line number Diff line
@@ -8,9 +8,8 @@ license = "Apache-2.0"
repository = "https://github.com/smithy-lang/smithy-rs"

[dependencies]
aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types", features = ["http-body-0-4-x"] }
aws-types = { path = "../aws-types" }
bytes = "1.1"
http = "0.2.3"
+0 −3
Original line number Diff line number Diff line
@@ -19,6 +19,3 @@ pub mod user_agent;

/// AWS-specific content-encoding tools
pub mod content_encoding;

/// AWS-specific request ID support
pub mod request_id;
+3 −7
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
 * SPDX-License-Identifier: Apache-2.0
 */

use aws_smithy_http::http::HttpHeaders;
use aws_smithy_runtime_api::client::result::SdkError;
use aws_smithy_runtime_api::http::{Headers, Response};
use aws_smithy_types::error::metadata::{
@@ -21,14 +20,11 @@ pub trait RequestIdExt {
    fn extended_request_id(&self) -> Option<&str>;
}

impl<E, R> RequestIdExt for SdkError<E, R>
where
    R: HttpHeaders,
{
impl<E> RequestIdExt for SdkError<E, Response> {
    fn extended_request_id(&self) -> Option<&str> {
        match self {
            Self::ResponseError(err) => err.raw().http_headers().extended_request_id(),
            Self::ServiceError(err) => err.raw().http_headers().extended_request_id(),
            Self::ResponseError(err) => err.raw().headers().extended_request_id(),
            Self::ServiceError(err) => err.raw().headers().extended_request_id(),
            _ => None,
        }
    }
+2 −0
Original line number Diff line number Diff line
@@ -9,9 +9,11 @@ allowed_external_types = [
    "aws_smithy_runtime_api::client::http::SharedHttpClient",
    "aws_smithy_runtime_api::client::identity::ResolveCachedIdentity",
    "aws_smithy_runtime_api::client::identity::SharedIdentityCache",
    "aws_smithy_runtime_api::http::headers::Headers",
    "aws_smithy_types::config_bag::storable::Storable",
    "aws_smithy_types::config_bag::storable::StoreReplace",
    "aws_smithy_types::config_bag::storable::Storer",
    "aws_smithy_types::error::metadata::Builder",
    "aws_smithy_types::retry::RetryConfig",
    "aws_smithy_types::timeout::TimeoutConfig",
]
Loading