yago_cloud

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

yago cloud

yago_cloud #
Augemented Reality Made Easy.
A generated Yago Cloud API Client for Flutter & Dart.

More on Yago: https://yago.cloud
API Docs: https://yago.cloud/api/doc/

Requirements #
Dart 2.12 or later
Installation & Usage #
Install via pub.dev:
flutter pub add yago_cloud
copied to clipboard
Getting Started #
Here's a small example how to list all projects:
import 'dart:io';
import 'dart:developer';
import 'package:yago_cloud/api.dart';

listProjects() async {
try {
final authApi = AuthApi();
final loginResult = await authApi.authLoginCreate(
TokenObtainRequest(
email: '<YAGO-ACCOUNT-EMAIL>',
password: '<YAGO-ACCOUNT-PASSWORD>',
),
);

final accessToken = loginResult!.access;
print('Login successful!');

final bearerAuth = HttpBearerAuth();
bearerAuth.accessToken = accessToken;
final apiClient = ApiClient(authentication: bearerAuth);

final projectsApi = ProjectsApi(apiClient);
final projectList = await projectsApi.projectsList();
projectList!.sort((project, other) => project.modified.compareTo(other.modified));

print('## Yago projects list');
for (final project in projectList) {
print('- ${project.name}');
}

print('## Yago models list');
final modelsApi = ModelsApi(apiClient);
final modelsList = await modelsApi.modelsList(project: projectList.first.id);
for (final model in modelsList ?? []) {
print('- ${model.name}');
}

} on ApiException catch (error) {
log('Login Failed: ', error: error);
}
}

Future<void> main() async {
await listProjects();
exit(0);
}
copied to clipboard
API Authorization #
There 2 major ways to authenticate with Yago API:
jwtAuth #
Login with email address and password.

Type: HTTP Bearer authentication

tokenAuth #
Use a fixed API token pinned to a User.

Type: API key
API key parameter name: Authorization
Location: HTTP header

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.