From a3d8de2d308a805e30e9b2292436aa84c1e6f190 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 13:11:08 +1000 Subject: [PATCH] fix(deps): update aws-sdk (#251) * fix(deps): update aws-sdk * fix: Create error type that includes Response in SdkError * feat: Create types file with DefaultSdkError type * Formatting * FOrmatting * Formatting * Formatting * Update src/types.rs Co-authored-by: Ryan Kelly * Rename alias * Renaming import * Formatting * Rename alias --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: mangoez Co-authored-by: Ryan Kelly --- Cargo.toml | 12 ++++++------ src/lib.rs | 2 +- src/s3/async_multipart_put_object.rs | 3 ++- src/s3/async_put_object.rs | 2 +- src/s3/mod.rs | 3 ++- src/types.rs | 5 +++++ 6 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 src/types.rs diff --git a/Cargo.toml b/Cargo.toml index 66f3829..e185fd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,12 +19,12 @@ include = [ [dependencies] anyhow = "1.0.72" async-trait = "0.1.71" -aws-config = "0.55.3" -aws-sdk-athena = "0.28.0" -aws-sdk-s3 = "0.28.0" -aws-sdk-sqs = "0.28.0" -aws-smithy-http = "0.55.3" -aws-types = "0.55.3" +aws-config = "0.56.0" +aws-sdk-athena = "0.29.0" +aws-sdk-s3 = "0.29.0" +aws-sdk-sqs = "0.29.0" +aws-smithy-http = "0.56.0" +aws-types = "0.56.0" aws_lambda_events = { version = "0.10.0", default-features=false, features = ["sqs"]} lambda_runtime = "0.8.1" bytesize = "1.2.0" diff --git a/src/lib.rs b/src/lib.rs index 978cded..1cd4e40 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,6 @@ pub mod config; pub mod lambda; pub mod s3; pub mod sqs; - +pub mod types; // Internal shared modules mod localstack; diff --git a/src/s3/async_multipart_put_object.rs b/src/s3/async_multipart_put_object.rs index d0ee95f..645efb7 100644 --- a/src/s3/async_multipart_put_object.rs +++ b/src/s3/async_multipart_put_object.rs @@ -9,7 +9,7 @@ use aws_sdk_s3::{ types::{CompletedMultipartUpload, CompletedPart, ObjectCannedAcl, Part}, Client, }; -use aws_smithy_http::{byte_stream::ByteStream, result::SdkError}; +use aws_smithy_http::byte_stream::ByteStream; use bytesize::{GIB, MIB}; use derivative::Derivative; use futures::future::BoxFuture; @@ -21,6 +21,7 @@ use std::pin::Pin; use tracing::{event, instrument, Level}; use crate::s3::S3Object; +use crate::types::SdkError; /// Convenience wrapper for boxed future type MultipartUploadFuture<'a> = diff --git a/src/s3/async_put_object.rs b/src/s3/async_put_object.rs index c771cf7..36cc058 100644 --- a/src/s3/async_put_object.rs +++ b/src/s3/async_put_object.rs @@ -2,7 +2,6 @@ use aws_sdk_s3::{ operation::put_object::{PutObjectError, PutObjectOutput}, types::ObjectCannedAcl, }; -use aws_smithy_http::result::SdkError; use futures::io::{Error, ErrorKind}; use futures::task::{Context, Poll}; use futures::{ready, AsyncWrite, Future}; @@ -10,6 +9,7 @@ use std::mem; use std::pin::Pin; use crate::s3::Client; +use crate::types::SdkError; // Tracks the state of the AsyncWrite lifecycle for an AsyncPutObject. enum PutObjectState<'a> { diff --git a/src/s3/mod.rs b/src/s3/mod.rs index fc66f27..0ae1bc1 100644 --- a/src/s3/mod.rs +++ b/src/s3/mod.rs @@ -6,7 +6,6 @@ use aws_sdk_s3::{ operation::{get_object::GetObjectError, list_objects_v2::ListObjectsV2Error}, types::Object, }; -use aws_smithy_http::result::SdkError; use aws_types::SdkConfig; use core::fmt::Debug; use futures::stream; @@ -14,6 +13,7 @@ use futures::stream::Stream; use futures::{AsyncBufRead, TryStreamExt}; use crate::localstack; +use crate::types::SdkError; /// Re-export of [aws_sdk_s3::client::Client](https://docs.rs/aws-sdk-s3/latest/aws_sdk_s3/client/struct.Client.html). /// @@ -167,6 +167,7 @@ mod test { types::{BucketLocationConstraint, CreateBucketConfiguration}, Client, }; + use aws_smithy_http::result::SdkError; use rand::distributions::{Alphanumeric, DistString}; use rand::Rng; use rand::SeedableRng; diff --git a/src/types.rs b/src/types.rs new file mode 100644 index 0000000..95abb6e --- /dev/null +++ b/src/types.rs @@ -0,0 +1,5 @@ +use aws_sdk_s3::primitives::SdkBody; +use http::Response; + +/// Convenience wrapper to handle http response +pub(crate) type SdkError = aws_smithy_http::result::SdkError>;