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

feat(core): update storage outputs class for multi-bucket support #5476

Open
wants to merge 10 commits into
base: multi-bucket
Choose a base branch
from
6 changes: 3 additions & 3 deletions packages/amplify_core/doc/lib/auth.dart
Copy link
Author

Choose a reason for hiding this comment

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

I dont know how this got changed, I think I clicked a vscode 'optimization' by mistake, I will change this back right now

Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ Future<void> _handleSignInResult(SignInResult result) async {
// #enddocregion handle-signin, handle-confirm-signin-sms, handle-confirm-signin-new-password, handle-confirm-signin-custom-challenge, handle-confirm-signin-reset-password, handle-confirm-signin-confirm-signup, handle-confirm-signin-done, handle-confirm-signin-mfa-selection, handle-confirm-signin-totp-setup, handle-confirm-signin-totp-code
// #docregion handle-confirm-signin-mfa-selection
case AuthSignInStep.continueSignInWithMfaSelection:
final allowedMfaTypes = result.nextStep.allowedMfaTypes!;
final allowedMfaTypes = result.nextStep.allowedMfaTypes;
final selection = await _promptUserPreference(allowedMfaTypes);
return _handleMfaSelection(selection);
// #enddocregion handle-confirm-signin-mfa-selection
// #docregion handle-confirm-signin-totp-setup
case AuthSignInStep.continueSignInWithTotpSetup:
final totpSetupDetails = result.nextStep.totpSetupDetails!;
final totpSetupDetails = result.nextStep.totpSetupDetails;
final setupUri = totpSetupDetails.getSetupUri(appName: 'MyApp');
safePrint('Open URI to complete setup: $setupUri');
// #enddocregion handle-confirm-signin-totp-setup
Expand Down Expand Up @@ -255,7 +255,7 @@ Future<void> signOutGlobally() async {
if (result is CognitoCompleteSignOut) {
safePrint('Sign out completed successfully');
} else if (result is CognitoPartialSignOut) {
final globalSignOutException = result.globalSignOutException!;
final globalSignOutException = result.globalSignOutException;
final accessToken = globalSignOutException.accessToken;
// Retry the global sign out using the access token, if desired
// ...
Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// 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_output.g.dart';

@zAmplifyOutputsSerializable
class BucketOutput
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class BucketOutput
class BucketOutputs

with AWSEquatable<BucketOutput>, AWSSerializable, AWSDebuggable{

const BucketOutput({required this.name, required this.bucketName, required this.awsRegion});

factory BucketOutput.fromJson(Map<String, Object?> json) =>
_$BucketOutputFromJson(json);

final String name;

final String bucketName;

final String awsRegion;

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

@override
String get runtimeTypeName => 'BucketOutput';

@override
Object? toJson() {
return _$BucketOutputToJson(this);
}
}

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:amplify_core/amplify_core.dart';
import 'package:amplify_core/src/config/amplify_outputs/storage/storage_output_bucket.dart';
import 'package:amplify_core/src/config/amplify_outputs/storage/bucket_output.dart';

part 'storage_outputs.g.dart';

Expand All @@ -26,7 +26,7 @@ class StorageOutputs
final String bucketName;

/// The list of buckets if there are multiple buckets for the project
final List<StorageOutputBucket>? buckets;
final List<BucketOutput>? buckets;

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

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

Loading