asset_api.dart 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538
  1. //
  2. // AUTO-GENERATED FILE, DO NOT MODIFY!
  3. //
  4. // @dart=2.12
  5. // ignore_for_file: unused_element, unused_import
  6. // ignore_for_file: always_put_required_named_parameters_first
  7. // ignore_for_file: constant_identifier_names
  8. // ignore_for_file: lines_longer_than_80_chars
  9. part of openapi.api;
  10. class AssetApi {
  11. AssetApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'PATCH /asset/shared-link/add' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [AddAssetsDto] addAssetsDto (required):
  17. ///
  18. /// * [String] key:
  19. Future<Response> addAssetsToSharedLinkWithHttpInfo(AddAssetsDto addAssetsDto, { String? key, }) async {
  20. // ignore: prefer_const_declarations
  21. final path = r'/asset/shared-link/add';
  22. // ignore: prefer_final_locals
  23. Object? postBody = addAssetsDto;
  24. final queryParams = <QueryParam>[];
  25. final headerParams = <String, String>{};
  26. final formParams = <String, String>{};
  27. if (key != null) {
  28. queryParams.addAll(_queryParams('', 'key', key));
  29. }
  30. const contentTypes = <String>['application/json'];
  31. return apiClient.invokeAPI(
  32. path,
  33. 'PATCH',
  34. queryParams,
  35. postBody,
  36. headerParams,
  37. formParams,
  38. contentTypes.isEmpty ? null : contentTypes.first,
  39. );
  40. }
  41. /// Parameters:
  42. ///
  43. /// * [AddAssetsDto] addAssetsDto (required):
  44. ///
  45. /// * [String] key:
  46. Future<SharedLinkResponseDto?> addAssetsToSharedLink(AddAssetsDto addAssetsDto, { String? key, }) async {
  47. final response = await addAssetsToSharedLinkWithHttpInfo(addAssetsDto, key: key, );
  48. if (response.statusCode >= HttpStatus.badRequest) {
  49. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  50. }
  51. // When a remote server returns no body with a status of 204, we shall not decode it.
  52. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  53. // FormatException when trying to decode an empty string.
  54. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  55. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  56. }
  57. return null;
  58. }
  59. /// Checks if assets exist by checksums
  60. ///
  61. /// Note: This method returns the HTTP [Response].
  62. ///
  63. /// Parameters:
  64. ///
  65. /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
  66. Future<Response> bulkUploadCheckWithHttpInfo(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
  67. // ignore: prefer_const_declarations
  68. final path = r'/asset/bulk-upload-check';
  69. // ignore: prefer_final_locals
  70. Object? postBody = assetBulkUploadCheckDto;
  71. final queryParams = <QueryParam>[];
  72. final headerParams = <String, String>{};
  73. final formParams = <String, String>{};
  74. const contentTypes = <String>['application/json'];
  75. return apiClient.invokeAPI(
  76. path,
  77. 'POST',
  78. queryParams,
  79. postBody,
  80. headerParams,
  81. formParams,
  82. contentTypes.isEmpty ? null : contentTypes.first,
  83. );
  84. }
  85. /// Checks if assets exist by checksums
  86. ///
  87. /// Parameters:
  88. ///
  89. /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
  90. Future<AssetBulkUploadCheckResponseDto?> bulkUploadCheck(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
  91. final response = await bulkUploadCheckWithHttpInfo(assetBulkUploadCheckDto,);
  92. if (response.statusCode >= HttpStatus.badRequest) {
  93. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  94. }
  95. // When a remote server returns no body with a status of 204, we shall not decode it.
  96. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  97. // FormatException when trying to decode an empty string.
  98. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  99. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetBulkUploadCheckResponseDto',) as AssetBulkUploadCheckResponseDto;
  100. }
  101. return null;
  102. }
  103. /// Check duplicated asset before uploading - for Web upload used
  104. ///
  105. /// Note: This method returns the HTTP [Response].
  106. ///
  107. /// Parameters:
  108. ///
  109. /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
  110. ///
  111. /// * [String] key:
  112. Future<Response> checkDuplicateAssetWithHttpInfo(CheckDuplicateAssetDto checkDuplicateAssetDto, { String? key, }) async {
  113. // ignore: prefer_const_declarations
  114. final path = r'/asset/check';
  115. // ignore: prefer_final_locals
  116. Object? postBody = checkDuplicateAssetDto;
  117. final queryParams = <QueryParam>[];
  118. final headerParams = <String, String>{};
  119. final formParams = <String, String>{};
  120. if (key != null) {
  121. queryParams.addAll(_queryParams('', 'key', key));
  122. }
  123. const contentTypes = <String>['application/json'];
  124. return apiClient.invokeAPI(
  125. path,
  126. 'POST',
  127. queryParams,
  128. postBody,
  129. headerParams,
  130. formParams,
  131. contentTypes.isEmpty ? null : contentTypes.first,
  132. );
  133. }
  134. /// Check duplicated asset before uploading - for Web upload used
  135. ///
  136. /// Parameters:
  137. ///
  138. /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
  139. ///
  140. /// * [String] key:
  141. Future<CheckDuplicateAssetResponseDto?> checkDuplicateAsset(CheckDuplicateAssetDto checkDuplicateAssetDto, { String? key, }) async {
  142. final response = await checkDuplicateAssetWithHttpInfo(checkDuplicateAssetDto, key: key, );
  143. if (response.statusCode >= HttpStatus.badRequest) {
  144. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  145. }
  146. // When a remote server returns no body with a status of 204, we shall not decode it.
  147. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  148. // FormatException when trying to decode an empty string.
  149. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  150. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckDuplicateAssetResponseDto',) as CheckDuplicateAssetResponseDto;
  151. }
  152. return null;
  153. }
  154. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  155. ///
  156. /// Note: This method returns the HTTP [Response].
  157. ///
  158. /// Parameters:
  159. ///
  160. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  161. Future<Response> checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  162. // ignore: prefer_const_declarations
  163. final path = r'/asset/exist';
  164. // ignore: prefer_final_locals
  165. Object? postBody = checkExistingAssetsDto;
  166. final queryParams = <QueryParam>[];
  167. final headerParams = <String, String>{};
  168. final formParams = <String, String>{};
  169. const contentTypes = <String>['application/json'];
  170. return apiClient.invokeAPI(
  171. path,
  172. 'POST',
  173. queryParams,
  174. postBody,
  175. headerParams,
  176. formParams,
  177. contentTypes.isEmpty ? null : contentTypes.first,
  178. );
  179. }
  180. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  181. ///
  182. /// Parameters:
  183. ///
  184. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  185. Future<CheckExistingAssetsResponseDto?> checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  186. final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,);
  187. if (response.statusCode >= HttpStatus.badRequest) {
  188. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  189. }
  190. // When a remote server returns no body with a status of 204, we shall not decode it.
  191. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  192. // FormatException when trying to decode an empty string.
  193. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  194. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto;
  195. }
  196. return null;
  197. }
  198. /// Performs an HTTP 'POST /asset/shared-link' operation and returns the [Response].
  199. /// Parameters:
  200. ///
  201. /// * [CreateAssetsShareLinkDto] createAssetsShareLinkDto (required):
  202. Future<Response> createAssetsSharedLinkWithHttpInfo(CreateAssetsShareLinkDto createAssetsShareLinkDto,) async {
  203. // ignore: prefer_const_declarations
  204. final path = r'/asset/shared-link';
  205. // ignore: prefer_final_locals
  206. Object? postBody = createAssetsShareLinkDto;
  207. final queryParams = <QueryParam>[];
  208. final headerParams = <String, String>{};
  209. final formParams = <String, String>{};
  210. const contentTypes = <String>['application/json'];
  211. return apiClient.invokeAPI(
  212. path,
  213. 'POST',
  214. queryParams,
  215. postBody,
  216. headerParams,
  217. formParams,
  218. contentTypes.isEmpty ? null : contentTypes.first,
  219. );
  220. }
  221. /// Parameters:
  222. ///
  223. /// * [CreateAssetsShareLinkDto] createAssetsShareLinkDto (required):
  224. Future<SharedLinkResponseDto?> createAssetsSharedLink(CreateAssetsShareLinkDto createAssetsShareLinkDto,) async {
  225. final response = await createAssetsSharedLinkWithHttpInfo(createAssetsShareLinkDto,);
  226. if (response.statusCode >= HttpStatus.badRequest) {
  227. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  228. }
  229. // When a remote server returns no body with a status of 204, we shall not decode it.
  230. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  231. // FormatException when trying to decode an empty string.
  232. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  233. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  234. }
  235. return null;
  236. }
  237. /// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
  238. /// Parameters:
  239. ///
  240. /// * [DeleteAssetDto] deleteAssetDto (required):
  241. Future<Response> deleteAssetWithHttpInfo(DeleteAssetDto deleteAssetDto,) async {
  242. // ignore: prefer_const_declarations
  243. final path = r'/asset';
  244. // ignore: prefer_final_locals
  245. Object? postBody = deleteAssetDto;
  246. final queryParams = <QueryParam>[];
  247. final headerParams = <String, String>{};
  248. final formParams = <String, String>{};
  249. const contentTypes = <String>['application/json'];
  250. return apiClient.invokeAPI(
  251. path,
  252. 'DELETE',
  253. queryParams,
  254. postBody,
  255. headerParams,
  256. formParams,
  257. contentTypes.isEmpty ? null : contentTypes.first,
  258. );
  259. }
  260. /// Parameters:
  261. ///
  262. /// * [DeleteAssetDto] deleteAssetDto (required):
  263. Future<List<DeleteAssetResponseDto>?> deleteAsset(DeleteAssetDto deleteAssetDto,) async {
  264. final response = await deleteAssetWithHttpInfo(deleteAssetDto,);
  265. if (response.statusCode >= HttpStatus.badRequest) {
  266. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  267. }
  268. // When a remote server returns no body with a status of 204, we shall not decode it.
  269. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  270. // FormatException when trying to decode an empty string.
  271. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  272. final responseBody = await _decodeBodyBytes(response);
  273. return (await apiClient.deserializeAsync(responseBody, 'List<DeleteAssetResponseDto>') as List)
  274. .cast<DeleteAssetResponseDto>()
  275. .toList();
  276. }
  277. return null;
  278. }
  279. /// Performs an HTTP 'GET /asset/download/{assetId}' operation and returns the [Response].
  280. /// Parameters:
  281. ///
  282. /// * [String] assetId (required):
  283. ///
  284. /// * [String] key:
  285. Future<Response> downloadFileWithHttpInfo(String assetId, { String? key, }) async {
  286. // ignore: prefer_const_declarations
  287. final path = r'/asset/download/{assetId}'
  288. .replaceAll('{assetId}', assetId);
  289. // ignore: prefer_final_locals
  290. Object? postBody;
  291. final queryParams = <QueryParam>[];
  292. final headerParams = <String, String>{};
  293. final formParams = <String, String>{};
  294. if (key != null) {
  295. queryParams.addAll(_queryParams('', 'key', key));
  296. }
  297. const contentTypes = <String>[];
  298. return apiClient.invokeAPI(
  299. path,
  300. 'GET',
  301. queryParams,
  302. postBody,
  303. headerParams,
  304. formParams,
  305. contentTypes.isEmpty ? null : contentTypes.first,
  306. );
  307. }
  308. /// Parameters:
  309. ///
  310. /// * [String] assetId (required):
  311. ///
  312. /// * [String] key:
  313. Future<MultipartFile?> downloadFile(String assetId, { String? key, }) async {
  314. final response = await downloadFileWithHttpInfo(assetId, key: key, );
  315. if (response.statusCode >= HttpStatus.badRequest) {
  316. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  317. }
  318. // When a remote server returns no body with a status of 204, we shall not decode it.
  319. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  320. // FormatException when trying to decode an empty string.
  321. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  322. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  323. }
  324. return null;
  325. }
  326. /// Performs an HTTP 'POST /asset/download-files' operation and returns the [Response].
  327. /// Parameters:
  328. ///
  329. /// * [DownloadFilesDto] downloadFilesDto (required):
  330. ///
  331. /// * [String] key:
  332. Future<Response> downloadFilesWithHttpInfo(DownloadFilesDto downloadFilesDto, { String? key, }) async {
  333. // ignore: prefer_const_declarations
  334. final path = r'/asset/download-files';
  335. // ignore: prefer_final_locals
  336. Object? postBody = downloadFilesDto;
  337. final queryParams = <QueryParam>[];
  338. final headerParams = <String, String>{};
  339. final formParams = <String, String>{};
  340. if (key != null) {
  341. queryParams.addAll(_queryParams('', 'key', key));
  342. }
  343. const contentTypes = <String>['application/json'];
  344. return apiClient.invokeAPI(
  345. path,
  346. 'POST',
  347. queryParams,
  348. postBody,
  349. headerParams,
  350. formParams,
  351. contentTypes.isEmpty ? null : contentTypes.first,
  352. );
  353. }
  354. /// Parameters:
  355. ///
  356. /// * [DownloadFilesDto] downloadFilesDto (required):
  357. ///
  358. /// * [String] key:
  359. Future<MultipartFile?> downloadFiles(DownloadFilesDto downloadFilesDto, { String? key, }) async {
  360. final response = await downloadFilesWithHttpInfo(downloadFilesDto, key: key, );
  361. if (response.statusCode >= HttpStatus.badRequest) {
  362. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  363. }
  364. // When a remote server returns no body with a status of 204, we shall not decode it.
  365. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  366. // FormatException when trying to decode an empty string.
  367. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  368. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  369. }
  370. return null;
  371. }
  372. /// Current this is not used in any UI element
  373. ///
  374. /// Note: This method returns the HTTP [Response].
  375. ///
  376. /// Parameters:
  377. ///
  378. /// * [String] name:
  379. ///
  380. /// * [num] skip:
  381. ///
  382. /// * [String] key:
  383. Future<Response> downloadLibraryWithHttpInfo({ String? name, num? skip, String? key, }) async {
  384. // ignore: prefer_const_declarations
  385. final path = r'/asset/download-library';
  386. // ignore: prefer_final_locals
  387. Object? postBody;
  388. final queryParams = <QueryParam>[];
  389. final headerParams = <String, String>{};
  390. final formParams = <String, String>{};
  391. if (name != null) {
  392. queryParams.addAll(_queryParams('', 'name', name));
  393. }
  394. if (skip != null) {
  395. queryParams.addAll(_queryParams('', 'skip', skip));
  396. }
  397. if (key != null) {
  398. queryParams.addAll(_queryParams('', 'key', key));
  399. }
  400. const contentTypes = <String>[];
  401. return apiClient.invokeAPI(
  402. path,
  403. 'GET',
  404. queryParams,
  405. postBody,
  406. headerParams,
  407. formParams,
  408. contentTypes.isEmpty ? null : contentTypes.first,
  409. );
  410. }
  411. /// Current this is not used in any UI element
  412. ///
  413. /// Parameters:
  414. ///
  415. /// * [String] name:
  416. ///
  417. /// * [num] skip:
  418. ///
  419. /// * [String] key:
  420. Future<MultipartFile?> downloadLibrary({ String? name, num? skip, String? key, }) async {
  421. final response = await downloadLibraryWithHttpInfo( name: name, skip: skip, key: key, );
  422. if (response.statusCode >= HttpStatus.badRequest) {
  423. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  424. }
  425. // When a remote server returns no body with a status of 204, we shall not decode it.
  426. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  427. // FormatException when trying to decode an empty string.
  428. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  429. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  430. }
  431. return null;
  432. }
  433. /// Get all AssetEntity belong to the user
  434. ///
  435. /// Note: This method returns the HTTP [Response].
  436. ///
  437. /// Parameters:
  438. ///
  439. /// * [bool] isFavorite:
  440. ///
  441. /// * [bool] isArchived:
  442. ///
  443. /// * [num] skip:
  444. ///
  445. /// * [String] ifNoneMatch:
  446. /// ETag of data already cached on the client
  447. Future<Response> getAllAssetsWithHttpInfo({ bool? isFavorite, bool? isArchived, num? skip, String? ifNoneMatch, }) async {
  448. // ignore: prefer_const_declarations
  449. final path = r'/asset';
  450. // ignore: prefer_final_locals
  451. Object? postBody;
  452. final queryParams = <QueryParam>[];
  453. final headerParams = <String, String>{};
  454. final formParams = <String, String>{};
  455. if (isFavorite != null) {
  456. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  457. }
  458. if (isArchived != null) {
  459. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  460. }
  461. if (skip != null) {
  462. queryParams.addAll(_queryParams('', 'skip', skip));
  463. }
  464. if (ifNoneMatch != null) {
  465. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  466. }
  467. const contentTypes = <String>[];
  468. return apiClient.invokeAPI(
  469. path,
  470. 'GET',
  471. queryParams,
  472. postBody,
  473. headerParams,
  474. formParams,
  475. contentTypes.isEmpty ? null : contentTypes.first,
  476. );
  477. }
  478. /// Get all AssetEntity belong to the user
  479. ///
  480. /// Parameters:
  481. ///
  482. /// * [bool] isFavorite:
  483. ///
  484. /// * [bool] isArchived:
  485. ///
  486. /// * [num] skip:
  487. ///
  488. /// * [String] ifNoneMatch:
  489. /// ETag of data already cached on the client
  490. Future<List<AssetResponseDto>?> getAllAssets({ bool? isFavorite, bool? isArchived, num? skip, String? ifNoneMatch, }) async {
  491. final response = await getAllAssetsWithHttpInfo( isFavorite: isFavorite, isArchived: isArchived, skip: skip, ifNoneMatch: ifNoneMatch, );
  492. if (response.statusCode >= HttpStatus.badRequest) {
  493. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  494. }
  495. // When a remote server returns no body with a status of 204, we shall not decode it.
  496. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  497. // FormatException when trying to decode an empty string.
  498. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  499. final responseBody = await _decodeBodyBytes(response);
  500. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  501. .cast<AssetResponseDto>()
  502. .toList();
  503. }
  504. return null;
  505. }
  506. /// Performs an HTTP 'GET /asset/stat/archive' operation and returns the [Response].
  507. Future<Response> getArchivedAssetCountByUserIdWithHttpInfo() async {
  508. // ignore: prefer_const_declarations
  509. final path = r'/asset/stat/archive';
  510. // ignore: prefer_final_locals
  511. Object? postBody;
  512. final queryParams = <QueryParam>[];
  513. final headerParams = <String, String>{};
  514. final formParams = <String, String>{};
  515. const contentTypes = <String>[];
  516. return apiClient.invokeAPI(
  517. path,
  518. 'GET',
  519. queryParams,
  520. postBody,
  521. headerParams,
  522. formParams,
  523. contentTypes.isEmpty ? null : contentTypes.first,
  524. );
  525. }
  526. Future<AssetCountByUserIdResponseDto?> getArchivedAssetCountByUserId() async {
  527. final response = await getArchivedAssetCountByUserIdWithHttpInfo();
  528. if (response.statusCode >= HttpStatus.badRequest) {
  529. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  530. }
  531. // When a remote server returns no body with a status of 204, we shall not decode it.
  532. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  533. // FormatException when trying to decode an empty string.
  534. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  535. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  536. }
  537. return null;
  538. }
  539. /// Get a single asset's information
  540. ///
  541. /// Note: This method returns the HTTP [Response].
  542. ///
  543. /// Parameters:
  544. ///
  545. /// * [String] assetId (required):
  546. ///
  547. /// * [String] key:
  548. Future<Response> getAssetByIdWithHttpInfo(String assetId, { String? key, }) async {
  549. // ignore: prefer_const_declarations
  550. final path = r'/asset/assetById/{assetId}'
  551. .replaceAll('{assetId}', assetId);
  552. // ignore: prefer_final_locals
  553. Object? postBody;
  554. final queryParams = <QueryParam>[];
  555. final headerParams = <String, String>{};
  556. final formParams = <String, String>{};
  557. if (key != null) {
  558. queryParams.addAll(_queryParams('', 'key', key));
  559. }
  560. const contentTypes = <String>[];
  561. return apiClient.invokeAPI(
  562. path,
  563. 'GET',
  564. queryParams,
  565. postBody,
  566. headerParams,
  567. formParams,
  568. contentTypes.isEmpty ? null : contentTypes.first,
  569. );
  570. }
  571. /// Get a single asset's information
  572. ///
  573. /// Parameters:
  574. ///
  575. /// * [String] assetId (required):
  576. ///
  577. /// * [String] key:
  578. Future<AssetResponseDto?> getAssetById(String assetId, { String? key, }) async {
  579. final response = await getAssetByIdWithHttpInfo(assetId, key: key, );
  580. if (response.statusCode >= HttpStatus.badRequest) {
  581. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  582. }
  583. // When a remote server returns no body with a status of 204, we shall not decode it.
  584. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  585. // FormatException when trying to decode an empty string.
  586. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  587. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  588. }
  589. return null;
  590. }
  591. /// Performs an HTTP 'POST /asset/time-bucket' operation and returns the [Response].
  592. /// Parameters:
  593. ///
  594. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  595. Future<Response> getAssetByTimeBucketWithHttpInfo(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  596. // ignore: prefer_const_declarations
  597. final path = r'/asset/time-bucket';
  598. // ignore: prefer_final_locals
  599. Object? postBody = getAssetByTimeBucketDto;
  600. final queryParams = <QueryParam>[];
  601. final headerParams = <String, String>{};
  602. final formParams = <String, String>{};
  603. const contentTypes = <String>['application/json'];
  604. return apiClient.invokeAPI(
  605. path,
  606. 'POST',
  607. queryParams,
  608. postBody,
  609. headerParams,
  610. formParams,
  611. contentTypes.isEmpty ? null : contentTypes.first,
  612. );
  613. }
  614. /// Parameters:
  615. ///
  616. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  617. Future<List<AssetResponseDto>?> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  618. final response = await getAssetByTimeBucketWithHttpInfo(getAssetByTimeBucketDto,);
  619. if (response.statusCode >= HttpStatus.badRequest) {
  620. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  621. }
  622. // When a remote server returns no body with a status of 204, we shall not decode it.
  623. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  624. // FormatException when trying to decode an empty string.
  625. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  626. final responseBody = await _decodeBodyBytes(response);
  627. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  628. .cast<AssetResponseDto>()
  629. .toList();
  630. }
  631. return null;
  632. }
  633. /// Performs an HTTP 'POST /asset/count-by-time-bucket' operation and returns the [Response].
  634. /// Parameters:
  635. ///
  636. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  637. Future<Response> getAssetCountByTimeBucketWithHttpInfo(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  638. // ignore: prefer_const_declarations
  639. final path = r'/asset/count-by-time-bucket';
  640. // ignore: prefer_final_locals
  641. Object? postBody = getAssetCountByTimeBucketDto;
  642. final queryParams = <QueryParam>[];
  643. final headerParams = <String, String>{};
  644. final formParams = <String, String>{};
  645. const contentTypes = <String>['application/json'];
  646. return apiClient.invokeAPI(
  647. path,
  648. 'POST',
  649. queryParams,
  650. postBody,
  651. headerParams,
  652. formParams,
  653. contentTypes.isEmpty ? null : contentTypes.first,
  654. );
  655. }
  656. /// Parameters:
  657. ///
  658. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  659. Future<AssetCountByTimeBucketResponseDto?> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  660. final response = await getAssetCountByTimeBucketWithHttpInfo(getAssetCountByTimeBucketDto,);
  661. if (response.statusCode >= HttpStatus.badRequest) {
  662. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  663. }
  664. // When a remote server returns no body with a status of 204, we shall not decode it.
  665. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  666. // FormatException when trying to decode an empty string.
  667. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  668. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByTimeBucketResponseDto',) as AssetCountByTimeBucketResponseDto;
  669. }
  670. return null;
  671. }
  672. /// Performs an HTTP 'GET /asset/count-by-user-id' operation and returns the [Response].
  673. Future<Response> getAssetCountByUserIdWithHttpInfo() async {
  674. // ignore: prefer_const_declarations
  675. final path = r'/asset/count-by-user-id';
  676. // ignore: prefer_final_locals
  677. Object? postBody;
  678. final queryParams = <QueryParam>[];
  679. final headerParams = <String, String>{};
  680. final formParams = <String, String>{};
  681. const contentTypes = <String>[];
  682. return apiClient.invokeAPI(
  683. path,
  684. 'GET',
  685. queryParams,
  686. postBody,
  687. headerParams,
  688. formParams,
  689. contentTypes.isEmpty ? null : contentTypes.first,
  690. );
  691. }
  692. Future<AssetCountByUserIdResponseDto?> getAssetCountByUserId() async {
  693. final response = await getAssetCountByUserIdWithHttpInfo();
  694. if (response.statusCode >= HttpStatus.badRequest) {
  695. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  696. }
  697. // When a remote server returns no body with a status of 204, we shall not decode it.
  698. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  699. // FormatException when trying to decode an empty string.
  700. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  701. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  702. }
  703. return null;
  704. }
  705. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  706. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  707. // ignore: prefer_const_declarations
  708. final path = r'/asset/search-terms';
  709. // ignore: prefer_final_locals
  710. Object? postBody;
  711. final queryParams = <QueryParam>[];
  712. final headerParams = <String, String>{};
  713. final formParams = <String, String>{};
  714. const contentTypes = <String>[];
  715. return apiClient.invokeAPI(
  716. path,
  717. 'GET',
  718. queryParams,
  719. postBody,
  720. headerParams,
  721. formParams,
  722. contentTypes.isEmpty ? null : contentTypes.first,
  723. );
  724. }
  725. Future<List<String>?> getAssetSearchTerms() async {
  726. final response = await getAssetSearchTermsWithHttpInfo();
  727. if (response.statusCode >= HttpStatus.badRequest) {
  728. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  729. }
  730. // When a remote server returns no body with a status of 204, we shall not decode it.
  731. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  732. // FormatException when trying to decode an empty string.
  733. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  734. final responseBody = await _decodeBodyBytes(response);
  735. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  736. .cast<String>()
  737. .toList();
  738. }
  739. return null;
  740. }
  741. /// Performs an HTTP 'GET /asset/thumbnail/{assetId}' operation and returns the [Response].
  742. /// Parameters:
  743. ///
  744. /// * [String] assetId (required):
  745. ///
  746. /// * [ThumbnailFormat] format:
  747. ///
  748. /// * [String] key:
  749. Future<Response> getAssetThumbnailWithHttpInfo(String assetId, { ThumbnailFormat? format, String? key, }) async {
  750. // ignore: prefer_const_declarations
  751. final path = r'/asset/thumbnail/{assetId}'
  752. .replaceAll('{assetId}', assetId);
  753. // ignore: prefer_final_locals
  754. Object? postBody;
  755. final queryParams = <QueryParam>[];
  756. final headerParams = <String, String>{};
  757. final formParams = <String, String>{};
  758. if (format != null) {
  759. queryParams.addAll(_queryParams('', 'format', format));
  760. }
  761. if (key != null) {
  762. queryParams.addAll(_queryParams('', 'key', key));
  763. }
  764. const contentTypes = <String>[];
  765. return apiClient.invokeAPI(
  766. path,
  767. 'GET',
  768. queryParams,
  769. postBody,
  770. headerParams,
  771. formParams,
  772. contentTypes.isEmpty ? null : contentTypes.first,
  773. );
  774. }
  775. /// Parameters:
  776. ///
  777. /// * [String] assetId (required):
  778. ///
  779. /// * [ThumbnailFormat] format:
  780. ///
  781. /// * [String] key:
  782. Future<MultipartFile?> getAssetThumbnail(String assetId, { ThumbnailFormat? format, String? key, }) async {
  783. final response = await getAssetThumbnailWithHttpInfo(assetId, format: format, key: key, );
  784. if (response.statusCode >= HttpStatus.badRequest) {
  785. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  786. }
  787. // When a remote server returns no body with a status of 204, we shall not decode it.
  788. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  789. // FormatException when trying to decode an empty string.
  790. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  791. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  792. }
  793. return null;
  794. }
  795. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  796. Future<Response> getCuratedLocationsWithHttpInfo() async {
  797. // ignore: prefer_const_declarations
  798. final path = r'/asset/curated-locations';
  799. // ignore: prefer_final_locals
  800. Object? postBody;
  801. final queryParams = <QueryParam>[];
  802. final headerParams = <String, String>{};
  803. final formParams = <String, String>{};
  804. const contentTypes = <String>[];
  805. return apiClient.invokeAPI(
  806. path,
  807. 'GET',
  808. queryParams,
  809. postBody,
  810. headerParams,
  811. formParams,
  812. contentTypes.isEmpty ? null : contentTypes.first,
  813. );
  814. }
  815. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  816. final response = await getCuratedLocationsWithHttpInfo();
  817. if (response.statusCode >= HttpStatus.badRequest) {
  818. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  819. }
  820. // When a remote server returns no body with a status of 204, we shall not decode it.
  821. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  822. // FormatException when trying to decode an empty string.
  823. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  824. final responseBody = await _decodeBodyBytes(response);
  825. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  826. .cast<CuratedLocationsResponseDto>()
  827. .toList();
  828. }
  829. return null;
  830. }
  831. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  832. Future<Response> getCuratedObjectsWithHttpInfo() async {
  833. // ignore: prefer_const_declarations
  834. final path = r'/asset/curated-objects';
  835. // ignore: prefer_final_locals
  836. Object? postBody;
  837. final queryParams = <QueryParam>[];
  838. final headerParams = <String, String>{};
  839. final formParams = <String, String>{};
  840. const contentTypes = <String>[];
  841. return apiClient.invokeAPI(
  842. path,
  843. 'GET',
  844. queryParams,
  845. postBody,
  846. headerParams,
  847. formParams,
  848. contentTypes.isEmpty ? null : contentTypes.first,
  849. );
  850. }
  851. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  852. final response = await getCuratedObjectsWithHttpInfo();
  853. if (response.statusCode >= HttpStatus.badRequest) {
  854. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  855. }
  856. // When a remote server returns no body with a status of 204, we shall not decode it.
  857. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  858. // FormatException when trying to decode an empty string.
  859. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  860. final responseBody = await _decodeBodyBytes(response);
  861. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  862. .cast<CuratedObjectsResponseDto>()
  863. .toList();
  864. }
  865. return null;
  866. }
  867. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  868. /// Parameters:
  869. ///
  870. /// * [bool] isFavorite:
  871. Future<Response> getMapMarkersWithHttpInfo({ bool? isFavorite, }) async {
  872. // ignore: prefer_const_declarations
  873. final path = r'/asset/map-marker';
  874. // ignore: prefer_final_locals
  875. Object? postBody;
  876. final queryParams = <QueryParam>[];
  877. final headerParams = <String, String>{};
  878. final formParams = <String, String>{};
  879. if (isFavorite != null) {
  880. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  881. }
  882. const contentTypes = <String>[];
  883. return apiClient.invokeAPI(
  884. path,
  885. 'GET',
  886. queryParams,
  887. postBody,
  888. headerParams,
  889. formParams,
  890. contentTypes.isEmpty ? null : contentTypes.first,
  891. );
  892. }
  893. /// Parameters:
  894. ///
  895. /// * [bool] isFavorite:
  896. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isFavorite, }) async {
  897. final response = await getMapMarkersWithHttpInfo( isFavorite: isFavorite, );
  898. if (response.statusCode >= HttpStatus.badRequest) {
  899. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  900. }
  901. // When a remote server returns no body with a status of 204, we shall not decode it.
  902. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  903. // FormatException when trying to decode an empty string.
  904. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  905. final responseBody = await _decodeBodyBytes(response);
  906. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  907. .cast<MapMarkerResponseDto>()
  908. .toList();
  909. }
  910. return null;
  911. }
  912. /// Get all asset of a device that are in the database, ID only.
  913. ///
  914. /// Note: This method returns the HTTP [Response].
  915. ///
  916. /// Parameters:
  917. ///
  918. /// * [String] deviceId (required):
  919. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  920. // ignore: prefer_const_declarations
  921. final path = r'/asset/{deviceId}'
  922. .replaceAll('{deviceId}', deviceId);
  923. // ignore: prefer_final_locals
  924. Object? postBody;
  925. final queryParams = <QueryParam>[];
  926. final headerParams = <String, String>{};
  927. final formParams = <String, String>{};
  928. const contentTypes = <String>[];
  929. return apiClient.invokeAPI(
  930. path,
  931. 'GET',
  932. queryParams,
  933. postBody,
  934. headerParams,
  935. formParams,
  936. contentTypes.isEmpty ? null : contentTypes.first,
  937. );
  938. }
  939. /// Get all asset of a device that are in the database, ID only.
  940. ///
  941. /// Parameters:
  942. ///
  943. /// * [String] deviceId (required):
  944. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  945. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  946. if (response.statusCode >= HttpStatus.badRequest) {
  947. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  948. }
  949. // When a remote server returns no body with a status of 204, we shall not decode it.
  950. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  951. // FormatException when trying to decode an empty string.
  952. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  953. final responseBody = await _decodeBodyBytes(response);
  954. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  955. .cast<String>()
  956. .toList();
  957. }
  958. return null;
  959. }
  960. /// Performs an HTTP 'PATCH /asset/shared-link/remove' operation and returns the [Response].
  961. /// Parameters:
  962. ///
  963. /// * [RemoveAssetsDto] removeAssetsDto (required):
  964. ///
  965. /// * [String] key:
  966. Future<Response> removeAssetsFromSharedLinkWithHttpInfo(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
  967. // ignore: prefer_const_declarations
  968. final path = r'/asset/shared-link/remove';
  969. // ignore: prefer_final_locals
  970. Object? postBody = removeAssetsDto;
  971. final queryParams = <QueryParam>[];
  972. final headerParams = <String, String>{};
  973. final formParams = <String, String>{};
  974. if (key != null) {
  975. queryParams.addAll(_queryParams('', 'key', key));
  976. }
  977. const contentTypes = <String>['application/json'];
  978. return apiClient.invokeAPI(
  979. path,
  980. 'PATCH',
  981. queryParams,
  982. postBody,
  983. headerParams,
  984. formParams,
  985. contentTypes.isEmpty ? null : contentTypes.first,
  986. );
  987. }
  988. /// Parameters:
  989. ///
  990. /// * [RemoveAssetsDto] removeAssetsDto (required):
  991. ///
  992. /// * [String] key:
  993. Future<SharedLinkResponseDto?> removeAssetsFromSharedLink(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
  994. final response = await removeAssetsFromSharedLinkWithHttpInfo(removeAssetsDto, key: key, );
  995. if (response.statusCode >= HttpStatus.badRequest) {
  996. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  997. }
  998. // When a remote server returns no body with a status of 204, we shall not decode it.
  999. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1000. // FormatException when trying to decode an empty string.
  1001. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1002. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  1003. }
  1004. return null;
  1005. }
  1006. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  1007. /// Parameters:
  1008. ///
  1009. /// * [SearchAssetDto] searchAssetDto (required):
  1010. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1011. // ignore: prefer_const_declarations
  1012. final path = r'/asset/search';
  1013. // ignore: prefer_final_locals
  1014. Object? postBody = searchAssetDto;
  1015. final queryParams = <QueryParam>[];
  1016. final headerParams = <String, String>{};
  1017. final formParams = <String, String>{};
  1018. const contentTypes = <String>['application/json'];
  1019. return apiClient.invokeAPI(
  1020. path,
  1021. 'POST',
  1022. queryParams,
  1023. postBody,
  1024. headerParams,
  1025. formParams,
  1026. contentTypes.isEmpty ? null : contentTypes.first,
  1027. );
  1028. }
  1029. /// Parameters:
  1030. ///
  1031. /// * [SearchAssetDto] searchAssetDto (required):
  1032. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1033. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1034. if (response.statusCode >= HttpStatus.badRequest) {
  1035. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1036. }
  1037. // When a remote server returns no body with a status of 204, we shall not decode it.
  1038. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1039. // FormatException when trying to decode an empty string.
  1040. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1041. final responseBody = await _decodeBodyBytes(response);
  1042. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1043. .cast<AssetResponseDto>()
  1044. .toList();
  1045. }
  1046. return null;
  1047. }
  1048. /// Performs an HTTP 'GET /asset/file/{assetId}' operation and returns the [Response].
  1049. /// Parameters:
  1050. ///
  1051. /// * [String] assetId (required):
  1052. ///
  1053. /// * [bool] isThumb:
  1054. ///
  1055. /// * [bool] isWeb:
  1056. ///
  1057. /// * [String] key:
  1058. Future<Response> serveFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, String? key, }) async {
  1059. // ignore: prefer_const_declarations
  1060. final path = r'/asset/file/{assetId}'
  1061. .replaceAll('{assetId}', assetId);
  1062. // ignore: prefer_final_locals
  1063. Object? postBody;
  1064. final queryParams = <QueryParam>[];
  1065. final headerParams = <String, String>{};
  1066. final formParams = <String, String>{};
  1067. if (isThumb != null) {
  1068. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1069. }
  1070. if (isWeb != null) {
  1071. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1072. }
  1073. if (key != null) {
  1074. queryParams.addAll(_queryParams('', 'key', key));
  1075. }
  1076. const contentTypes = <String>[];
  1077. return apiClient.invokeAPI(
  1078. path,
  1079. 'GET',
  1080. queryParams,
  1081. postBody,
  1082. headerParams,
  1083. formParams,
  1084. contentTypes.isEmpty ? null : contentTypes.first,
  1085. );
  1086. }
  1087. /// Parameters:
  1088. ///
  1089. /// * [String] assetId (required):
  1090. ///
  1091. /// * [bool] isThumb:
  1092. ///
  1093. /// * [bool] isWeb:
  1094. ///
  1095. /// * [String] key:
  1096. Future<MultipartFile?> serveFile(String assetId, { bool? isThumb, bool? isWeb, String? key, }) async {
  1097. final response = await serveFileWithHttpInfo(assetId, isThumb: isThumb, isWeb: isWeb, key: key, );
  1098. if (response.statusCode >= HttpStatus.badRequest) {
  1099. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1100. }
  1101. // When a remote server returns no body with a status of 204, we shall not decode it.
  1102. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1103. // FormatException when trying to decode an empty string.
  1104. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1105. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1106. }
  1107. return null;
  1108. }
  1109. /// Update an asset
  1110. ///
  1111. /// Note: This method returns the HTTP [Response].
  1112. ///
  1113. /// Parameters:
  1114. ///
  1115. /// * [String] assetId (required):
  1116. ///
  1117. /// * [UpdateAssetDto] updateAssetDto (required):
  1118. Future<Response> updateAssetWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
  1119. // ignore: prefer_const_declarations
  1120. final path = r'/asset/{assetId}'
  1121. .replaceAll('{assetId}', assetId);
  1122. // ignore: prefer_final_locals
  1123. Object? postBody = updateAssetDto;
  1124. final queryParams = <QueryParam>[];
  1125. final headerParams = <String, String>{};
  1126. final formParams = <String, String>{};
  1127. const contentTypes = <String>['application/json'];
  1128. return apiClient.invokeAPI(
  1129. path,
  1130. 'PUT',
  1131. queryParams,
  1132. postBody,
  1133. headerParams,
  1134. formParams,
  1135. contentTypes.isEmpty ? null : contentTypes.first,
  1136. );
  1137. }
  1138. /// Update an asset
  1139. ///
  1140. /// Parameters:
  1141. ///
  1142. /// * [String] assetId (required):
  1143. ///
  1144. /// * [UpdateAssetDto] updateAssetDto (required):
  1145. Future<AssetResponseDto?> updateAsset(String assetId, UpdateAssetDto updateAssetDto,) async {
  1146. final response = await updateAssetWithHttpInfo(assetId, updateAssetDto,);
  1147. if (response.statusCode >= HttpStatus.badRequest) {
  1148. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1149. }
  1150. // When a remote server returns no body with a status of 204, we shall not decode it.
  1151. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1152. // FormatException when trying to decode an empty string.
  1153. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1154. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1155. }
  1156. return null;
  1157. }
  1158. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1159. /// Parameters:
  1160. ///
  1161. /// * [AssetTypeEnum] assetType (required):
  1162. ///
  1163. /// * [MultipartFile] assetData (required):
  1164. ///
  1165. /// * [String] deviceAssetId (required):
  1166. ///
  1167. /// * [String] deviceId (required):
  1168. ///
  1169. /// * [String] fileCreatedAt (required):
  1170. ///
  1171. /// * [String] fileModifiedAt (required):
  1172. ///
  1173. /// * [bool] isFavorite (required):
  1174. ///
  1175. /// * [String] fileExtension (required):
  1176. ///
  1177. /// * [String] key:
  1178. ///
  1179. /// * [MultipartFile] livePhotoData:
  1180. ///
  1181. /// * [MultipartFile] sidecarData:
  1182. ///
  1183. /// * [bool] isArchived:
  1184. ///
  1185. /// * [bool] isVisible:
  1186. ///
  1187. /// * [String] duration:
  1188. Future<Response> uploadFileWithHttpInfo(AssetTypeEnum assetType, MultipartFile assetData, String deviceAssetId, String deviceId, String fileCreatedAt, String fileModifiedAt, bool isFavorite, String fileExtension, { String? key, MultipartFile? livePhotoData, MultipartFile? sidecarData, bool? isArchived, bool? isVisible, String? duration, }) async {
  1189. // ignore: prefer_const_declarations
  1190. final path = r'/asset/upload';
  1191. // ignore: prefer_final_locals
  1192. Object? postBody;
  1193. final queryParams = <QueryParam>[];
  1194. final headerParams = <String, String>{};
  1195. final formParams = <String, String>{};
  1196. if (key != null) {
  1197. queryParams.addAll(_queryParams('', 'key', key));
  1198. }
  1199. const contentTypes = <String>['multipart/form-data'];
  1200. bool hasFields = false;
  1201. final mp = MultipartRequest('POST', Uri.parse(path));
  1202. if (assetType != null) {
  1203. hasFields = true;
  1204. mp.fields[r'assetType'] = parameterToString(assetType);
  1205. }
  1206. if (assetData != null) {
  1207. hasFields = true;
  1208. mp.fields[r'assetData'] = assetData.field;
  1209. mp.files.add(assetData);
  1210. }
  1211. if (livePhotoData != null) {
  1212. hasFields = true;
  1213. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1214. mp.files.add(livePhotoData);
  1215. }
  1216. if (sidecarData != null) {
  1217. hasFields = true;
  1218. mp.fields[r'sidecarData'] = sidecarData.field;
  1219. mp.files.add(sidecarData);
  1220. }
  1221. if (deviceAssetId != null) {
  1222. hasFields = true;
  1223. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1224. }
  1225. if (deviceId != null) {
  1226. hasFields = true;
  1227. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1228. }
  1229. if (fileCreatedAt != null) {
  1230. hasFields = true;
  1231. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1232. }
  1233. if (fileModifiedAt != null) {
  1234. hasFields = true;
  1235. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1236. }
  1237. if (isFavorite != null) {
  1238. hasFields = true;
  1239. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1240. }
  1241. if (isArchived != null) {
  1242. hasFields = true;
  1243. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1244. }
  1245. if (isVisible != null) {
  1246. hasFields = true;
  1247. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1248. }
  1249. if (fileExtension != null) {
  1250. hasFields = true;
  1251. mp.fields[r'fileExtension'] = parameterToString(fileExtension);
  1252. }
  1253. if (duration != null) {
  1254. hasFields = true;
  1255. mp.fields[r'duration'] = parameterToString(duration);
  1256. }
  1257. if (hasFields) {
  1258. postBody = mp;
  1259. }
  1260. return apiClient.invokeAPI(
  1261. path,
  1262. 'POST',
  1263. queryParams,
  1264. postBody,
  1265. headerParams,
  1266. formParams,
  1267. contentTypes.isEmpty ? null : contentTypes.first,
  1268. );
  1269. }
  1270. /// Parameters:
  1271. ///
  1272. /// * [AssetTypeEnum] assetType (required):
  1273. ///
  1274. /// * [MultipartFile] assetData (required):
  1275. ///
  1276. /// * [String] deviceAssetId (required):
  1277. ///
  1278. /// * [String] deviceId (required):
  1279. ///
  1280. /// * [String] fileCreatedAt (required):
  1281. ///
  1282. /// * [String] fileModifiedAt (required):
  1283. ///
  1284. /// * [bool] isFavorite (required):
  1285. ///
  1286. /// * [String] fileExtension (required):
  1287. ///
  1288. /// * [String] key:
  1289. ///
  1290. /// * [MultipartFile] livePhotoData:
  1291. ///
  1292. /// * [MultipartFile] sidecarData:
  1293. ///
  1294. /// * [bool] isArchived:
  1295. ///
  1296. /// * [bool] isVisible:
  1297. ///
  1298. /// * [String] duration:
  1299. Future<AssetFileUploadResponseDto?> uploadFile(AssetTypeEnum assetType, MultipartFile assetData, String deviceAssetId, String deviceId, String fileCreatedAt, String fileModifiedAt, bool isFavorite, String fileExtension, { String? key, MultipartFile? livePhotoData, MultipartFile? sidecarData, bool? isArchived, bool? isVisible, String? duration, }) async {
  1300. final response = await uploadFileWithHttpInfo(assetType, assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, fileExtension, key: key, livePhotoData: livePhotoData, sidecarData: sidecarData, isArchived: isArchived, isVisible: isVisible, duration: duration, );
  1301. if (response.statusCode >= HttpStatus.badRequest) {
  1302. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1303. }
  1304. // When a remote server returns no body with a status of 204, we shall not decode it.
  1305. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1306. // FormatException when trying to decode an empty string.
  1307. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1308. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1309. }
  1310. return null;
  1311. }
  1312. }