Skip to content

Commit 10aee0b

Browse files
ekjotmultaniNika Hassani
authored andcommitted
seperated bucket out into its own class instead of using a map
1 parent 3fecfa4 commit 10aee0b

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
5+
6+
/// {@template amplify_core.amplify_outputs.amazon_pinpoint_channel}
7+
/// Supported channels for Amazon Pinpoint.
8+
/// {@endtemplate}
9+
class StorageOutputBucket {
10+
StorageOutputBucket(this.name, this.bucketName, this.awsRegion);
11+
factory StorageOutputBucket.fromJson(Map<String, dynamic> json) => StorageOutputBucket(json['name'].toString(), json['bucket_name'].toString(), json['aws_region'].toString());
12+
String name;
13+
String bucketName;
14+
String awsRegion;
15+
Map<String, dynamic> toJson() => <String, dynamic>{'name':name, 'bucket_name':bucketName, 'aws_region':awsRegion};
16+
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import 'package:amplify_core/amplify_core.dart';
5+
import 'package:amplify_core/src/config/amplify_outputs/storage/storage_output_bucket.dart';
56

67
part 'storage_outputs.g.dart';
78

@@ -14,6 +15,7 @@ class StorageOutputs
1415
/// {@macro amplify_core.amplify_outputs.storage_outputs}
1516
const StorageOutputs({required this.awsRegion, required this.bucketName, this.buckets});
1617

18+
1719
factory StorageOutputs.fromJson(Map<String, Object?> json) =>
1820
_$StorageOutputsFromJson(json);
1921

@@ -24,10 +26,10 @@ class StorageOutputs
2426
final String bucketName;
2527

2628
/// The list of buckets if there are multiple buckets for the project
27-
final List<Map<String,String>>? buckets;
28-
29+
final List<StorageOutputBucket>? buckets;
30+
2931
@override
30-
List<Object?> get props => [awsRegion, bucketName];
32+
List<Object?> get props => [awsRegion, bucketName, buckets];
3133

3234
@override
3335
String get runtimeTypeName => 'StorageOutputs';

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

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

0 commit comments

Comments
 (0)