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-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2023-02-15 23:21:22 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AddAssetsDto] addAssetsDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> addAssetsToSharedLinkWithHttpInfo(AddAssetsDto addAssetsDto, { String? key, }) async {
|
2023-02-15 23:21:22 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/shared-link/add';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = addAssetsDto;
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2023-02-15 23:21:22 +02:00
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'PATCH',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2023-02-15 23:21:22 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [AddAssetsDto] addAssetsDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<SharedLinkResponseDto?> addAssetsToSharedLink(AddAssetsDto addAssetsDto, { String? key, }) async {
|
|
|
|
final response = await addAssetsToSharedLinkWithHttpInfo(addAssetsDto, key: key, );
|
2023-02-15 23:21:22 +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), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Check duplicated asset before uploading - for Web upload used
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> checkDuplicateAssetWithHttpInfo(CheckDuplicateAssetDto checkDuplicateAssetDto, { String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/check';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = checkDuplicateAssetDto;
|
|
|
|
|
|
|
|
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>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Check duplicated asset before uploading - for Web upload used
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<CheckDuplicateAssetResponseDto?> checkDuplicateAsset(CheckDuplicateAssetDto checkDuplicateAssetDto, { String? key, }) async {
|
|
|
|
final response = await checkDuplicateAssetWithHttpInfo(checkDuplicateAssetDto, key: key, );
|
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), 'CheckDuplicateAssetResponseDto',) as CheckDuplicateAssetResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
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-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2023-01-15 07:49:47 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [CreateAssetsShareLinkDto] createAssetsShareLinkDto (required):
|
|
|
|
Future<Response> createAssetsSharedLinkWithHttpInfo(CreateAssetsShareLinkDto createAssetsShareLinkDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/shared-link';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = createAssetsShareLinkDto;
|
|
|
|
|
|
|
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2023-01-15 07:49:47 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [CreateAssetsShareLinkDto] createAssetsShareLinkDto (required):
|
|
|
|
Future<SharedLinkResponseDto?> createAssetsSharedLink(CreateAssetsShareLinkDto createAssetsShareLinkDto,) async {
|
|
|
|
final response = await createAssetsSharedLinkWithHttpInfo(createAssetsShareLinkDto,);
|
|
|
|
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), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [DeleteAssetDto] deleteAssetDto (required):
|
|
|
|
Future<Response> deleteAssetWithHttpInfo(DeleteAssetDto deleteAssetDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = deleteAssetDto;
|
|
|
|
|
|
|
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [DeleteAssetDto] deleteAssetDto (required):
|
|
|
|
Future<List<DeleteAssetResponseDto>?> deleteAsset(DeleteAssetDto deleteAssetDto,) async {
|
|
|
|
final response = await deleteAssetWithHttpInfo(deleteAssetDto,);
|
|
|
|
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<DeleteAssetResponseDto>') as List)
|
|
|
|
.cast<DeleteAssetResponseDto>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2022-11-16 08:11:16 +02:00
|
|
|
/// * [String] assetId (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> downloadFileWithHttpInfo(String assetId, { String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2022-11-16 08:11:16 +02:00
|
|
|
final path = r'/asset/download/{assetId}'
|
|
|
|
.replaceAll('{assetId}', assetId);
|
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-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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2022-11-16 08:11:16 +02:00
|
|
|
/// * [String] assetId (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<MultipartFile?> downloadFile(String assetId, { String? key, }) async {
|
|
|
|
final response = await downloadFileWithHttpInfo(assetId, key: key, );
|
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.
|
2022-11-15 17:51:56 +02:00
|
|
|
// 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-02-24 18:01:10 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
2022-11-15 17:51:56 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2023-01-09 22:16:08 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [DownloadFilesDto] downloadFilesDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> downloadFilesWithHttpInfo(DownloadFilesDto downloadFilesDto, { String? key, }) async {
|
2023-01-09 22:16:08 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/download-files';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = downloadFilesDto;
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2023-01-09 22:16:08 +02:00
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2023-01-09 22:16:08 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [DownloadFilesDto] downloadFilesDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<MultipartFile?> downloadFiles(DownloadFilesDto downloadFilesDto, { String? key, }) async {
|
|
|
|
final response = await downloadFilesWithHttpInfo(downloadFilesDto, key: key, );
|
2023-01-09 22:16:08 +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-02-24 18:01:10 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
2023-01-09 22:16:08 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-01-24 05:46:37 +02:00
|
|
|
/// Current this is not used in any UI element
|
2023-01-15 07:49:47 +02:00
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-11-15 17:51:56 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-04-06 19:50:55 +02:00
|
|
|
/// * [String] name:
|
|
|
|
///
|
2022-11-15 17:51:56 +02:00
|
|
|
/// * [num] skip:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
2023-04-06 19:50:55 +02:00
|
|
|
Future<Response> downloadLibraryWithHttpInfo({ String? name, num? skip, String? key, }) async {
|
2022-11-15 17:51:56 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/download-library';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
2023-04-06 19:50:55 +02:00
|
|
|
if (name != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'name', name));
|
|
|
|
}
|
2022-11-15 17:51:56 +02:00
|
|
|
if (skip != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'skip', skip));
|
|
|
|
}
|
2023-02-24 18:01:10 +02:00
|
|
|
if (key != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'key', key));
|
|
|
|
}
|
2022-11-15 17:51:56 +02:00
|
|
|
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-01-24 05:46:37 +02:00
|
|
|
/// Current this is not used in any UI element
|
2023-01-15 07:49:47 +02:00
|
|
|
///
|
2022-11-15 17:51:56 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-04-06 19:50:55 +02:00
|
|
|
/// * [String] name:
|
|
|
|
///
|
2022-11-15 17:51:56 +02:00
|
|
|
/// * [num] skip:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
2023-04-06 19:50:55 +02:00
|
|
|
Future<MultipartFile?> downloadLibrary({ String? name, num? skip, String? key, }) async {
|
|
|
|
final response = await downloadLibraryWithHttpInfo( name: name, skip: skip, key: key, );
|
2022-11-15 17:51:56 +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.
|
2022-07-13 14:23:48 +02:00
|
|
|
// 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-02-24 18:01:10 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get all AssetEntity belong to the user
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
2022-11-26 18:16:02 +02:00
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-01-24 06:16:20 +02:00
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
|
|
|
/// * [num] skip:
|
|
|
|
///
|
2022-11-26 18:16:02 +02:00
|
|
|
/// * [String] ifNoneMatch:
|
|
|
|
/// ETag of data already cached on the client
|
2023-01-24 06:16:20 +02:00
|
|
|
Future<Response> getAllAssetsWithHttpInfo({ bool? isFavorite, num? skip, String? ifNoneMatch, }) 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>{};
|
|
|
|
|
2023-01-24 06:16:20 +02:00
|
|
|
if (isFavorite != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
|
|
|
}
|
|
|
|
if (skip != null) {
|
|
|
|
queryParams.addAll(_queryParams('', 'skip', skip));
|
|
|
|
}
|
|
|
|
|
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:
|
|
|
|
///
|
2023-01-24 06:16:20 +02:00
|
|
|
/// * [bool] isFavorite:
|
|
|
|
///
|
|
|
|
/// * [num] skip:
|
|
|
|
///
|
2022-11-26 18:16:02 +02:00
|
|
|
/// * [String] ifNoneMatch:
|
|
|
|
/// ETag of data already cached on the client
|
2023-01-24 06:16:20 +02:00
|
|
|
Future<List<AssetResponseDto>?> getAllAssets({ bool? isFavorite, num? skip, String? ifNoneMatch, }) async {
|
|
|
|
final response = await getAllAssetsWithHttpInfo( isFavorite: isFavorite, skip: skip, ifNoneMatch: ifNoneMatch, );
|
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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get a single asset's information
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] assetId (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> getAssetByIdWithHttpInfo(String assetId, { String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/assetById/{assetId}'
|
|
|
|
.replaceAll('{assetId}', assetId);
|
|
|
|
|
|
|
|
// 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>[];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'GET',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get a single asset's information
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] assetId (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<AssetResponseDto?> getAssetById(String assetId, { String? key, }) async {
|
|
|
|
final response = await getAssetByIdWithHttpInfo(assetId, key: key, );
|
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), 'AssetResponseDto',) as AssetResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-08-27 07:53:37 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2022-09-04 15:34:39 +02:00
|
|
|
/// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
|
|
|
|
Future<Response> getAssetByTimeBucketWithHttpInfo(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
|
2022-08-27 07:53:37 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2022-09-04 15:34:39 +02:00
|
|
|
final path = r'/asset/time-bucket';
|
2022-08-27 07:53:37 +02:00
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
2022-09-04 15:34:39 +02:00
|
|
|
Object? postBody = getAssetByTimeBucketDto;
|
2022-08-27 07:53:37 +02:00
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
2022-09-04 15:34:39 +02:00
|
|
|
'POST',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-09-04 15:34:39 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
|
|
|
|
Future<List<AssetResponseDto>?> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
|
|
|
|
final response = await getAssetByTimeBucketWithHttpInfo(getAssetByTimeBucketDto,);
|
|
|
|
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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-09-04 15:34:39 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
|
|
|
|
Future<Response> getAssetCountByTimeBucketWithHttpInfo(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/count-by-time-bucket';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = getAssetCountByTimeBucketDto;
|
|
|
|
|
|
|
|
final queryParams = <QueryParam>[];
|
|
|
|
final headerParams = <String, String>{};
|
|
|
|
final formParams = <String, String>{};
|
|
|
|
|
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'POST',
|
2022-08-27 07:53:37 +02:00
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-08-27 07:53:37 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2022-09-04 15:34:39 +02:00
|
|
|
/// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
|
|
|
|
Future<AssetCountByTimeBucketResponseDto?> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
|
|
|
|
final response = await getAssetCountByTimeBucketWithHttpInfo(getAssetCountByTimeBucketDto,);
|
2022-08-27 07:53:37 +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) {
|
2022-09-04 15:34:39 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByTimeBucketResponseDto',) as AssetCountByTimeBucketResponseDto;
|
2022-08-27 07:53:37 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
2022-09-07 22:16:18 +02:00
|
|
|
Future<Response> getAssetCountByUserIdWithHttpInfo() async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/count-by-user-id';
|
|
|
|
|
|
|
|
// 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-04-09 05:18:22 +02:00
|
|
|
///
|
2022-09-07 22:16:18 +02:00
|
|
|
Future<AssetCountByUserIdResponseDto?> getAssetCountByUserId() async {
|
|
|
|
final response = await getAssetCountByUserIdWithHttpInfo();
|
|
|
|
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), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
2022-07-13 14:23:48 +02:00
|
|
|
Future<Response> getAssetSearchTermsWithHttpInfo() async {
|
|
|
|
// ignore: prefer_const_declarations
|
2022-08-27 07:53:37 +02:00
|
|
|
final path = r'/asset/search-terms';
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
Future<List<String>?> getAssetSearchTerms() async {
|
|
|
|
final response = await getAssetSearchTermsWithHttpInfo();
|
|
|
|
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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] assetId (required):
|
2022-07-16 06:18:17 +02:00
|
|
|
///
|
|
|
|
/// * [ThumbnailFormat] format:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> getAssetThumbnailWithHttpInfo(String assetId, { ThumbnailFormat? format, String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/thumbnail/{assetId}'
|
|
|
|
.replaceAll('{assetId}', assetId);
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] assetId (required):
|
2022-07-16 06:18:17 +02:00
|
|
|
///
|
|
|
|
/// * [ThumbnailFormat] format:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<MultipartFile?> getAssetThumbnail(String assetId, { ThumbnailFormat? format, String? key, }) async {
|
|
|
|
final response = await getAssetThumbnailWithHttpInfo(assetId, format: format, key: key, );
|
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-02-24 18:01:10 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 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> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/{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>?> getUserAssetsByDeviceId(String deviceId,) async {
|
|
|
|
final response = await getUserAssetsByDeviceIdWithHttpInfo(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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2023-02-15 23:21:22 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [RemoveAssetsDto] removeAssetsDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> removeAssetsFromSharedLinkWithHttpInfo(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
|
2023-02-15 23:21:22 +02:00
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/shared-link/remove';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = removeAssetsDto;
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2023-02-15 23:21:22 +02:00
|
|
|
const contentTypes = <String>['application/json'];
|
|
|
|
|
|
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
|
|
path,
|
|
|
|
'PATCH',
|
|
|
|
queryParams,
|
|
|
|
postBody,
|
|
|
|
headerParams,
|
|
|
|
formParams,
|
|
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2023-02-15 23:21:22 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [RemoveAssetsDto] removeAssetsDto (required):
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<SharedLinkResponseDto?> removeAssetsFromSharedLink(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
|
|
|
|
final response = await removeAssetsFromSharedLinkWithHttpInfo(removeAssetsDto, key: key, );
|
2023-02-15 23:21:22 +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), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [SearchAssetDto] searchAssetDto (required):
|
|
|
|
Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
|
|
|
|
// ignore: prefer_const_declarations
|
|
|
|
final path = r'/asset/search';
|
|
|
|
|
|
|
|
// ignore: prefer_final_locals
|
|
|
|
Object? postBody = searchAssetDto;
|
|
|
|
|
|
|
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [SearchAssetDto] searchAssetDto (required):
|
|
|
|
Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
|
|
|
|
final response = await searchAssetWithHttpInfo(searchAssetDto,);
|
|
|
|
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>()
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2022-11-16 08:11:16 +02:00
|
|
|
/// * [String] assetId (required):
|
2022-07-13 14:23:48 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isThumb:
|
|
|
|
///
|
|
|
|
/// * [bool] isWeb:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<Response> serveFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, String? key, }) async {
|
2022-07-13 14:23:48 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2022-11-16 08:11:16 +02:00
|
|
|
final path = r'/asset/file/{assetId}'
|
|
|
|
.replaceAll('{assetId}', assetId);
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2022-11-16 08:11:16 +02:00
|
|
|
/// * [String] assetId (required):
|
2022-07-13 14:23:48 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isThumb:
|
|
|
|
///
|
|
|
|
/// * [bool] isWeb:
|
2023-02-24 18:01:10 +02:00
|
|
|
///
|
|
|
|
/// * [String] key:
|
|
|
|
Future<MultipartFile?> serveFile(String assetId, { bool? isThumb, bool? isWeb, String? key, }) async {
|
|
|
|
final response = await serveFileWithHttpInfo(assetId, 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));
|
|
|
|
}
|
|
|
|
// 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-02-24 18:01:10 +02:00
|
|
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
|
2022-07-13 14:23:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-11-08 18:20:36 +02:00
|
|
|
/// Update an asset
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] assetId (required):
|
|
|
|
///
|
|
|
|
/// * [UpdateAssetDto] updateAssetDto (required):
|
2022-12-05 19:56:44 +02:00
|
|
|
Future<Response> updateAssetWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
|
2022-11-08 18:20:36 +02:00
|
|
|
// ignore: prefer_const_declarations
|
2022-12-05 19:56:44 +02:00
|
|
|
final path = r'/asset/{assetId}'
|
2022-11-08 18:20:36 +02:00
|
|
|
.replaceAll('{assetId}', assetId);
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Update an asset
|
|
|
|
///
|
|
|
|
/// Parameters:
|
|
|
|
///
|
|
|
|
/// * [String] assetId (required):
|
|
|
|
///
|
|
|
|
/// * [UpdateAssetDto] updateAssetDto (required):
|
2022-12-05 19:56:44 +02:00
|
|
|
Future<AssetResponseDto?> updateAsset(String assetId, UpdateAssetDto updateAssetDto,) async {
|
|
|
|
final response = await updateAssetWithHttpInfo(assetId, 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-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: This method returns the HTTP [Response].
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-02-12 07:54:07 +02:00
|
|
|
/// * [AssetTypeEnum] assetType (required):
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// * [MultipartFile] assetData (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
|
|
|
/// * [String] deviceAssetId (required):
|
|
|
|
///
|
|
|
|
/// * [String] deviceId (required):
|
|
|
|
///
|
2023-02-19 18:44:53 +02:00
|
|
|
/// * [String] fileCreatedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-02-19 18:44:53 +02:00
|
|
|
/// * [String] fileModifiedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isFavorite (required):
|
|
|
|
///
|
|
|
|
/// * [String] fileExtension (required):
|
|
|
|
///
|
2023-02-24 18:01:10 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
2023-02-12 07:54:07 +02:00
|
|
|
/// * [MultipartFile] livePhotoData:
|
|
|
|
///
|
|
|
|
/// * [bool] isVisible:
|
|
|
|
///
|
|
|
|
/// * [String] duration:
|
2023-02-24 18:01:10 +02:00
|
|
|
Future<Response> uploadFileWithHttpInfo(AssetTypeEnum assetType, MultipartFile assetData, String deviceAssetId, String deviceId, String fileCreatedAt, String fileModifiedAt, bool isFavorite, String fileExtension, { String? key, MultipartFile? livePhotoData, bool? isVisible, String? duration, }) 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));
|
2023-02-12 07:54:07 +02:00
|
|
|
if (assetType != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'assetType'] = parameterToString(assetType);
|
|
|
|
}
|
2022-07-13 14:23:48 +02:00
|
|
|
if (assetData != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'assetData'] = assetData.field;
|
|
|
|
mp.files.add(assetData);
|
|
|
|
}
|
2023-02-12 07:54:07 +02:00
|
|
|
if (livePhotoData != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'livePhotoData'] = livePhotoData.field;
|
|
|
|
mp.files.add(livePhotoData);
|
|
|
|
}
|
|
|
|
if (deviceAssetId != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
|
|
|
|
}
|
|
|
|
if (deviceId != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'deviceId'] = parameterToString(deviceId);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
if (isFavorite != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isFavorite'] = parameterToString(isFavorite);
|
|
|
|
}
|
|
|
|
if (isVisible != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'isVisible'] = parameterToString(isVisible);
|
|
|
|
}
|
|
|
|
if (fileExtension != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'fileExtension'] = parameterToString(fileExtension);
|
|
|
|
}
|
|
|
|
if (duration != null) {
|
|
|
|
hasFields = true;
|
|
|
|
mp.fields[r'duration'] = parameterToString(duration);
|
|
|
|
}
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-04-09 05:18:22 +02:00
|
|
|
///
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// Parameters:
|
|
|
|
///
|
2023-02-12 07:54:07 +02:00
|
|
|
/// * [AssetTypeEnum] assetType (required):
|
|
|
|
///
|
2022-07-13 14:23:48 +02:00
|
|
|
/// * [MultipartFile] assetData (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
|
|
|
/// * [String] deviceAssetId (required):
|
|
|
|
///
|
|
|
|
/// * [String] deviceId (required):
|
|
|
|
///
|
2023-02-19 18:44:53 +02:00
|
|
|
/// * [String] fileCreatedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
2023-02-19 18:44:53 +02:00
|
|
|
/// * [String] fileModifiedAt (required):
|
2023-02-12 07:54:07 +02:00
|
|
|
///
|
|
|
|
/// * [bool] isFavorite (required):
|
|
|
|
///
|
|
|
|
/// * [String] fileExtension (required):
|
|
|
|
///
|
2023-02-24 18:01:10 +02:00
|
|
|
/// * [String] key:
|
|
|
|
///
|
2023-02-12 07:54:07 +02:00
|
|
|
/// * [MultipartFile] livePhotoData:
|
|
|
|
///
|
|
|
|
/// * [bool] isVisible:
|
|
|
|
///
|
|
|
|
/// * [String] duration:
|
2023-02-24 18:01:10 +02:00
|
|
|
Future<AssetFileUploadResponseDto?> uploadFile(AssetTypeEnum assetType, MultipartFile assetData, String deviceAssetId, String deviceId, String fileCreatedAt, String fileModifiedAt, bool isFavorite, String fileExtension, { String? key, MultipartFile? livePhotoData, bool? isVisible, String? duration, }) async {
|
|
|
|
final response = await uploadFileWithHttpInfo(assetType, assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, fileExtension, key: key, livePhotoData: livePhotoData, isVisible: isVisible, duration: duration, );
|
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;
|
|
|
|
}
|
|
|
|
}
|