Skip to content
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

chore(aws_common,3.0): Make AWSResult sealed #3012

Merged
merged 3 commits into from
May 9, 2023
Merged

Conversation

dnys1
Copy link
Contributor

@dnys1 dnys1 commented May 5, 2023

Adds pattern matching/functional capabilities to AWSResult.

@dnys1 dnys1 requested a review from a team as a code owner May 5, 2023 19:59
@dnys1 dnys1 force-pushed the feat/repo/more-dart-3 branch 2 times, most recently from 1f2a341 to eae1e2d Compare May 5, 2023 21:07
@dnys1 dnys1 force-pushed the chore/core/sealed-types branch from 90f0444 to 80f8dc1 Compare May 8, 2023 16:52
@dnys1 dnys1 force-pushed the feat/repo/more-dart-3 branch from eae1e2d to ca370d9 Compare May 8, 2023 16:56
@dnys1 dnys1 force-pushed the chore/core/sealed-types branch from 80f8dc1 to 370a050 Compare May 8, 2023 20:37
@dnys1 dnys1 force-pushed the feat/repo/more-dart-3 branch from ca370d9 to 51f2d2d Compare May 8, 2023 20:37
Comment on lines +38 to +41
V get value;

/// The value of the result, or null if there was an error retrieving it.
T? get valueOrNull {
switch (type) {
case AWSResultType.success:
// value will be non-null since it is required in AWSResult.success.
return _value!;
case AWSResultType.error:
return null;
V? get valueOrNull;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given V extends Object? I'm not sure if we need this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value getter throws for error results whereas this returns null

NikaHsn
NikaHsn previously approved these changes May 9, 2023
@dnys1 dnys1 force-pushed the chore/core/sealed-types branch from 370a050 to 260a7ac Compare May 9, 2023 22:00
@dnys1 dnys1 force-pushed the feat/repo/more-dart-3 branch from 51f2d2d to 2103375 Compare May 9, 2023 22:00
@dnys1 dnys1 changed the base branch from chore/core/sealed-types to main May 9, 2023 22:00
@dnys1 dnys1 dismissed NikaHsn’s stale review May 9, 2023 22:00

The base branch was changed.

@dnys1 dnys1 merged commit 4f08436 into main May 9, 2023
@dnys1 dnys1 deleted the feat/repo/more-dart-3 branch May 9, 2023 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants