Skip to content

Commit 3fecfa4

Browse files
ekjotmultaniNika Hassani
authored andcommitted
updating storage_outputs class for multi-bucket support
1 parent e847d8a commit 3fecfa4

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

packages/amplify_core/lib/src/config/amplify_outputs/storage/storage_outputs.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ part 'storage_outputs.g.dart';
1212
class StorageOutputs
1313
with AWSEquatable<StorageOutputs>, AWSSerializable, AWSDebuggable {
1414
/// {@macro amplify_core.amplify_outputs.storage_outputs}
15-
const StorageOutputs({required this.awsRegion, required this.bucketName});
15+
const StorageOutputs({required this.awsRegion, required this.bucketName, this.buckets});
1616

1717
factory StorageOutputs.fromJson(Map<String, Object?> json) =>
1818
_$StorageOutputsFromJson(json);
@@ -23,6 +23,9 @@ class StorageOutputs
2323
/// The Amazon S3 bucket name.
2424
final String bucketName;
2525

26+
/// The list of buckets if there are multiple buckets for the project
27+
final List<Map<String,String>>? buckets;
28+
2629
@override
2730
List<Object?> get props => [awsRegion, bucketName];
2831

packages/amplify_core/lib/src/config/amplify_outputs/storage/storage_outputs.g.dart

Lines changed: 20 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amplify_core/test/config/amplify_outputs/test_data.dart

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,26 @@ const amplifyoutputs = '''{
9999
]
100100
},
101101
"storage": {
102-
"aws_region": "oem dks",
103-
"bucket_name": "dolor et esse"
104-
},
102+
"aws_region": "us-east-2",
103+
"bucket_name": "amplifyTeamDrive-one-stora-testbucketgen2bucket0b8c-9ggcfqfunkjr",
104+
"buckets": [
105+
{
106+
"name": "amplifyTeamDrive-one",
107+
"bucket_name": "amplifyTeamDrive-one-stora-testbucketgen2bucket0b8c-9ggcfqfunkjr",
108+
"aws_region": "us-east-2"
109+
},
110+
{
111+
"name": "amplifyTeamDrive-two",
112+
"bucket_name": "amplifyTeamDrive-two-stora-testbucketgen2bucket0b8c-2",
113+
"aws_region": "us-east-2"
114+
},
115+
{
116+
"name": "amplifyTeamDrive-three",
117+
"bucket_name": "amplifyTeamDrive-three-stora-testbucketgen2bucket0b8c-3",
118+
"aws_region": "us-east-2"
119+
}
120+
]
121+
},
105122
"version": "1"
106123
}
107124
''';

0 commit comments

Comments
 (0)