Skip to content

Commit

Permalink
feat: deprecate Storage.move() API (#4638)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Nelson authored Apr 3, 2024
1 parent a5f129b commit 17fc13c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ class StorageCategory extends AmplifyCategory<StoragePluginInterface> {
///
/// {@macro amplify_core.amplify_storage_category.copy_source}
/// {@endtemplate}
@Deprecated(
'This API will be removed in the next major version. '
'This API calls Amplify.Storage.copy() to create a copy of the file in the '
'destination directory and then calls Amplify.Storage.remove() to remove '
'the source file. '
'Please use Amplify.Storage.copy() and Amplify.Storage.remove() directly '
'instead.',
)
StorageMoveOperation move({
required StorageItemWithAccessLevel<StorageItem> source,
required StorageItemWithAccessLevel<StorageItem> destination,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ void main() {
testWidgets(
'move object with access level private for the currently signed in user',
(WidgetTester tester) async {
// ignore: deprecated_member_use
final result = await Amplify.Storage.move(
source: S3ItemWithAccessLevel(
storageItem: S3Item(key: testObject3CopyKey),
Expand Down Expand Up @@ -685,6 +686,7 @@ void main() {
testWidgets(
'move object with access level guest for the currently signed in user',
(WidgetTester tester) async {
// ignore: deprecated_member_use
final result = await Amplify.Storage.move(
source: S3ItemWithAccessLevel(
storageItem: S3Item(key: testObjectKey1),
Expand Down Expand Up @@ -862,6 +864,7 @@ void main() {

testWidgets('move object with access level protected as object owner',
(WidgetTester tester) async {
// ignore: deprecated_member_use
final result = await Amplify.Storage.move(
source: S3ItemWithAccessLevel.forIdentity(
user1IdentityId,
Expand Down

0 comments on commit 17fc13c

Please sign in to comment.