-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: support multiple graphql or rest APIs (#4982)
- Loading branch information
1 parent
c478e98
commit bbbab89
Showing
10 changed files
with
274 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
12 changes: 8 additions & 4 deletions
12
packages/amplify_core/lib/src/config/amplify_outputs/amplify_outputs.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
packages/amplify_core/lib/src/config/amplify_outputs/rest_api/rest_api_outputs.dart
This file contains 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,55 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
part 'rest_api_outputs.g.dart'; | ||
|
||
/// {@template amplify_core.amplify_outputs.rest_api_outputs} | ||
/// An internal representation of Rest API. | ||
/// | ||
/// This class should not be exposed publicly since the Gen 2 schema does not | ||
/// support Rest API. This class exists to support Gen 1 configs that use Rest API. | ||
/// {@endtemplate} | ||
@zAmplifyOutputsSerializable | ||
class RestApiOutputs | ||
with AWSEquatable<RestApiOutputs>, AWSSerializable, AWSDebuggable { | ||
/// {@macro amplify_core.amplify_outputs.rest_api_outputs} | ||
const RestApiOutputs({ | ||
required this.awsRegion, | ||
required this.url, | ||
this.apiKey, | ||
required this.authorizationType, | ||
}); | ||
|
||
factory RestApiOutputs.fromJson(Map<String, Object?> json) => | ||
_$RestApiOutputsFromJson(json); | ||
|
||
/// The AWS region of Amazon AWS Gateway resources. | ||
final String awsRegion; | ||
|
||
/// The AWS Gateway endpoint URL. | ||
final String url; | ||
|
||
/// The AppSync API Key. | ||
final String? apiKey; | ||
|
||
/// The authorization type. | ||
final APIAuthorizationType authorizationType; | ||
|
||
@override | ||
List<Object?> get props => [ | ||
awsRegion, | ||
url, | ||
apiKey, | ||
authorizationType, | ||
]; | ||
|
||
@override | ||
String get runtimeTypeName => 'RestApiOutputs'; | ||
|
||
@override | ||
Object? toJson() { | ||
return _$RestApiOutputsToJson(this); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
packages/amplify_core/lib/src/config/amplify_outputs/rest_api/rest_api_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 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
This file contains 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
This file contains 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
This file contains 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.