Skip to content

Commit 17fc13c

Browse files
feat: deprecate Storage.move() API (#4638)
1 parent a5f129b commit 17fc13c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/amplify_core/lib/src/category/amplify_storage_category.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ class StorageCategory extends AmplifyCategory<StoragePluginInterface> {
218218
///
219219
/// {@macro amplify_core.amplify_storage_category.copy_source}
220220
/// {@endtemplate}
221+
@Deprecated(
222+
'This API will be removed in the next major version. '
223+
'This API calls Amplify.Storage.copy() to create a copy of the file in the '
224+
'destination directory and then calls Amplify.Storage.remove() to remove '
225+
'the source file. '
226+
'Please use Amplify.Storage.copy() and Amplify.Storage.remove() directly '
227+
'instead.',
228+
)
221229
StorageMoveOperation move({
222230
required StorageItemWithAccessLevel<StorageItem> source,
223231
required StorageItemWithAccessLevel<StorageItem> destination,

packages/storage/amplify_storage_s3/example/integration_test/use_case_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ void main() {
412412
testWidgets(
413413
'move object with access level private for the currently signed in user',
414414
(WidgetTester tester) async {
415+
// ignore: deprecated_member_use
415416
final result = await Amplify.Storage.move(
416417
source: S3ItemWithAccessLevel(
417418
storageItem: S3Item(key: testObject3CopyKey),
@@ -685,6 +686,7 @@ void main() {
685686
testWidgets(
686687
'move object with access level guest for the currently signed in user',
687688
(WidgetTester tester) async {
689+
// ignore: deprecated_member_use
688690
final result = await Amplify.Storage.move(
689691
source: S3ItemWithAccessLevel(
690692
storageItem: S3Item(key: testObjectKey1),
@@ -862,6 +864,7 @@ void main() {
862864

863865
testWidgets('move object with access level protected as object owner',
864866
(WidgetTester tester) async {
867+
// ignore: deprecated_member_use
865868
final result = await Amplify.Storage.move(
866869
source: S3ItemWithAccessLevel.forIdentity(
867870
user1IdentityId,

0 commit comments

Comments
 (0)