Skip to content

Commit

Permalink
updating storage_outputs class for multi-bucket support
Browse files Browse the repository at this point in the history
  • Loading branch information
ekjotmultani committed Sep 17, 2024
1 parent 51d01c4 commit 13d6723
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part 'storage_outputs.g.dart';
class StorageOutputs
with AWSEquatable<StorageOutputs>, AWSSerializable, AWSDebuggable {
/// {@macro amplify_core.amplify_outputs.storage_outputs}
const StorageOutputs({required this.awsRegion, required this.bucketName});
const StorageOutputs({required this.awsRegion, required this.bucketName, this.buckets});

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

/// The list of buckets if there are multiple buckets for the project
final List<Map<String,String>>? buckets;

@override
List<Object?> get props => [awsRegion, bucketName];

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions packages/amplify_core/test/config/amplify_outputs/test_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,26 @@ const amplifyoutputs = '''{
]
},
"storage": {
"aws_region": "oem dks",
"bucket_name": "dolor et esse"
},
"aws_region": "us-east-2",
"bucket_name": "amplifyTeamDrive-one-stora-testbucketgen2bucket0b8c-9ggcfqfunkjr",
"buckets": [
{
"name": "amplifyTeamDrive-one",
"bucket_name": "amplifyTeamDrive-one-stora-testbucketgen2bucket0b8c-9ggcfqfunkjr",
"aws_region": "us-east-2"
},
{
"name": "amplifyTeamDrive-two",
"bucket_name": "amplifyTeamDrive-two-stora-testbucketgen2bucket0b8c-2",
"aws_region": "us-east-2"
},
{
"name": "amplifyTeamDrive-three",
"bucket_name": "amplifyTeamDrive-three-stora-testbucketgen2bucket0b8c-3",
"aws_region": "us-east-2"
}
]
},
"version": "1"
}
''';

0 comments on commit 13d6723

Please sign in to comment.