* build endpoint to get asset count by month * Added asset repository * Added create asset * get asset by device ID * Added test for existing methods * Refactor additional endpoint * Refactor database api to get curated locations and curated objects * Refactor get search properties * Fixed cookies parsing for websocket * Added API to get asset count by time group * Remove unused code
20 KiB
openapi.api.AssetApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to /api
Method | HTTP request | Description |
---|---|---|
checkDuplicateAsset | POST /asset/check | |
deleteAsset | DELETE /asset | |
downloadFile | GET /asset/download | |
getAllAssets | GET /asset | |
getAssetById | GET /asset/assetById/{assetId} | |
getAssetCountByTimeGroup | GET /asset/count-by-date | |
getAssetSearchTerms | GET /asset/search-terms | |
getAssetThumbnail | GET /asset/thumbnail/{assetId} | |
getCuratedLocations | GET /asset/curated-locations | |
getCuratedObjects | GET /asset/curated-objects | |
getUserAssetsByDeviceId | GET /asset/{deviceId} | |
searchAsset | POST /asset/search | |
serveFile | GET /asset/file | |
uploadFile | POST /asset/upload |
checkDuplicateAsset
CheckDuplicateAssetResponseDto checkDuplicateAsset(checkDuplicateAssetDto)
Check duplicated asset before uploading - for Web upload used
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final checkDuplicateAssetDto = CheckDuplicateAssetDto(); // CheckDuplicateAssetDto |
try {
final result = api_instance.checkDuplicateAsset(checkDuplicateAssetDto);
print(result);
} catch (e) {
print('Exception when calling AssetApi->checkDuplicateAsset: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
checkDuplicateAssetDto | CheckDuplicateAssetDto |
Return type
CheckDuplicateAssetResponseDto
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteAsset
List deleteAsset(deleteAssetDto)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final deleteAssetDto = DeleteAssetDto(); // DeleteAssetDto |
try {
final result = api_instance.deleteAsset(deleteAssetDto);
print(result);
} catch (e) {
print('Exception when calling AssetApi->deleteAsset: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
deleteAssetDto | DeleteAssetDto |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
downloadFile
Object downloadFile(aid, did, isThumb, isWeb)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final aid = aid_example; // String |
final did = did_example; // String |
final isThumb = true; // bool |
final isWeb = true; // bool |
try {
final result = api_instance.downloadFile(aid, did, isThumb, isWeb);
print(result);
} catch (e) {
print('Exception when calling AssetApi->downloadFile: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aid | String | ||
did | String | ||
isThumb | bool | [optional] | |
isWeb | bool | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getAllAssets
List getAllAssets()
Get all AssetEntity belong to the user
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
try {
final result = api_instance.getAllAssets();
print(result);
} catch (e) {
print('Exception when calling AssetApi->getAllAssets: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getAssetById
AssetResponseDto getAssetById(assetId)
Get a single asset's information
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final assetId = assetId_example; // String |
try {
final result = api_instance.getAssetById(assetId);
print(result);
} catch (e) {
print('Exception when calling AssetApi->getAssetById: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assetId | String |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getAssetCountByTimeGroup
AssetCountByTimeGroupResponseDto getAssetCountByTimeGroup(getAssetCountByTimeGroupDto)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final getAssetCountByTimeGroupDto = GetAssetCountByTimeGroupDto(); // GetAssetCountByTimeGroupDto |
try {
final result = api_instance.getAssetCountByTimeGroup(getAssetCountByTimeGroupDto);
print(result);
} catch (e) {
print('Exception when calling AssetApi->getAssetCountByTimeGroup: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
getAssetCountByTimeGroupDto | GetAssetCountByTimeGroupDto |
Return type
AssetCountByTimeGroupResponseDto
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getAssetSearchTerms
List getAssetSearchTerms()
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
try {
final result = api_instance.getAssetSearchTerms();
print(result);
} catch (e) {
print('Exception when calling AssetApi->getAssetSearchTerms: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
List
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getAssetThumbnail
Object getAssetThumbnail(assetId, format)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final assetId = assetId_example; // String |
final format = ; // ThumbnailFormat |
try {
final result = api_instance.getAssetThumbnail(assetId, format);
print(result);
} catch (e) {
print('Exception when calling AssetApi->getAssetThumbnail: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assetId | String | ||
format | ThumbnailFormat | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getCuratedLocations
List getCuratedLocations()
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
try {
final result = api_instance.getCuratedLocations();
print(result);
} catch (e) {
print('Exception when calling AssetApi->getCuratedLocations: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getCuratedObjects
List getCuratedObjects()
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
try {
final result = api_instance.getCuratedObjects();
print(result);
} catch (e) {
print('Exception when calling AssetApi->getCuratedObjects: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getUserAssetsByDeviceId
List getUserAssetsByDeviceId(deviceId)
Get all asset of a device that are in the database, ID only.
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final deviceId = deviceId_example; // String |
try {
final result = api_instance.getUserAssetsByDeviceId(deviceId);
print(result);
} catch (e) {
print('Exception when calling AssetApi->getUserAssetsByDeviceId: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
deviceId | String |
Return type
List
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
searchAsset
List searchAsset(searchAssetDto)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final searchAssetDto = SearchAssetDto(); // SearchAssetDto |
try {
final result = api_instance.searchAsset(searchAssetDto);
print(result);
} catch (e) {
print('Exception when calling AssetApi->searchAsset: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
searchAssetDto | SearchAssetDto |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
serveFile
Object serveFile(aid, did, isThumb, isWeb)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final aid = aid_example; // String |
final did = did_example; // String |
final isThumb = true; // bool |
final isWeb = true; // bool |
try {
final result = api_instance.serveFile(aid, did, isThumb, isWeb);
print(result);
} catch (e) {
print('Exception when calling AssetApi->serveFile: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aid | String | ||
did | String | ||
isThumb | bool | [optional] | |
isWeb | bool | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
uploadFile
AssetFileUploadResponseDto uploadFile(assetData)
Example
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final assetData = BINARY_DATA_HERE; // MultipartFile |
try {
final result = api_instance.uploadFile(assetData);
print(result);
} catch (e) {
print('Exception when calling AssetApi->uploadFile: $e\n');
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assetData | MultipartFile |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]