Skip to content

Commit 68ef5d6

Browse files
committed
updated api explanations for consistency
1 parent 4766b0c commit 68ef5d6

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
@@ -141,7 +141,7 @@ Future<void> copy() async {
141141
```
142142
## Specify a bucket or copy across buckets / regions
143143

144-
You can also perform an `copy` operation to a specific bucket by providing the `CopyBuckets` option.
144+
You can also perform a `copy` operation to a specific bucket by providing the `CopyBuckets` option.
145145
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.
146146

147147
```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
@@ -1133,6 +1133,37 @@ final operation = Amplify.Storage.downloadFile(
11331133

11341134
### Example of `downloadData` with options
11351135

1136+
```dart
1137+
final operation = Amplify.Storage.downloadData(
1138+
path: const StoragePath.fromString('public/example.txt'),
1139+
options: StorageDownloadDataOptions(
1140+
pluginOptions: S3DownloadDataPluginOptions(
1141+
getProperties: true,
1142+
useAccelerateEndpoint: true,
1143+
bytesRange: S3DataBytesRange(start: 0, end: 100),
1144+
),
1145+
),
1146+
);
1147+
```
1148+
1149+
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.
1150+
1151+
```dart
1152+
final operation = Amplify.Storage.downloadFile(
1153+
path: const StoragePath.fromString('public/example.txt'),
1154+
localFile: AWSFile.fromPath('/path/to/local/file.txt'),
1155+
options: const StorageDownloadFileOptions(
1156+
pluginOptions: S3DownloadFilePluginOptions(
1157+
getProperties: true,
1158+
useAccelerateEndpoint: true,
1159+
),
1160+
bucket: StorageBucket.fromOutputs('secondBucket'),
1161+
),
1162+
);
1163+
```
1164+
1165+
Alternatively, you can also pass in an object by specifying the bucket name and region from the console.
1166+
11361167
```dart
11371168
final operation = Amplify.Storage.downloadData(
11381169
path: const StoragePath.fromString('public/example.txt'),
@@ -1151,7 +1182,6 @@ final operation = Amplify.Storage.downloadData(
11511182
),
11521183
);
11531184
```
1154-
11551185
</InlineFilter>
11561186

11571187
<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
@@ -1014,7 +1014,7 @@ Future<void> listAllUnderPublicPath() async {
10141014
<InlineFilter filters={["flutter"]}>
10151015

10161016
### List files from a specified bucket
1017-
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.
1017+
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.
10181018

10191019
```dart
10201020
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)