-
Notifications
You must be signed in to change notification settings - Fork 260
feat(core): update storage outputs class for multi-bucket support #5476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
13d6723
updating storage_outputs class for multi-bucket support
c5c0438
seperated bucket out into its own class instead of using a map
f22dd48
made bucket_output class a proper output class like the others in amp…
cc6c55b
Update auth.dart
ekjotmultani b6f8719
added doc comments and changed name of bucket class
66ad860
Merge branch 'storagewereoutput-update' of https://github.com/aws-amp…
3fc0ce9
Delete devtools_options.yaml
ekjotmultani 9114206
added trailing commas to pass ci test
a17b602
Merge branch 'storage-output-update' of https://github.com/aws-amplif…
e7906c7
ran dart format on two failing files
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
packages/amplify_core/lib/src/config/amplify_outputs/storage/bucket_outputs.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
part 'bucket_outputs.g.dart'; | ||
|
||
/// {@template amplify_core.amplify_outputs.bucket_outputs} | ||
/// The Amplify Gen 2 outputs for Buckets in the Storage category. | ||
/// {@endtemplate} | ||
@zAmplifyOutputsSerializable | ||
class BucketOutputs | ||
with AWSEquatable<BucketOutputs>, AWSSerializable, AWSDebuggable { | ||
/// {@macro amplify_core.amplify_outputs.bucket_outputs} | ||
const BucketOutputs({ | ||
required this.name, | ||
required this.bucketName, | ||
required this.awsRegion, | ||
}); | ||
|
||
factory BucketOutputs.fromJson(Map<String, Object?> json) => | ||
_$BucketOutputsFromJson(json); | ||
|
||
/// The user friendly name of the bucket | ||
final String name; | ||
|
||
/// The Amazon S3 bucket name. | ||
final String bucketName; | ||
|
||
/// The AWS region of Amazon S3 resources. | ||
final String awsRegion; | ||
|
||
@override | ||
List<Object?> get props => [ | ||
name, | ||
bucketName, | ||
awsRegion, | ||
]; | ||
|
||
@override | ||
String get runtimeTypeName => 'BucketOutputs'; | ||
|
||
@override | ||
Object? toJson() { | ||
return _$BucketOutputsToJson(this); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/amplify_core/lib/src/config/amplify_outputs/storage/bucket_outputs.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 21 additions & 5 deletions
26
packages/amplify_core/lib/src/config/amplify_outputs/storage/storage_outputs.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I see the test data has been updated, but are the tests written in a way that validate the new functionality too? Do they need to be updated?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good question, since multiple buckets are optional, I think we should validate that it works when only one bucket is supplied too. I'll check this out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've verified that the test does work properly when only a single bucket is supplied and that the test itself actually validates the new function for multi-bucket support