123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723 |
- //
- // 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;
- ///
- ///
- /// Check duplicated asset before uploading - for Web upload used
- ///
- /// Note: This method returns the HTTP [Response].
- ///
- /// Parameters:
- ///
- /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
- Future<Response> checkDuplicateAssetWithHttpInfo(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
- // 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>{};
- 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):
- Future<CheckDuplicateAssetResponseDto?> checkDuplicateAsset(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
- final response = await checkDuplicateAssetWithHttpInfo(checkDuplicateAssetDto,);
- 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;
- }
- /// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
- /// 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,
- );
- }
- /// 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;
- }
- /// Performs an HTTP 'GET /asset/download' operation and returns the [Response].
- /// Parameters:
- ///
- /// * [String] aid (required):
- ///
- /// * [String] did (required):
- ///
- /// * [bool] isThumb:
- ///
- /// * [bool] isWeb:
- Future<Response> downloadFileWithHttpInfo(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
- // ignore: prefer_const_declarations
- final path = r'/asset/download';
- // ignore: prefer_final_locals
- Object? postBody;
- final queryParams = <QueryParam>[];
- final headerParams = <String, String>{};
- final formParams = <String, String>{};
- queryParams.addAll(_queryParams('', 'aid', aid));
- queryParams.addAll(_queryParams('', 'did', did));
- if (isThumb != null) {
- queryParams.addAll(_queryParams('', 'isThumb', isThumb));
- }
- if (isWeb != null) {
- queryParams.addAll(_queryParams('', 'isWeb', isWeb));
- }
- const contentTypes = <String>[];
- return apiClient.invokeAPI(
- path,
- 'GET',
- queryParams,
- postBody,
- headerParams,
- formParams,
- contentTypes.isEmpty ? null : contentTypes.first,
- );
- }
- /// Parameters:
- ///
- /// * [String] aid (required):
- ///
- /// * [String] did (required):
- ///
- /// * [bool] isThumb:
- ///
- /// * [bool] isWeb:
- Future<Object?> downloadFile(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
- final response = await downloadFileWithHttpInfo(aid, did, isThumb: isThumb, isWeb: isWeb, );
- 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), 'Object',) as Object;
-
- }
- return null;
- }
- ///
- ///
- /// Get all AssetEntity belong to the user
- ///
- /// Note: This method returns the HTTP [Response].
- Future<Response> getAllAssetsWithHttpInfo() async {
- // 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>{};
- const contentTypes = <String>[];
- return apiClient.invokeAPI(
- path,
- 'GET',
- queryParams,
- postBody,
- headerParams,
- formParams,
- contentTypes.isEmpty ? null : contentTypes.first,
- );
- }
- ///
- ///
- /// Get all AssetEntity belong to the user
- Future<List<AssetResponseDto>?> getAllAssets() async {
- final response = await getAllAssetsWithHttpInfo();
- 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):
- Future<Response> getAssetByIdWithHttpInfo(String assetId,) async {
- // 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>{};
- 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):
- Future<AssetResponseDto?> getAssetById(String assetId,) async {
- final response = await getAssetByIdWithHttpInfo(assetId,);
- 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;
- }
- /// Performs an HTTP 'GET /asset/searchTerm' operation and returns the [Response].
- Future<Response> getAssetSearchTermsWithHttpInfo() async {
- // ignore: prefer_const_declarations
- final path = r'/asset/searchTerm';
- // 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<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;
- }
- /// Performs an HTTP 'GET /asset/thumbnail/{assetId}' operation and returns the [Response].
- /// Parameters:
- ///
- /// * [String] assetId (required):
- ///
- /// * [ThumbnailFormat] format:
- Future<Response> getAssetThumbnailWithHttpInfo(String assetId, { ThumbnailFormat? format, }) async {
- // 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>{};
- if (format != null) {
- queryParams.addAll(_queryParams('', 'format', format));
- }
- const contentTypes = <String>[];
- return apiClient.invokeAPI(
- path,
- 'GET',
- queryParams,
- postBody,
- headerParams,
- formParams,
- contentTypes.isEmpty ? null : contentTypes.first,
- );
- }
- /// Parameters:
- ///
- /// * [String] assetId (required):
- ///
- /// * [ThumbnailFormat] format:
- Future<Object?> getAssetThumbnail(String assetId, { ThumbnailFormat? format, }) async {
- final response = await getAssetThumbnailWithHttpInfo(assetId, format: format, );
- 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), 'Object',) as Object;
-
- }
- return null;
- }
- /// Performs an HTTP 'GET /asset/allLocation' operation and returns the [Response].
- Future<Response> getCuratedLocationsWithHttpInfo() async {
- // ignore: prefer_const_declarations
- final path = r'/asset/allLocation';
- // 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>()
- .toList();
- }
- return null;
- }
- /// Performs an HTTP 'GET /asset/allObjects' operation and returns the [Response].
- Future<Response> getCuratedObjectsWithHttpInfo() async {
- // ignore: prefer_const_declarations
- final path = r'/asset/allObjects';
- // 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>()
- .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;
- }
- /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
- /// 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,
- );
- }
- /// 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;
- }
- /// Performs an HTTP 'GET /asset/file' operation and returns the [Response].
- /// Parameters:
- ///
- /// * [String] aid (required):
- ///
- /// * [String] did (required):
- ///
- /// * [bool] isThumb:
- ///
- /// * [bool] isWeb:
- Future<Response> serveFileWithHttpInfo(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
- // ignore: prefer_const_declarations
- final path = r'/asset/file';
- // ignore: prefer_final_locals
- Object? postBody;
- final queryParams = <QueryParam>[];
- final headerParams = <String, String>{};
- final formParams = <String, String>{};
- queryParams.addAll(_queryParams('', 'aid', aid));
- queryParams.addAll(_queryParams('', 'did', did));
- if (isThumb != null) {
- queryParams.addAll(_queryParams('', 'isThumb', isThumb));
- }
- if (isWeb != null) {
- queryParams.addAll(_queryParams('', 'isWeb', isWeb));
- }
- const contentTypes = <String>[];
- return apiClient.invokeAPI(
- path,
- 'GET',
- queryParams,
- postBody,
- headerParams,
- formParams,
- contentTypes.isEmpty ? null : contentTypes.first,
- );
- }
- /// Parameters:
- ///
- /// * [String] aid (required):
- ///
- /// * [String] did (required):
- ///
- /// * [bool] isThumb:
- ///
- /// * [bool] isWeb:
- Future<Object?> serveFile(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
- final response = await serveFileWithHttpInfo(aid, did, isThumb: isThumb, isWeb: isWeb, );
- 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), 'Object',) as Object;
-
- }
- return null;
- }
- /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
- /// Parameters:
- ///
- /// * [MultipartFile] assetData (required):
- Future<Response> uploadFileWithHttpInfo(MultipartFile assetData,) async {
- // 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>{};
- 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);
- }
- if (hasFields) {
- postBody = mp;
- }
- return apiClient.invokeAPI(
- path,
- 'POST',
- queryParams,
- postBody,
- headerParams,
- formParams,
- contentTypes.isEmpty ? null : contentTypes.first,
- );
- }
- /// Parameters:
- ///
- /// * [MultipartFile] assetData (required):
- Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData,) async {
- final response = await uploadFileWithHttpInfo(assetData,);
- 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;
- }
- }
|