Skip to content

Commit 01516d4

Browse files
committed
updated api explanations for consistency
1 parent 6ac635e commit 01516d4

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

src/pages/[platform]/build-a-backend/storage/copy-files/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Future<void> copy() async {
136136
```
137137
## Specify a bucket or copy across buckets / regions
138138

139-
You can also perform an `copy` operation to a specific bucket by providing the `CopyBuckets` option.
139+
You can also perform a `copy` operation to a specific bucket by providing the `CopyBuckets` option.
140140
This option is an object that takes two `StorageBucket` parameters, which can be constructed by the specified name in the Amplify Backend, or the bucket name and region from the console.
141141

142142
```dart

src/pages/[platform]/build-a-backend/storage/download-files/index.mdx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,37 @@ final operation = Amplify.Storage.downloadFile(
11301130

11311131
### Example of `downloadData` with options
11321132

1133+
```dart
1134+
final operation = Amplify.Storage.downloadData(
1135+
path: const StoragePath.fromString('public/example.txt'),
1136+
options: StorageDownloadDataOptions(
1137+
pluginOptions: S3DownloadDataPluginOptions(
1138+
getProperties: true,
1139+
useAccelerateEndpoint: true,
1140+
bytesRange: S3DataBytesRange(start: 0, end: 100),
1141+
),
1142+
),
1143+
);
1144+
```
1145+
1146+
You can also perform a `downloadData` or `downloadFile` operation to a specific bucket by providing the `bucket` option. You can pass in a `StorageBucket` object representing the target bucket from the name defined in the Amplify Backend.
1147+
1148+
```dart
1149+
final operation = Amplify.Storage.downloadFile(
1150+
path: const StoragePath.fromString('public/example.txt'),
1151+
localFile: AWSFile.fromPath('/path/to/local/file.txt'),
1152+
options: const StorageDownloadFileOptions(
1153+
pluginOptions: S3DownloadFilePluginOptions(
1154+
getProperties: true,
1155+
useAccelerateEndpoint: true,
1156+
),
1157+
bucket: StorageBucket.fromOutputs('secondBucket'),
1158+
),
1159+
);
1160+
```
1161+
1162+
Alternatively, you can also pass in an object by specifying the bucket name and region from the console.
1163+
11331164
```dart
11341165
final operation = Amplify.Storage.downloadData(
11351166
path: const StoragePath.fromString('public/example.txt'),
@@ -1148,7 +1179,6 @@ final operation = Amplify.Storage.downloadData(
11481179
),
11491180
);
11501181
```
1151-
11521182
</InlineFilter>
11531183

11541184
<InlineFilter filters={["swift"]}>

src/pages/[platform]/build-a-backend/storage/list-files/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ Future<void> listAllUnderPublicPath() async {
10131013
<InlineFilter filters={["flutter"]}>
10141014

10151015
### List files from a specified bucket
1016-
You can also perform a `list` operation to a specific bucket by providing the `bucket` option. You can pass in a object representing the target bucket in Amplify Backend.
1016+
You can also perform a `list` operation to a specific bucket by providing the `bucket` option. You can pass in a `StorageBucket` object representing the target bucket from the name defined in the Amplify Backend.
10171017

10181018
```dart
10191019
final result = await Amplify.Storage.list(

src/pages/[platform]/build-a-backend/storage/remove-files/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ let removedObject = try await Amplify.Storage.remove(
341341

342342
<InlineFilter filters={["flutter"]}>
343343

344-
You can also perform a remove operation from a specific bucket by providing the target bucket's assigned name from Amplify Backend in `bucket` option.
344+
You can also perform a `remove` operation to a specific bucket by providing the `bucket` option. You can pass in a `StorageBucket` object representing the target bucket from the name defined in the Amplify Backend.
345345

346346
```dart
347347
final result = await Amplify.Storage.remove(

src/pages/[platform]/build-a-backend/storage/upload-files/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ Future<void> upload() async {
649649

650650
### Upload to a specified bucket
651651

652-
You can also perform an `upload` operation to a specific bucket by providing the `bucket` option. You can pass in an object representing the target bucket in Amplify Backend.
652+
You can also perform an `upload` operation to a specific bucket by providing the `bucket` option. You can pass in a `StorageBucket` object representing the target bucket from the name defined in the Amplify Backend.
653653

654654
```dart
655655
final data = 'multi bucket upload data byte'.codeUnits;

0 commit comments

Comments
 (0)