This repository has been archived by the owner on Jan 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
352 additions
and
256 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
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,11 @@ | ||
import 'package:api_client/api_client.dart'; | ||
|
||
Future<void> main() async { | ||
final apiClient = ApiClient( | ||
baseUrl: '', | ||
); | ||
final questionsResource = apiClient.questionsResource; | ||
final answer = await questionsResource.getVertexResponse('random'); | ||
// ignore: avoid_print | ||
print(answer); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export 'vertex_document.dart'; | ||
export 'vertex_metadata.dart'; | ||
export 'vertex_response.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,26 @@ | ||
import 'package:api_client/api_client.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'vertex_document.g.dart'; | ||
|
||
/// {@template vertex_document} | ||
/// Vertex document | ||
/// {@endtemplate} | ||
@JsonSerializable(createToJson: false) | ||
class VertexDocument extends Equatable { | ||
/// {@macro vertex_document} | ||
const VertexDocument({ | ||
required this.metadata, | ||
}); | ||
|
||
/// Convert from Map<String, dynamic> to [VertexDocument] | ||
factory VertexDocument.fromJson(Map<String, dynamic> json) => | ||
_$VertexDocumentFromJson(json); | ||
|
||
/// Metadata. | ||
final VertexMetadata metadata; | ||
|
||
@override | ||
List<Object?> get props => [metadata]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:api_client/api_client.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'vertex_metadata.g.dart'; | ||
|
||
/// {@template vertex_metadata} | ||
/// Vertex metadata inside a [VertexResponse] | ||
/// {@endtemplate} | ||
@JsonSerializable(createToJson: false) | ||
class VertexMetadata extends Equatable { | ||
/// {@macro vertex_metadata} | ||
const VertexMetadata({ | ||
required this.url, | ||
required this.title, | ||
required this.description, | ||
}); | ||
|
||
/// Convert from Map<String, dynamic> to [VertexMetadata] | ||
factory VertexMetadata.fromJson(Map<String, dynamic> json) => | ||
_$VertexMetadataFromJson(json); | ||
|
||
/// Url | ||
final String url; | ||
|
||
/// Title | ||
final String title; | ||
|
||
/// Description | ||
final String description; | ||
|
||
@override | ||
List<Object?> get props => [url, title, description]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:api_client/api_client.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'vertex_response.g.dart'; | ||
|
||
/// {@template vertex_response} | ||
/// Vertex response | ||
/// {@endtemplate} | ||
@JsonSerializable(createToJson: false) | ||
class VertexResponse extends Equatable { | ||
/// {@macro vertex_response} | ||
const VertexResponse({ | ||
required this.summary, | ||
required this.documents, | ||
}); | ||
|
||
/// Convert from Map<String, dynamic> to [VertexResponse] | ||
factory VertexResponse.fromJson(Map<String, dynamic> json) => | ||
_$VertexResponseFromJson(json); | ||
|
||
/// Summary. | ||
final String summary; | ||
|
||
/// Documents. | ||
final List<VertexDocument> documents; | ||
|
||
@override | ||
List<Object?> get props => [documents]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.