Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nika Hassani committed May 21, 2024
1 parent 27dd25d commit 21a0c89
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 75 deletions.
7 changes: 7 additions & 0 deletions packages/amplify_core/lib/amplify_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ export 'src/category/amplify_categories.dart';
/// Config
export 'src/config/amplify_config.dart';
export 'src/config/amplify_outputs/amplify_outputs.dart';
export 'src/config/amplify_outputs/analytics/amazon_pinpoint_outputs.dart';
export 'src/config/amplify_outputs/analytics/analytics_outputs.dart';
export 'src/config/amplify_outputs/auth/auth_outputs.dart';
export 'src/config/amplify_outputs/auth/identity_provider.dart';
export 'src/config/amplify_outputs/auth/mfa.dart';
export 'src/config/amplify_outputs/auth/oauth_outputs.dart';
export 'src/config/amplify_outputs/auth/oauth_response_type.dart';
export 'src/config/amplify_outputs/auth/password_policy.dart';
export 'src/config/amplify_outputs/data/data_outputs.dart';
export 'src/config/amplify_outputs/notifications/amazon_pinpoint_channel.dart';
export 'src/config/amplify_outputs/notifications/notifications_outputs.dart';
export 'src/config/amplify_outputs/storage/storage_outputs.dart';
export 'src/config/amplify_plugin_config.dart' hide UnknownPluginConfigFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:amplify_core/amplify_core.dart';
part 'amplify_outputs.g.dart';

/// {@template amplify_core.amplify_outputs}
/// The amplify outputs generated by Amplify CLI Gen2 for
/// The amplify outputs generated by Amplify Gen 2 for
/// Amplify libraries to communicate with backend services.
/// {@endtemplate}
@zAmplifyOutputsSerializable
Expand Down Expand Up @@ -48,7 +48,8 @@ class AmplifyOutputs
/// {@macro amplify_core.amplify_outputs.storage_outputs}
final StorageOutputs? storage;

/// The custom outputs generated by CLI Gen2.
/// The custom outputs generated by Amplify Gen 2.
///
/// Amplify Categories do not use custom outputs.
final Map<String, dynamic>? custom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@

import 'package:amplify_core/amplify_core.dart';

part 'amazon_pinpoint.g.dart';
part 'amazon_pinpoint_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.amazon_pinpoint}
/// The Amazon Pinpoint outputs used by Analytics category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 output for Amazon Pinpoint.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class AmazonPinpoint
with AWSEquatable<AmazonPinpoint>, AWSSerializable, AWSDebuggable {
class AmazonPinpointOutputs
with AWSEquatable<AmazonPinpointOutputs>, AWSSerializable, AWSDebuggable {
/// {@macro amplify_core.amplify_outputs.amazon_pinpoint}
const AmazonPinpoint({required this.awsRegion, required this.appId});
const AmazonPinpointOutputs({required this.awsRegion, required this.appId});

factory AmazonPinpoint.fromJson(Map<String, Object?> json) =>
_$AmazonPinpointFromJson(json);
factory AmazonPinpointOutputs.fromJson(Map<String, Object?> json) =>
_$AmazonPinpointOutputsFromJson(json);

/// The AWS region of Amazon Pinpoint resources.
final String awsRegion;
Expand All @@ -28,10 +27,10 @@ class AmazonPinpoint
List<Object?> get props => [awsRegion, appId];

@override
String get runtimeTypeName => 'AmazonPinpoint';
String get runtimeTypeName => 'AmazonPinpointOutputs';

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

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

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

import 'package:amplify_core/amplify_core.dart';
import 'package:amplify_core/src/config/amplify_outputs/analytics/amazon_pinpoint.dart';

part 'analytics_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.analytics_outputs}
/// The analytics outputs used by Analytics category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 output for Analytics category.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class AnalyticsOutputs
Expand All @@ -20,7 +18,7 @@ class AnalyticsOutputs
_$AnalyticsOutputsFromJson(json);

/// {@macro amplify_core.amplify_outputs.amazon_pinpoint}
final AmazonPinpoint? amazonPinpoint;
final AmazonPinpointOutputs? amazonPinpoint;

@override
List<Object?> get props => [amazonPinpoint];
Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import 'package:amplify_core/amplify_core.dart' hide MfaConfiguration, MfaType;
import 'package:amplify_core/src/config/amplify_outputs/auth/mfa.dart';
import 'package:amplify_core/src/config/amplify_outputs/auth/oauth_outputs.dart';
import 'package:amplify_core/src/config/amplify_outputs/auth/password_policy.dart';
import 'package:amplify_core/amplify_core.dart';

part 'auth_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.auth_outputs}
/// The auth outputs used by Auth category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 outputs for Auth category.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class AuthOutputs
with AWSEquatable<AuthOutputs>, AWSSerializable, AWSDebuggable {
/// {@macro amplify_core.amplify_outputs.auth_outputs}
const AuthOutputs({
required this.awsRegion,
required this.userPoolId,
required this.userPoolClientId,
this.userPoolId,
this.userPoolClientId,
this.identityPoolId,
this.passwordPolicy,
this.oauth,
Expand All @@ -38,10 +34,10 @@ class AuthOutputs
final String awsRegion;

/// The Cognito User Pool ID.
final String userPoolId;
final String? userPoolId;

/// The Cognito User Pool Client ID.
final String userPoolClientId;
final String? userPoolClientId;

/// The Cognito Identity Pool ID.
final String? identityPoolId;
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import 'package:json_annotation/json_annotation.dart';

/// {@template amplify_core.amplify_outputs.maf_method}
/// The MFA method of Amazon Cognito User Pool for
/// sending the authorization code.
/// The MFA method of Amazon Cognito User Pool.
/// {@endtemplate}
enum MfaMethod {
@JsonValue('SMS')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import 'package:amplify_core/amplify_core.dart' hide SocialProvider;
import 'package:amplify_core/src/config/amplify_outputs/auth/identity_provider.dart';
import 'package:amplify_core/src/config/amplify_outputs/auth/response_type.dart';
import 'package:amplify_core/amplify_core.dart';

part 'oauth_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.oauth_outputs}
/// The oauth outputs used by Auth category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 outputs for oauth.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class OAuthOutputs
Expand Down Expand Up @@ -42,8 +39,8 @@ class OAuthOutputs
/// URIs used to redirect after signing out.
final List<String> redirectSignOutUri;

/// {@macro amplify_core.amplify_outputs.response_type}
final ResponseType responseType;
/// {@macro amplify_core.amplify_outputs.oauth_response_type}
final OAuthResponseType responseType;

@override
List<Object?> get props => [
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import 'package:json_annotation/json_annotation.dart';

/// {@template amplify_core.amplify_outputs.response_type}
/// {@template amplify_core.amplify_outputs.oauth_response_type}
/// The response type for identity providers set on Amazon Cognito.
/// {@endtemplate}
enum ResponseType {
enum OAuthResponseType {
@JsonValue('code')
code,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class PasswordPolicy
/// {@macro amplify_core.amplify_outputs.password_policy}
const PasswordPolicy({
this.minLength,
this.requireNumbers,
this.requireLowercase,
this.requireUppercase,
this.requireSymbols,
this.requireNumbers = false,
this.requireLowercase = false,
this.requireUppercase = false,
this.requireSymbols = false,
});

factory PasswordPolicy.fromJson(Map<String, Object?> json) =>
Expand All @@ -27,16 +27,16 @@ class PasswordPolicy
final int? minLength;

/// Requires numbers.
final bool? requireNumbers;
final bool requireNumbers;

/// Requires lower case.
final bool? requireLowercase;
final bool requireLowercase;

/// Requires upper case.
final bool? requireUppercase;
final bool requireUppercase;

/// Requires symbols.
final bool? requireSymbols;
final bool requireSymbols;

@override
List<Object?> get props => [
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import 'package:amplify_core/amplify_core.dart';
part 'data_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.data_outputs}
/// The data outputs used by API GraphQL category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 outputs for API GraphQL category.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class DataOutputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:amplify_core/amplify_core.dart';
import 'package:amplify_core/src/config/amplify_outputs/notifications/amazon_pinpoint_channel.dart';

part 'notifications_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.notifications_outputs}
/// The notifications outputs used by Notifications category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 outputs for Notifications category.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class NotificationsOutputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import 'package:amplify_core/amplify_core.dart';
part 'storage_outputs.g.dart';

/// {@template amplify_core.amplify_outputs.storage_outputs}
/// The storage outputs used by Storage category plugin
/// to communicate with backend services.
/// The Amplify Gen 2 outputs for Storage category.
/// {@endtemplate}
@zAmplifyOutputsSerializable
class StorageOutputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// GENERATED FILE. DO NOT MODIFY BY HAND.

// It uses json-schema-faker to generate a sample json from the Amplify CLI GEN2 client-config-schema.
// It uses json-schema-faker to generate a sample json from the Amplify GEN 2 client-config-schema.
// Run below commands to regenerate a sample json.
// curl https://raw.githubusercontent.com/aws-amplify/amplify-backend/main/packages/client-config/src/client-config-schema/schema_v1.json -o schema_v1.json
// npx json-schema-faker -s schema_v1.json -o sample.json --alwaysFakeOptionals
Expand Down

0 comments on commit 21a0c89

Please sign in to comment.