Skip to content

Commit

Permalink
Update AWS SDKs to 0.28.0 and libs to 0.55.3 (#115)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #115

* After adding the GameLift SDK, we (Ready At Dawn) realized that the OperatingSystem enum in 0.24.0 is missing the Windows2016 variant we need for our game servers. This update to 0.28 brings that in and gets everything up to date.
* Fix up the things I could find that stopped building after upgrading

allow-large-files

Reviewed By: dtolnay

Differential Revision: D47639814

fbshipit-source-id: 8096723803b41b5b917c222a13d569e05d2e412a
  • Loading branch information
Shane Lillie authored and facebook-github-bot committed Jul 24, 2023
1 parent 9b1a2fc commit b27743a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions common/src/s3_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl S3Path {

pub async fn copy_to_local(&self) -> Result<String, std::io::Error> {
let default_provider = default_provider().await;
let region = aws_sdk_s3::Region::new(self.get_region().clone());
let region = aws_sdk_s3::config::Region::new(self.get_region().clone());
let aws_cfg = aws_config::from_env()
.credentials_cache(
CredentialsCache::lazy_builder()
Expand Down Expand Up @@ -96,7 +96,7 @@ impl S3Path {

pub async fn copy_from_local(&self, path: impl AsRef<Path>) -> Result<(), aws_sdk_s3::Error> {
let default_provider = default_provider().await;
let region = aws_sdk_s3::Region::new(self.get_region().clone());
let region = aws_sdk_s3::config::Region::new(self.get_region().clone());
let aws_cfg = aws_config::from_env()
.region(region)
.credentials_cache(
Expand Down Expand Up @@ -131,12 +131,12 @@ impl S3Path {
.unwrap();
let uid = u.upload_id().ok_or_else(|| {
aws_sdk_s3::Error::NoSuchUpload(
aws_sdk_s3::error::NoSuchUpload::builder()
aws_sdk_s3::types::error::NoSuchUpload::builder()
.message("No upload ID")
.build(),
)
})?;
let mut completed_parts: Vec<aws_sdk_s3::model::CompletedPart> = Vec::new();
let mut completed_parts: Vec<aws_sdk_s3::types::CompletedPart> = Vec::new();
for i in 0..chunks {
let length = if i == chunks - 1 {
// If we're on the last chunk, the length to read might be less than a whole chunk.
Expand All @@ -146,7 +146,7 @@ impl S3Path {
} else {
chunk_size
};
let byte_stream = aws_sdk_s3::types::ByteStream::read_from()
let byte_stream = aws_sdk_s3::primitives::ByteStream::read_from()
.path(path.as_ref())
.offset(i * chunk_size)
.length(aws_smithy_http::byte_stream::Length::Exact(length))
Expand All @@ -162,14 +162,14 @@ impl S3Path {
.send()
.await
.unwrap();
let cp = aws_sdk_s3::model::CompletedPart::builder()
let cp = aws_sdk_s3::types::CompletedPart::builder()
.set_e_tag(upload.e_tag)
.part_number((i + 1) as i32)
.build();
completed_parts.push(cp);
}
// Complete multipart upload, sending the (etag, part id) list along the request.
let b = aws_sdk_s3::model::CompletedMultipartUpload::builder()
let b = aws_sdk_s3::types::CompletedMultipartUpload::builder()
.set_parts(Some(completed_parts))
.build();
let completed = client
Expand Down

0 comments on commit b27743a

Please sign in to comment.