2022-07-13 14:23:48 +02:00
|
|
|
//
|
|
|
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
|
|
|
//
|
|
|
|
// @dart=2.12
|
|
|
|
|
|
|
|
// ignore_for_file: unused_element, unused_import
|
|
|
|
// ignore_for_file: always_put_required_named_parameters_first
|
|
|
|
// ignore_for_file: constant_identifier_names
|
|
|
|
// ignore_for_file: lines_longer_than_80_chars
|
|
|
|
|
|
|
|
part of openapi.api;
|
|
|
|
|
|
|
|
|
|
|
|
class AssetApi {
|
|
|
|
AssetApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
|
|
|
|
|
|
|
final ApiClient apiClient;
|
|
|
|
|
2023-05-24 23:08:21 +02:00
|
|
|
/// Checks if assets exist by checksums
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
|
2023-11-04 03:33:15 +02:00
|
|
|
Future<Response> checkBulkUploadWithHttpInfo(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
|
2023-05-24 23:08:21 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/bulk-upload-check';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = assetBulkUploadCheckDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Checks if assets exist by checksums
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
|
2023-11-04 03:33:15 +02:00
|
|
|
Future<AssetBulkUploadCheckResponseDto?> checkBulkUpload(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
|
|
|
|
final response = await checkBulkUploadWithHttpInfo(assetBulkUploadCheckDto,);
|
2023-05-24 23:08:21 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetBulkUploadCheckResponseDto',) as AssetBulkUploadCheckResponseDto;
|
2023-02-15 23:21:22 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-10-25 16:51:03 +02:00
|
|
|
/// Checks if multiple assets exist on the server and returns all existing - used by background backup
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
|
|
|
|
Future<Response> checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/exist';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = checkExistingAssetsDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Checks if multiple assets exist on the server and returns all existing - used by background backup
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
|
|
|
|
Future<CheckExistingAssetsResponseDto?> checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async {
|
|
|
|
final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,);
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-18 18:26:04 +02:00
|
|
|
/// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-10-06 09:01:14 +02:00
|
|
|
/// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
|
|
|
|
Future<Response> deleteAssetsWithHttpInfo(AssetBulkDeleteDto assetBulkDeleteDto,) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
2023-10-06 09:01:14 +02:00
|
|
|
Object? postBody = assetBulkDeleteDto;
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'DELETE',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-10-06 09:01:14 +02:00
|
|
|
/// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
|
|
|
|
Future<void> deleteAssets(AssetBulkDeleteDto assetBulkDeleteDto,) async {
|
|
|
|
final response = await deleteAssetsWithHttpInfo(assetBulkDeleteDto,);
|
2022-07-13 14:23:48 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get all AssetEntity belong to the user
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
2022-11-26 18:16:02 +02:00
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] ifNoneMatch:
|
|
|
|
/// ETag of data already cached on the client
|
2023-11-06 19:40:43 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] isArchived:
|
2023-05-25 05:52:43 +02:00
|
|
|
///
|
2023-01-24 06:16:20 +02:00
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [int] skip:
|
|
|
|
///
|
|
|
|
/// * [int] take:
|
2023-04-12 17:37:52 +02:00
|
|
|
///
|
2023-08-24 21:28:50 +02:00
|
|
|
/// * [DateTime] updatedAfter:
|
|
|
|
///
|
2023-11-06 19:40:43 +02:00
|
|
|
/// * [DateTime] updatedBefore:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] userId:
|
|
|
|
Future<Response> getAllAssetsWithHttpInfo({ String? ifNoneMatch, bool? isArchived, bool? isFavorite, int? skip, int? take, DateTime? updatedAfter, DateTime? updatedBefore, String? userId, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2024-01-22 18:49:51 +02:00
|
|
|
if (isArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
2023-11-06 19:40:43 +02:00
|
|
|
if (skip != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'skip', skip));
|
|
|
|
}
|
|
|
|
if (take != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'take', take));
|
|
|
|
}
|
2023-08-24 21:28:50 +02:00
|
|
|
if (updatedAfter != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
|
|
|
|
}
|
2023-11-06 19:40:43 +02:00
|
|
|
if (updatedBefore != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (userId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'userId', userId));
|
|
|
|
}
|
2023-01-24 06:16:20 +02:00
|
|
|
|
2022-11-26 18:16:02 +02:00
|
|
|
if (ifNoneMatch != null) {
|
|
|
|
headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
|
|
|
|
}
|
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get all AssetEntity belong to the user
|
2022-11-26 18:16:02 +02:00
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] ifNoneMatch:
|
|
|
|
/// ETag of data already cached on the client
|
2023-11-06 19:40:43 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] isArchived:
|
2023-05-25 05:52:43 +02:00
|
|
|
///
|
2023-01-24 06:16:20 +02:00
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [int] skip:
|
|
|
|
///
|
|
|
|
/// * [int] take:
|
2023-04-12 17:37:52 +02:00
|
|
|
///
|
2023-08-24 21:28:50 +02:00
|
|
|
/// * [DateTime] updatedAfter:
|
|
|
|
///
|
2023-11-06 19:40:43 +02:00
|
|
|
/// * [DateTime] updatedBefore:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] userId:
|
|
|
|
Future<List<AssetResponseDto>?> getAllAssets({ String? ifNoneMatch, bool? isArchived, bool? isFavorite, int? skip, int? take, DateTime? updatedAfter, DateTime? updatedBefore, String? userId, }) async {
|
|
|
|
final response = await getAllAssetsWithHttpInfo( ifNoneMatch: ifNoneMatch, isArchived: isArchived, isFavorite: isFavorite, skip: skip, take: take, updatedAfter: updatedAfter, updatedBefore: updatedBefore, userId: userId, );
|
2022-07-13 14:23:48 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
|
|
|
|
.cast<AssetResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-11-25 17:46:20 +02:00
|
|
|
/// Get all asset of a device that are in the database, ID only.
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] deviceId (required):
|
|
|
|
Future<Response> getAllUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/device/{deviceId}'
|
|
|
|
.replaceAll('{deviceId}', deviceId);
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get all asset of a device that are in the database, ID only.
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] deviceId (required):
|
|
|
|
Future<List<String>?> getAllUserAssetsByDeviceId(String deviceId,) async {
|
|
|
|
final response = await getAllUserAssetsByDeviceIdWithHttpInfo(deviceId,);
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
|
|
|
|
.cast<String>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-11-25 17:46:20 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2024-01-25 19:52:21 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/{id}' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] id (required):
|
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> getAssetInfoWithHttpInfo(String id, { String? key, }) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/{id}'
|
|
|
|
.replaceAll('{id}', id);
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] id (required):
|
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<AssetResponseDto?> getAssetInfo(String id, { String? key, }) async {
|
|
|
|
final response = await getAssetInfoWithHttpInfo(id, key: key, );
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-07-14 15:30:17 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
|
|
|
|
Future<Response> getAssetSearchTermsWithHttpInfo() async {
|
2022-09-07 22:16:18 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2023-07-14 15:30:17 +02:00
|
|
|
final path = r'/asset/search-terms';
|
2022-09-07 22:16:18 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-14 15:30:17 +02:00
|
|
|
Future<List<String>?> getAssetSearchTerms() async {
|
|
|
|
final response = await getAssetSearchTermsWithHttpInfo();
|
2022-09-07 22:16:18 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
2023-07-14 15:30:17 +02:00
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
|
|
|
|
.cast<String>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-07-14 15:30:17 +02:00
|
|
|
|
2022-09-07 22:16:18 +02:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-07-14 15:30:17 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/statistics' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
2023-10-06 09:01:14 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isTrashed:
|
2023-11-04 03:33:15 +02:00
|
|
|
Future<Response> getAssetStatisticsWithHttpInfo({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2023-07-14 15:30:17 +02:00
|
|
|
final path = r'/asset/statistics';
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2023-07-14 15:30:17 +02:00
|
|
|
if (isArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
2023-10-06 09:01:14 +02:00
|
|
|
if (isTrashed != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
|
|
|
|
}
|
2023-07-14 15:30:17 +02:00
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-14 15:30:17 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
2023-10-06 09:01:14 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isTrashed:
|
2023-11-04 03:33:15 +02:00
|
|
|
Future<AssetStatsResponseDto?> getAssetStatistics({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
|
|
|
|
final response = await getAssetStatisticsWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, );
|
2022-07-13 14:23:48 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
2023-07-14 15:30:17 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
|
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-06-02 04:19:25 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-06-02 04:19:25 +02:00
|
|
|
/// * [String] id (required):
|
2022-07-16 06:18:17 +02:00
|
|
|
///
|
|
|
|
/// * [ThumbnailFormat] format:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
2023-06-02 04:19:25 +02:00
|
|
|
Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2023-06-02 04:19:25 +02:00
|
|
|
final path = r'/asset/thumbnail/{id}'
|
|
|
|
.replaceAll('{id}', id);
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2022-07-16 06:18:17 +02:00
|
|
|
if (format != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'format', format));
|
|
|
|
}
|
2023-02-24 18:01:10 +02:00
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
2022-07-16 06:18:17 +02:00
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-06-02 04:19:25 +02:00
|
|
|
/// * [String] id (required):
|
2022-07-16 06:18:17 +02:00
|
|
|
///
|
|
|
|
/// * [ThumbnailFormat] format:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
2023-07-07 00:25:56 +02:00
|
|
|
Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
|
2023-06-02 04:19:25 +02:00
|
|
|
final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
|
2022-07-13 14:23:48 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
2023-07-07 00:25:56 +02:00
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
2022-07-13 14:23:48 +02:00
|
|
|
}
|
|
|
|
|
2023-04-18 18:26:04 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
Future<Response> getCuratedLocationsWithHttpInfo() async {
|
|
|
|
// ignore: prefer_const_declarations
|
2022-08-27 07:53:37 +02:00
|
|
|
final path = r'/asset/curated-locations';
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
|
|
|
|
final response = await getCuratedLocationsWithHttpInfo();
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
|
|
|
|
.cast<CuratedLocationsResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-18 18:26:04 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
Future<Response> getCuratedObjectsWithHttpInfo() async {
|
|
|
|
// ignore: prefer_const_declarations
|
2022-08-27 07:53:37 +02:00
|
|
|
final path = r'/asset/curated-objects';
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
|
|
|
|
final response = await getCuratedObjectsWithHttpInfo();
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
|
|
|
|
.cast<CuratedObjectsResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-05-21 08:26:06 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
|
2023-05-06 03:33:30 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-05-25 18:47:52 +02:00
|
|
|
/// * [DateTime] fileCreatedAfter:
|
|
|
|
///
|
|
|
|
/// * [DateTime] fileCreatedBefore:
|
2024-01-22 18:49:51 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
2024-02-14 17:07:00 +02:00
|
|
|
///
|
|
|
|
/// * [bool] withPartners:
|
|
|
|
Future<Response> getMapMarkersWithHttpInfo({ DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, bool? isArchived, bool? isFavorite, bool? withPartners, }) async {
|
2023-05-06 03:33:30 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/map-marker';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2023-05-25 18:47:52 +02:00
|
|
|
if (fileCreatedAfter != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
|
|
|
|
}
|
|
|
|
if (fileCreatedBefore != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (isArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
2024-02-14 17:07:00 +02:00
|
|
|
if (withPartners != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withPartners', withPartners));
|
|
|
|
}
|
2023-05-06 03:33:30 +02:00
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-05-25 18:47:52 +02:00
|
|
|
/// * [DateTime] fileCreatedAfter:
|
|
|
|
///
|
|
|
|
/// * [DateTime] fileCreatedBefore:
|
2024-01-22 18:49:51 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
2024-02-14 17:07:00 +02:00
|
|
|
///
|
|
|
|
/// * [bool] withPartners:
|
|
|
|
Future<List<MapMarkerResponseDto>?> getMapMarkers({ DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, bool? isArchived, bool? isFavorite, bool? withPartners, }) async {
|
|
|
|
final response = await getMapMarkersWithHttpInfo( fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, isArchived: isArchived, isFavorite: isFavorite, withPartners: withPartners, );
|
2023-05-06 03:33:30 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
|
|
|
|
.cast<MapMarkerResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-05-06 03:33:30 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-06-15 03:47:18 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/memory-lane' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-10-05 00:11:11 +02:00
|
|
|
/// * [int] day (required):
|
|
|
|
///
|
|
|
|
/// * [int] month (required):
|
|
|
|
Future<Response> getMemoryLaneWithHttpInfo(int day, int month,) async {
|
2023-06-15 03:47:18 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/memory-lane';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2023-10-05 00:11:11 +02:00
|
|
|
queryParams.addAll(_queryParams('', 'day', day));
|
|
|
|
queryParams.addAll(_queryParams('', 'month', month));
|
2023-06-15 03:47:18 +02:00
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-10-05 00:11:11 +02:00
|
|
|
/// * [int] day (required):
|
|
|
|
///
|
|
|
|
/// * [int] month (required):
|
|
|
|
Future<List<MemoryLaneResponseDto>?> getMemoryLane(int day, int month,) async {
|
|
|
|
final response = await getMemoryLaneWithHttpInfo(day, month,);
|
2023-06-15 03:47:18 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<MemoryLaneResponseDto>') as List)
|
|
|
|
.cast<MemoryLaneResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-06-15 03:47:18 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-09-23 17:28:55 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/random' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [num] count:
|
|
|
|
Future<Response> getRandomWithHttpInfo({ num? count, }) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/random';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
if (count != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'count', count));
|
|
|
|
}
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [num] count:
|
|
|
|
Future<List<AssetResponseDto>?> getRandom({ num? count, }) async {
|
|
|
|
final response = await getRandomWithHttpInfo( count: count, );
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
|
|
|
|
.cast<AssetResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-09-23 17:28:55 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-11-04 03:33:15 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/time-bucket' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [TimeBucketSize] size (required):
|
|
|
|
///
|
|
|
|
/// * [String] timeBucket (required):
|
|
|
|
///
|
|
|
|
/// * [String] albumId:
|
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
|
|
|
/// * [bool] isTrashed:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
|
|
|
/// * [String] personId:
|
|
|
|
///
|
|
|
|
/// * [String] userId:
|
2023-11-04 03:33:15 +02:00
|
|
|
///
|
2023-11-11 23:06:19 +02:00
|
|
|
/// * [bool] withPartners:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withStacked:
|
|
|
|
Future<Response> getTimeBucketWithHttpInfo(TimeBucketSize size, String timeBucket, { String? albumId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, String? personId, String? userId, bool? withPartners, bool? withStacked, }) async {
|
2023-11-04 03:33:15 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/time-bucket';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
if (albumId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'albumId', albumId));
|
|
|
|
}
|
|
|
|
if (isArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
|
|
|
if (isTrashed != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
|
|
|
if (personId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'personId', personId));
|
|
|
|
}
|
|
|
|
queryParams.addAll(_queryParams('', 'size', size));
|
|
|
|
queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
|
|
|
|
if (userId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'userId', userId));
|
2023-11-11 23:06:19 +02:00
|
|
|
}
|
|
|
|
if (withPartners != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withPartners', withPartners));
|
2023-11-04 03:33:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (withStacked != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withStacked', withStacked));
|
2023-11-04 03:33:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [TimeBucketSize] size (required):
|
|
|
|
///
|
|
|
|
/// * [String] timeBucket (required):
|
|
|
|
///
|
|
|
|
/// * [String] albumId:
|
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
|
|
|
/// * [bool] isTrashed:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
|
|
|
/// * [String] personId:
|
|
|
|
///
|
|
|
|
/// * [String] userId:
|
2023-11-04 03:33:15 +02:00
|
|
|
///
|
2023-11-11 23:06:19 +02:00
|
|
|
/// * [bool] withPartners:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withStacked:
|
|
|
|
Future<List<AssetResponseDto>?> getTimeBucket(TimeBucketSize size, String timeBucket, { String? albumId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, String? personId, String? userId, bool? withPartners, bool? withStacked, }) async {
|
|
|
|
final response = await getTimeBucketWithHttpInfo(size, timeBucket, albumId: albumId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, key: key, personId: personId, userId: userId, withPartners: withPartners, withStacked: withStacked, );
|
2023-11-04 03:33:15 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
|
|
|
|
.cast<AssetResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-11-04 03:33:15 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-08-04 23:07:15 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/time-buckets' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [TimeBucketSize] size (required):
|
|
|
|
///
|
|
|
|
/// * [String] albumId:
|
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
2023-10-06 09:01:14 +02:00
|
|
|
/// * [bool] isTrashed:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
|
|
|
/// * [String] personId:
|
|
|
|
///
|
|
|
|
/// * [String] userId:
|
2023-10-27 22:34:01 +02:00
|
|
|
///
|
2023-11-11 23:06:19 +02:00
|
|
|
/// * [bool] withPartners:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withStacked:
|
|
|
|
Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? albumId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, String? personId, String? userId, bool? withPartners, bool? withStacked, }) async {
|
2023-08-04 23:07:15 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/time-buckets';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
if (albumId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'albumId', albumId));
|
|
|
|
}
|
|
|
|
if (isArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
2023-10-06 09:01:14 +02:00
|
|
|
if (isTrashed != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
|
|
|
if (personId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'personId', personId));
|
|
|
|
}
|
|
|
|
queryParams.addAll(_queryParams('', 'size', size));
|
|
|
|
if (userId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'userId', userId));
|
2023-10-27 22:34:01 +02:00
|
|
|
}
|
2023-11-11 23:06:19 +02:00
|
|
|
if (withPartners != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withPartners', withPartners));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (withStacked != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withStacked', withStacked));
|
2023-08-04 23:07:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [TimeBucketSize] size (required):
|
|
|
|
///
|
|
|
|
/// * [String] albumId:
|
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
2023-10-06 09:01:14 +02:00
|
|
|
/// * [bool] isTrashed:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
|
|
|
/// * [String] personId:
|
|
|
|
///
|
|
|
|
/// * [String] userId:
|
2023-10-27 22:34:01 +02:00
|
|
|
///
|
2023-11-11 23:06:19 +02:00
|
|
|
/// * [bool] withPartners:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withStacked:
|
|
|
|
Future<List<TimeBucketResponseDto>?> getTimeBuckets(TimeBucketSize size, { String? albumId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, String? personId, String? userId, bool? withPartners, bool? withStacked, }) async {
|
|
|
|
final response = await getTimeBucketsWithHttpInfo(size, albumId: albumId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, key: key, personId: personId, userId: userId, withPartners: withPartners, withStacked: withStacked, );
|
2023-08-04 23:07:15 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketResponseDto>') as List)
|
|
|
|
.cast<TimeBucketResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2023-08-04 23:07:15 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-08-18 16:31:48 +02:00
|
|
|
/// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AssetJobsDto] assetJobsDto (required):
|
|
|
|
Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/jobs';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = assetJobsDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AssetJobsDto] assetJobsDto (required):
|
|
|
|
Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
|
|
|
|
final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-15 00:47:15 +02:00
|
|
|
/// Performs an HTTP 'GET /assets' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] checksum:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] city:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] country:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] createdAfter:
|
|
|
|
///
|
|
|
|
/// * [DateTime] createdBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
|
|
|
/// * [String] deviceAssetId:
|
|
|
|
///
|
|
|
|
/// * [String] deviceId:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] encodedVideoPath:
|
|
|
|
///
|
|
|
|
/// * [String] id:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isEncoded:
|
|
|
|
///
|
|
|
|
/// * [bool] isExternal:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
|
|
|
/// * [bool] isMotion:
|
|
|
|
///
|
|
|
|
/// * [bool] isOffline:
|
|
|
|
///
|
|
|
|
/// * [bool] isReadOnly:
|
|
|
|
///
|
|
|
|
/// * [bool] isVisible:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] lensModel:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] libraryId:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] make:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] model:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [AssetOrder] order:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] originalFileName:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] originalPath:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [num] page:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] resizePath:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [num] size:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] state:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
|
|
|
/// * [DateTime] takenAfter:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] takenBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] trashedAfter:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] trashedBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [AssetTypeEnum] type:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] updatedAfter:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] updatedBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] webpPath:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-02-13 03:50:47 +02:00
|
|
|
/// * [bool] withArchived:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withDeleted:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withExif:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withPeople:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withStacked:
|
2024-02-13 03:50:47 +02:00
|
|
|
Future<Response> searchAssetsWithHttpInfo({ String? checksum, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceAssetId, String? deviceId, String? encodedVideoPath, String? id, bool? isArchived, bool? isEncoded, bool? isExternal, bool? isFavorite, bool? isMotion, bool? isOffline, bool? isReadOnly, bool? isVisible, String? lensModel, String? libraryId, String? make, String? model, AssetOrder? order, String? originalFileName, String? originalPath, num? page, String? resizePath, num? size, String? state, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, String? webpPath, bool? withArchived, bool? withDeleted, bool? withExif, bool? withPeople, bool? withStacked, }) async {
|
2023-11-15 00:47:15 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/assets';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2024-01-22 18:49:51 +02:00
|
|
|
if (checksum != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'checksum', checksum));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (city != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'city', city));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (country != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'country', country));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (createdAfter != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'createdAfter', createdAfter));
|
|
|
|
}
|
|
|
|
if (createdBefore != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'createdBefore', createdBefore));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
|
|
|
if (deviceAssetId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'deviceAssetId', deviceAssetId));
|
|
|
|
}
|
|
|
|
if (deviceId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'deviceId', deviceId));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (encodedVideoPath != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'encodedVideoPath', encodedVideoPath));
|
|
|
|
}
|
|
|
|
if (id != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'id', id));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
|
|
|
if (isArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
|
|
|
}
|
|
|
|
if (isEncoded != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isEncoded', isEncoded));
|
|
|
|
}
|
|
|
|
if (isExternal != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isExternal', isExternal));
|
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
|
|
|
if (isMotion != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isMotion', isMotion));
|
|
|
|
}
|
|
|
|
if (isOffline != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isOffline', isOffline));
|
|
|
|
}
|
|
|
|
if (isReadOnly != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isReadOnly', isReadOnly));
|
|
|
|
}
|
|
|
|
if (isVisible != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isVisible', isVisible));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (lensModel != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'lensModel', lensModel));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (libraryId != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'libraryId', libraryId));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (make != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'make', make));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (model != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'model', model));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (order != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'order', order));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (originalFileName != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'originalFileName', originalFileName));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (originalPath != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'originalPath', originalPath));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (page != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'page', page));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (resizePath != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'resizePath', resizePath));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (size != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'size', size));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (state != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'state', state));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
|
|
|
if (takenAfter != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'takenAfter', takenAfter));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (takenBefore != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'takenBefore', takenBefore));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (trashedAfter != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'trashedAfter', trashedAfter));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (trashedBefore != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'trashedBefore', trashedBefore));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (type != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'type', type));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (updatedAfter != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (updatedBefore != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (webpPath != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'webpPath', webpPath));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-02-13 03:50:47 +02:00
|
|
|
if (withArchived != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withArchived', withArchived));
|
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (withDeleted != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (withExif != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withExif', withExif));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (withPeople != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withPeople', withPeople));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
2024-01-22 18:49:51 +02:00
|
|
|
if (withStacked != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'withStacked', withStacked));
|
2023-11-15 00:47:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] checksum:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] city:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] country:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] createdAfter:
|
|
|
|
///
|
|
|
|
/// * [DateTime] createdBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
|
|
|
/// * [String] deviceAssetId:
|
|
|
|
///
|
|
|
|
/// * [String] deviceId:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] encodedVideoPath:
|
|
|
|
///
|
|
|
|
/// * [String] id:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isArchived:
|
|
|
|
///
|
|
|
|
/// * [bool] isEncoded:
|
|
|
|
///
|
|
|
|
/// * [bool] isExternal:
|
|
|
|
///
|
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
|
|
|
/// * [bool] isMotion:
|
|
|
|
///
|
|
|
|
/// * [bool] isOffline:
|
|
|
|
///
|
|
|
|
/// * [bool] isReadOnly:
|
|
|
|
///
|
|
|
|
/// * [bool] isVisible:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] lensModel:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] libraryId:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] make:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] model:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [AssetOrder] order:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] originalFileName:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] originalPath:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [num] page:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] resizePath:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [num] size:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] state:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
|
|
|
/// * [DateTime] takenAfter:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] takenBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] trashedAfter:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] trashedBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [AssetTypeEnum] type:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] updatedAfter:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [DateTime] updatedBefore:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [String] webpPath:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-02-13 03:50:47 +02:00
|
|
|
/// * [bool] withArchived:
|
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withDeleted:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withExif:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withPeople:
|
2023-11-15 00:47:15 +02:00
|
|
|
///
|
2024-01-22 18:49:51 +02:00
|
|
|
/// * [bool] withStacked:
|
2024-02-13 03:50:47 +02:00
|
|
|
Future<List<AssetResponseDto>?> searchAssets({ String? checksum, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceAssetId, String? deviceId, String? encodedVideoPath, String? id, bool? isArchived, bool? isEncoded, bool? isExternal, bool? isFavorite, bool? isMotion, bool? isOffline, bool? isReadOnly, bool? isVisible, String? lensModel, String? libraryId, String? make, String? model, AssetOrder? order, String? originalFileName, String? originalPath, num? page, String? resizePath, num? size, String? state, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, String? webpPath, bool? withArchived, bool? withDeleted, bool? withExif, bool? withPeople, bool? withStacked, }) async {
|
|
|
|
final response = await searchAssetsWithHttpInfo( checksum: checksum, city: city, country: country, createdAfter: createdAfter, createdBefore: createdBefore, deviceAssetId: deviceAssetId, deviceId: deviceId, encodedVideoPath: encodedVideoPath, id: id, isArchived: isArchived, isEncoded: isEncoded, isExternal: isExternal, isFavorite: isFavorite, isMotion: isMotion, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, lensModel: lensModel, libraryId: libraryId, make: make, model: model, order: order, originalFileName: originalFileName, originalPath: originalPath, page: page, resizePath: resizePath, size: size, state: state, takenAfter: takenAfter, takenBefore: takenBefore, trashedAfter: trashedAfter, trashedBefore: trashedBefore, type: type, updatedAfter: updatedAfter, updatedBefore: updatedBefore, webpPath: webpPath, withArchived: withArchived, withDeleted: withDeleted, withExif: withExif, withPeople: withPeople, withStacked: withStacked, );
|
2023-11-15 00:47:15 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
final responseBody = await _decodeBodyBytes(response);
|
2022-07-13 14:23:48 +02:00
|
|
|
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
|
|
|
|
.cast<AssetResponseDto>()
|
2024-01-26 18:40:28 +02:00
|
|
|
.toList(growable: false);
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-06-02 04:19:25 +02:00
|
|
|
/// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-06-02 04:19:25 +02:00
|
|
|
/// * [String] id (required):
|
2022-07-13 14:23:48 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isThumb:
|
|
|
|
///
|
|
|
|
/// * [bool] isWeb:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
2023-06-02 04:19:25 +02:00
|
|
|
Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2023-06-02 04:19:25 +02:00
|
|
|
final path = r'/asset/file/{id}'
|
|
|
|
.replaceAll('{id}', id);
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
if (isThumb != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isThumb', isThumb));
|
|
|
|
}
|
|
|
|
if (isWeb != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isWeb', isWeb));
|
|
|
|
}
|
2023-02-24 18:01:10 +02:00
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-06-02 04:19:25 +02:00
|
|
|
/// * [String] id (required):
|
2022-07-13 14:23:48 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isThumb:
|
|
|
|
///
|
|
|
|
/// * [bool] isWeb:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
2023-07-07 00:25:56 +02:00
|
|
|
Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
|
2023-06-02 04:19:25 +02:00
|
|
|
final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
|
2022-07-13 14:23:48 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
2023-07-07 00:25:56 +02:00
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
2022-07-13 14:23:48 +02:00
|
|
|
}
|
|
|
|
|
2023-09-05 04:25:31 +02:00
|
|
|
/// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
|
2022-11-08 18:20:36 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-06-02 04:19:25 +02:00
|
|
|
/// * [String] id (required):
|
2022-11-08 18:20:36 +02:00
|
|
|
///
|
|
|
|
/// * [UpdateAssetDto] updateAssetDto (required):
|
2023-06-02 04:19:25 +02:00
|
|
|
Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
|
2022-11-08 18:20:36 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2023-06-02 04:19:25 +02:00
|
|
|
final path = r'/asset/{id}'
|
|
|
|
.replaceAll('{id}', id);
|
2022-11-08 18:20:36 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = updateAssetDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'PUT',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-06-02 04:19:25 +02:00
|
|
|
/// * [String] id (required):
|
2022-11-08 18:20:36 +02:00
|
|
|
///
|
|
|
|
/// * [UpdateAssetDto] updateAssetDto (required):
|
2023-06-02 04:19:25 +02:00
|
|
|
Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
|
|
|
|
final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
|
2022-11-08 18:20:36 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-08-16 22:04:55 +02:00
|
|
|
/// Performs an HTTP 'PUT /asset' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
|
|
|
|
Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = assetBulkUpdateDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'PUT',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
|
|
|
|
Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
|
|
|
|
final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-22 04:38:07 +02:00
|
|
|
/// Performs an HTTP 'PUT /asset/stack/parent' operation and returns the [Response].
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [UpdateStackParentDto] updateStackParentDto (required):
|
|
|
|
Future<Response> updateStackParentWithHttpInfo(UpdateStackParentDto updateStackParentDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/stack/parent';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = updateStackParentDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'PUT',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [UpdateStackParentDto] updateStackParentDto (required):
|
|
|
|
Future<void> updateStackParent(UpdateStackParentDto updateStackParentDto,) async {
|
|
|
|
final response = await updateStackParentWithHttpInfo(updateStackParentDto,);
|
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-18 18:26:04 +02:00
|
|
|
/// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [MultipartFile] assetData (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
|
|
|
/// * [String] deviceAssetId (required):
|
|
|
|
///
|
|
|
|
/// * [String] deviceId (required):
|
|
|
|
///
|
2023-05-29 16:05:14 +02:00
|
|
|
/// * [DateTime] fileCreatedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-05-29 16:05:14 +02:00
|
|
|
/// * [DateTime] fileModifiedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-02-24 18:01:10 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
2023-08-01 18:49:18 +02:00
|
|
|
/// * [String] duration:
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-08-01 18:49:18 +02:00
|
|
|
/// * [bool] isArchived:
|
feat(server): xmp sidecar metadata (#2466)
* initial commit for XMP sidecar support
* Added support for 'missing' metadata files to include those without sidecar files, now detects sidecar files in the filesystem for media already ingested but the sidecar was created afterwards
* didn't mean to commit default log level during testing
* new sidecar logic for video metadata as well
* Added xml mimetype for sidecars only
* don't need capture group for this regex
* wrong default value reverted
* simplified the move here - keep it in the same try catch since the outcome is to move the media back anyway
* simplified setter logic
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
* simplified logic per suggestions
* sidecar is now its own queue with a discover and sync, updated UI for the new job queueing
* queue a sidecar job for every asset based on discovery or sync, though the logic is almost identical aside from linking the sidecar
* now queue sidecar jobs for each assset, though logic is mostly the same between discovery and sync
* simplified logic of filename extraction and asset instantiation
* not sure how that got deleted..
* updated code per suggestions and comments in the PR
* stat was not being used, removed the variable set
* better type checking, using in-scope variables for exif getter instead of passing in every time
* removed commented out test
* ran and resolved all lints, formats, checks, and tests
* resolved suggested change in PR
* made getExifProperty more dynamic with multiple possible args for fallbacks, fixed typo, used generic in function for better type checking
* better error handling and moving files back to positions on move or save failure
* regenerated api
* format fixes
* Added XMP documentation
* documentation typo
* Merged in main
* missed merge conflict
* more changes due to a merge
* Resolving conflicts
* added icon for sidecar jobs
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-05-25 03:59:30 +02:00
|
|
|
///
|
2023-09-20 13:16:33 +02:00
|
|
|
/// * [bool] isExternal:
|
|
|
|
///
|
2023-11-06 16:04:39 +02:00
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
2023-09-20 13:16:33 +02:00
|
|
|
/// * [bool] isOffline:
|
|
|
|
///
|
feat(server): support for read-only assets and importing existing items in the filesystem (#2715)
* Added read-only flag for assets, endpoint to trigger file import vs upload
* updated fixtures with new property
* if upload is 'read-only', ensure there is no existing asset at the designated originalPath
* added test for file import as well as detecting existing image at read-only destination location
* Added storage service test for a case where it should not move read-only assets
* upload doesn't need the read-only flag available, just importing
* default isReadOnly on import endpoint to true
* formatting fixes
* create-asset dto needs isReadOnly, so set it to false by default on create, updated api generation
* updated code to reflect changes in MR
* fixed read stream promise return type
* new index for originalPath, check for existing path on import, reglardless of user, to prevent duplicates
* refactor: import asset
* chore: open api
* chore: tests
* Added externalPath support for individual users, updated UI to allow this to be set by admin
* added missing var for externalPath in ui
* chore: open api
* fix: compilation issues
* fix: server test
* built api, fixed user-response dto to include externalPath
* reverted accidental commit
* bad commit of duplicate externalPath in user response dto
* fixed tests to include externalPath on expected result
* fix: unit tests
* centralized supported filetypes, perform file type checking of asset and sidecar during file import process
* centralized supported filetype check method to keep regex DRY
* fixed typo
* combined migrations into one
* update api
* Removed externalPath from shared-link code, added column to admin user page whether external paths / import is enabled or not
* update mimetype
* Fixed detect correct mimetype
* revert asset-upload config
* reverted domain.constant
* refactor
* fix mime-type issue
* fix format
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-06-22 04:33:20 +02:00
|
|
|
/// * [bool] isReadOnly:
|
|
|
|
///
|
2023-02-12 07:54:07 +02:00
|
|
|
/// * [bool] isVisible:
|
|
|
|
///
|
2023-09-20 13:16:33 +02:00
|
|
|
/// * [String] libraryId:
|
|
|
|
///
|
2023-08-01 18:49:18 +02:00
|
|
|
/// * [MultipartFile] livePhotoData:
|
|
|
|
///
|
|
|
|
/// * [MultipartFile] sidecarData:
|
2023-11-06 16:04:39 +02:00
|
|
|
Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/upload';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2023-02-24 18:01:10 +02:00
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
const contentTypes = <String>['multipart/form-data'];
|
|
|
|
|
|
|
|
bool hasFields = false;
|
|
|
|
final mp = MultipartRequest('POST', Uri.parse(path));
|
|
|
|
if (assetData != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'assetData'] = assetData.field;
|
|
|
|
mp.files.add(assetData);
|
|
|
|
}
|
2023-02-12 07:54:07 +02:00
|
|
|
if (deviceAssetId != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
|
|
|
|
}
|
|
|
|
if (deviceId != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'deviceId'] = parameterToString(deviceId);
|
|
|
|
}
|
2023-08-01 18:49:18 +02:00
|
|
|
if (duration != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'duration'] = parameterToString(duration);
|
|
|
|
}
|
2023-02-19 18:44:53 +02:00
|
|
|
if (fileCreatedAt != null) {
|
2023-02-12 07:54:07 +02:00
|
|
|
hasFields = true;
|
2023-02-19 18:44:53 +02:00
|
|
|
mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
|
2023-02-12 07:54:07 +02:00
|
|
|
}
|
2023-02-19 18:44:53 +02:00
|
|
|
if (fileModifiedAt != null) {
|
2023-02-12 07:54:07 +02:00
|
|
|
hasFields = true;
|
2023-02-19 18:44:53 +02:00
|
|
|
mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
|
2023-02-12 07:54:07 +02:00
|
|
|
}
|
2023-08-01 18:49:18 +02:00
|
|
|
if (isArchived != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isArchived'] = parameterToString(isArchived);
|
|
|
|
}
|
2023-09-20 13:16:33 +02:00
|
|
|
if (isExternal != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isExternal'] = parameterToString(isExternal);
|
|
|
|
}
|
2023-02-12 07:54:07 +02:00
|
|
|
if (isFavorite != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isFavorite'] = parameterToString(isFavorite);
|
|
|
|
}
|
2023-09-20 13:16:33 +02:00
|
|
|
if (isOffline != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isOffline'] = parameterToString(isOffline);
|
|
|
|
}
|
2023-08-01 18:49:18 +02:00
|
|
|
if (isReadOnly != null) {
|
2023-04-12 17:37:52 +02:00
|
|
|
hasFields = true;
|
2023-08-01 18:49:18 +02:00
|
|
|
mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
|
2023-04-12 17:37:52 +02:00
|
|
|
}
|
2023-02-12 07:54:07 +02:00
|
|
|
if (isVisible != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isVisible'] = parameterToString(isVisible);
|
|
|
|
}
|
2023-09-20 13:16:33 +02:00
|
|
|
if (libraryId != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'libraryId'] = parameterToString(libraryId);
|
|
|
|
}
|
2023-08-01 18:49:18 +02:00
|
|
|
if (livePhotoData != null) {
|
2023-02-12 07:54:07 +02:00
|
|
|
hasFields = true;
|
2023-08-01 18:49:18 +02:00
|
|
|
mp.fields[r'livePhotoData'] = livePhotoData.field;
|
|
|
|
mp.files.add(livePhotoData);
|
|
|
|
}
|
|
|
|
if (sidecarData != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'sidecarData'] = sidecarData.field;
|
|
|
|
mp.files.add(sidecarData);
|
2023-02-12 07:54:07 +02:00
|
|
|
}
|
2022-07-13 14:23:48 +02:00
|
|
|
if (hasFields) {
|
|
|
|
postBody = mp;
|
|
|
|
}
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [MultipartFile] assetData (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
|
|
|
/// * [String] deviceAssetId (required):
|
|
|
|
///
|
|
|
|
/// * [String] deviceId (required):
|
|
|
|
///
|
2023-05-29 16:05:14 +02:00
|
|
|
/// * [DateTime] fileCreatedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-05-29 16:05:14 +02:00
|
|
|
/// * [DateTime] fileModifiedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-02-24 18:01:10 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
2023-08-01 18:49:18 +02:00
|
|
|
/// * [String] duration:
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-08-01 18:49:18 +02:00
|
|
|
/// * [bool] isArchived:
|
feat(server): xmp sidecar metadata (#2466)
* initial commit for XMP sidecar support
* Added support for 'missing' metadata files to include those without sidecar files, now detects sidecar files in the filesystem for media already ingested but the sidecar was created afterwards
* didn't mean to commit default log level during testing
* new sidecar logic for video metadata as well
* Added xml mimetype for sidecars only
* don't need capture group for this regex
* wrong default value reverted
* simplified the move here - keep it in the same try catch since the outcome is to move the media back anyway
* simplified setter logic
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
* simplified logic per suggestions
* sidecar is now its own queue with a discover and sync, updated UI for the new job queueing
* queue a sidecar job for every asset based on discovery or sync, though the logic is almost identical aside from linking the sidecar
* now queue sidecar jobs for each assset, though logic is mostly the same between discovery and sync
* simplified logic of filename extraction and asset instantiation
* not sure how that got deleted..
* updated code per suggestions and comments in the PR
* stat was not being used, removed the variable set
* better type checking, using in-scope variables for exif getter instead of passing in every time
* removed commented out test
* ran and resolved all lints, formats, checks, and tests
* resolved suggested change in PR
* made getExifProperty more dynamic with multiple possible args for fallbacks, fixed typo, used generic in function for better type checking
* better error handling and moving files back to positions on move or save failure
* regenerated api
* format fixes
* Added XMP documentation
* documentation typo
* Merged in main
* missed merge conflict
* more changes due to a merge
* Resolving conflicts
* added icon for sidecar jobs
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-05-25 03:59:30 +02:00
|
|
|
///
|
2023-09-20 13:16:33 +02:00
|
|
|
/// * [bool] isExternal:
|
|
|
|
///
|
2023-11-06 16:04:39 +02:00
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
2023-09-20 13:16:33 +02:00
|
|
|
/// * [bool] isOffline:
|
|
|
|
///
|
feat(server): support for read-only assets and importing existing items in the filesystem (#2715)
* Added read-only flag for assets, endpoint to trigger file import vs upload
* updated fixtures with new property
* if upload is 'read-only', ensure there is no existing asset at the designated originalPath
* added test for file import as well as detecting existing image at read-only destination location
* Added storage service test for a case where it should not move read-only assets
* upload doesn't need the read-only flag available, just importing
* default isReadOnly on import endpoint to true
* formatting fixes
* create-asset dto needs isReadOnly, so set it to false by default on create, updated api generation
* updated code to reflect changes in MR
* fixed read stream promise return type
* new index for originalPath, check for existing path on import, reglardless of user, to prevent duplicates
* refactor: import asset
* chore: open api
* chore: tests
* Added externalPath support for individual users, updated UI to allow this to be set by admin
* added missing var for externalPath in ui
* chore: open api
* fix: compilation issues
* fix: server test
* built api, fixed user-response dto to include externalPath
* reverted accidental commit
* bad commit of duplicate externalPath in user response dto
* fixed tests to include externalPath on expected result
* fix: unit tests
* centralized supported filetypes, perform file type checking of asset and sidecar during file import process
* centralized supported filetype check method to keep regex DRY
* fixed typo
* combined migrations into one
* update api
* Removed externalPath from shared-link code, added column to admin user page whether external paths / import is enabled or not
* update mimetype
* Fixed detect correct mimetype
* revert asset-upload config
* reverted domain.constant
* refactor
* fix mime-type issue
* fix format
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-06-22 04:33:20 +02:00
|
|
|
/// * [bool] isReadOnly:
|
|
|
|
///
|
2023-02-12 07:54:07 +02:00
|
|
|
/// * [bool] isVisible:
|
|
|
|
///
|
2023-09-20 13:16:33 +02:00
|
|
|
/// * [String] libraryId:
|
|
|
|
///
|
2023-08-01 18:49:18 +02:00
|
|
|
/// * [MultipartFile] livePhotoData:
|
|
|
|
///
|
|
|
|
/// * [MultipartFile] sidecarData:
|
2023-11-06 16:04:39 +02:00
|
|
|
Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
|
|
|
|
final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isFavorite: isFavorite, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
|
2022-07-13 14:23:48 +02:00
|
|
|
if (response.statusCode >= HttpStatus.badRequest) {
|
|
|
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
|
|
|
}
|
|
|
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
|
|
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
|
|
|
// FormatException when trying to decode an empty string.
|
|
|
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|