aws-amplify / amplify-android

The fastest and easiest way to use AWS from your Android app.
https://docs.amplify.aws/lib/q/platform/android/
Apache License 2.0
249 stars 117 forks source link

feat(storage): Add support to define the S3 Storage Class #2862

Open amcofi opened 5 months ago

amcofi commented 5 months ago

Add support to define the S3 Storage Class when uploading files or streams. Implementation is based on the existing support Server Side Encryption.

See also: https://aws.amazon.com/s3/storage-classes

Issue #, if available:

Description of changes:

How did you test these changes? I didn't see any tests for related functionality. I tested the storage class is set correctly when uploading to my S3 bucket from my own application.

val options = AWSS3StorageUploadInputStreamOptions.builder()
    .storageClass(aws.sdk.kotlin.services.s3.model.StorageClass.GlacierIr)
    .build()

Amplify.Storage.uploadInputStream(
    StoragePath.fromString(key),
    inputStream,
    options,
    { result -> ... },
    { error -> ... }
)

Documentation update required?

General Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

tylerjroach commented 5 months ago

Hi @amcofi,

Thank you for your contribution. We will take a look at the PR and get back to you!