asset_api.dart 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559
  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/{id}' operation and returns the [Response].
  280. /// Parameters:
  281. ///
  282. /// * [String] id (required):
  283. ///
  284. /// * [String] key:
  285. Future<Response> downloadFileWithHttpInfo(String id, { String? key, }) async {
  286. // ignore: prefer_const_declarations
  287. final path = r'/asset/download/{id}'
  288. .replaceAll('{id}', id);
  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] id (required):
  311. ///
  312. /// * [String] key:
  313. Future<MultipartFile?> downloadFile(String id, { String? key, }) async {
  314. final response = await downloadFileWithHttpInfo(id, 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. /// * [String] userId:
  440. ///
  441. /// * [bool] isFavorite:
  442. ///
  443. /// * [bool] isArchived:
  444. ///
  445. /// * [num] skip:
  446. ///
  447. /// * [String] ifNoneMatch:
  448. /// ETag of data already cached on the client
  449. Future<Response> getAllAssetsWithHttpInfo({ String? userId, bool? isFavorite, bool? isArchived, num? skip, String? ifNoneMatch, }) async {
  450. // ignore: prefer_const_declarations
  451. final path = r'/asset';
  452. // ignore: prefer_final_locals
  453. Object? postBody;
  454. final queryParams = <QueryParam>[];
  455. final headerParams = <String, String>{};
  456. final formParams = <String, String>{};
  457. if (userId != null) {
  458. queryParams.addAll(_queryParams('', 'userId', userId));
  459. }
  460. if (isFavorite != null) {
  461. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  462. }
  463. if (isArchived != null) {
  464. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  465. }
  466. if (skip != null) {
  467. queryParams.addAll(_queryParams('', 'skip', skip));
  468. }
  469. if (ifNoneMatch != null) {
  470. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  471. }
  472. const contentTypes = <String>[];
  473. return apiClient.invokeAPI(
  474. path,
  475. 'GET',
  476. queryParams,
  477. postBody,
  478. headerParams,
  479. formParams,
  480. contentTypes.isEmpty ? null : contentTypes.first,
  481. );
  482. }
  483. /// Get all AssetEntity belong to the user
  484. ///
  485. /// Parameters:
  486. ///
  487. /// * [String] userId:
  488. ///
  489. /// * [bool] isFavorite:
  490. ///
  491. /// * [bool] isArchived:
  492. ///
  493. /// * [num] skip:
  494. ///
  495. /// * [String] ifNoneMatch:
  496. /// ETag of data already cached on the client
  497. Future<List<AssetResponseDto>?> getAllAssets({ String? userId, bool? isFavorite, bool? isArchived, num? skip, String? ifNoneMatch, }) async {
  498. final response = await getAllAssetsWithHttpInfo( userId: userId, isFavorite: isFavorite, isArchived: isArchived, skip: skip, ifNoneMatch: ifNoneMatch, );
  499. if (response.statusCode >= HttpStatus.badRequest) {
  500. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  501. }
  502. // When a remote server returns no body with a status of 204, we shall not decode it.
  503. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  504. // FormatException when trying to decode an empty string.
  505. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  506. final responseBody = await _decodeBodyBytes(response);
  507. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  508. .cast<AssetResponseDto>()
  509. .toList();
  510. }
  511. return null;
  512. }
  513. /// Performs an HTTP 'GET /asset/stat/archive' operation and returns the [Response].
  514. Future<Response> getArchivedAssetCountByUserIdWithHttpInfo() async {
  515. // ignore: prefer_const_declarations
  516. final path = r'/asset/stat/archive';
  517. // ignore: prefer_final_locals
  518. Object? postBody;
  519. final queryParams = <QueryParam>[];
  520. final headerParams = <String, String>{};
  521. final formParams = <String, String>{};
  522. const contentTypes = <String>[];
  523. return apiClient.invokeAPI(
  524. path,
  525. 'GET',
  526. queryParams,
  527. postBody,
  528. headerParams,
  529. formParams,
  530. contentTypes.isEmpty ? null : contentTypes.first,
  531. );
  532. }
  533. Future<AssetCountByUserIdResponseDto?> getArchivedAssetCountByUserId() async {
  534. final response = await getArchivedAssetCountByUserIdWithHttpInfo();
  535. if (response.statusCode >= HttpStatus.badRequest) {
  536. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  537. }
  538. // When a remote server returns no body with a status of 204, we shall not decode it.
  539. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  540. // FormatException when trying to decode an empty string.
  541. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  542. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  543. }
  544. return null;
  545. }
  546. /// Get a single asset's information
  547. ///
  548. /// Note: This method returns the HTTP [Response].
  549. ///
  550. /// Parameters:
  551. ///
  552. /// * [String] id (required):
  553. ///
  554. /// * [String] key:
  555. Future<Response> getAssetByIdWithHttpInfo(String id, { String? key, }) async {
  556. // ignore: prefer_const_declarations
  557. final path = r'/asset/assetById/{id}'
  558. .replaceAll('{id}', id);
  559. // ignore: prefer_final_locals
  560. Object? postBody;
  561. final queryParams = <QueryParam>[];
  562. final headerParams = <String, String>{};
  563. final formParams = <String, String>{};
  564. if (key != null) {
  565. queryParams.addAll(_queryParams('', 'key', key));
  566. }
  567. const contentTypes = <String>[];
  568. return apiClient.invokeAPI(
  569. path,
  570. 'GET',
  571. queryParams,
  572. postBody,
  573. headerParams,
  574. formParams,
  575. contentTypes.isEmpty ? null : contentTypes.first,
  576. );
  577. }
  578. /// Get a single asset's information
  579. ///
  580. /// Parameters:
  581. ///
  582. /// * [String] id (required):
  583. ///
  584. /// * [String] key:
  585. Future<AssetResponseDto?> getAssetById(String id, { String? key, }) async {
  586. final response = await getAssetByIdWithHttpInfo(id, key: key, );
  587. if (response.statusCode >= HttpStatus.badRequest) {
  588. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  589. }
  590. // When a remote server returns no body with a status of 204, we shall not decode it.
  591. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  592. // FormatException when trying to decode an empty string.
  593. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  594. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  595. }
  596. return null;
  597. }
  598. /// Performs an HTTP 'POST /asset/time-bucket' operation and returns the [Response].
  599. /// Parameters:
  600. ///
  601. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  602. Future<Response> getAssetByTimeBucketWithHttpInfo(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  603. // ignore: prefer_const_declarations
  604. final path = r'/asset/time-bucket';
  605. // ignore: prefer_final_locals
  606. Object? postBody = getAssetByTimeBucketDto;
  607. final queryParams = <QueryParam>[];
  608. final headerParams = <String, String>{};
  609. final formParams = <String, String>{};
  610. const contentTypes = <String>['application/json'];
  611. return apiClient.invokeAPI(
  612. path,
  613. 'POST',
  614. queryParams,
  615. postBody,
  616. headerParams,
  617. formParams,
  618. contentTypes.isEmpty ? null : contentTypes.first,
  619. );
  620. }
  621. /// Parameters:
  622. ///
  623. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  624. Future<List<AssetResponseDto>?> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  625. final response = await getAssetByTimeBucketWithHttpInfo(getAssetByTimeBucketDto,);
  626. if (response.statusCode >= HttpStatus.badRequest) {
  627. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  628. }
  629. // When a remote server returns no body with a status of 204, we shall not decode it.
  630. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  631. // FormatException when trying to decode an empty string.
  632. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  633. final responseBody = await _decodeBodyBytes(response);
  634. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  635. .cast<AssetResponseDto>()
  636. .toList();
  637. }
  638. return null;
  639. }
  640. /// Performs an HTTP 'POST /asset/count-by-time-bucket' operation and returns the [Response].
  641. /// Parameters:
  642. ///
  643. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  644. Future<Response> getAssetCountByTimeBucketWithHttpInfo(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  645. // ignore: prefer_const_declarations
  646. final path = r'/asset/count-by-time-bucket';
  647. // ignore: prefer_final_locals
  648. Object? postBody = getAssetCountByTimeBucketDto;
  649. final queryParams = <QueryParam>[];
  650. final headerParams = <String, String>{};
  651. final formParams = <String, String>{};
  652. const contentTypes = <String>['application/json'];
  653. return apiClient.invokeAPI(
  654. path,
  655. 'POST',
  656. queryParams,
  657. postBody,
  658. headerParams,
  659. formParams,
  660. contentTypes.isEmpty ? null : contentTypes.first,
  661. );
  662. }
  663. /// Parameters:
  664. ///
  665. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  666. Future<AssetCountByTimeBucketResponseDto?> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  667. final response = await getAssetCountByTimeBucketWithHttpInfo(getAssetCountByTimeBucketDto,);
  668. if (response.statusCode >= HttpStatus.badRequest) {
  669. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  670. }
  671. // When a remote server returns no body with a status of 204, we shall not decode it.
  672. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  673. // FormatException when trying to decode an empty string.
  674. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  675. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByTimeBucketResponseDto',) as AssetCountByTimeBucketResponseDto;
  676. }
  677. return null;
  678. }
  679. /// Performs an HTTP 'GET /asset/count-by-user-id' operation and returns the [Response].
  680. Future<Response> getAssetCountByUserIdWithHttpInfo() async {
  681. // ignore: prefer_const_declarations
  682. final path = r'/asset/count-by-user-id';
  683. // ignore: prefer_final_locals
  684. Object? postBody;
  685. final queryParams = <QueryParam>[];
  686. final headerParams = <String, String>{};
  687. final formParams = <String, String>{};
  688. const contentTypes = <String>[];
  689. return apiClient.invokeAPI(
  690. path,
  691. 'GET',
  692. queryParams,
  693. postBody,
  694. headerParams,
  695. formParams,
  696. contentTypes.isEmpty ? null : contentTypes.first,
  697. );
  698. }
  699. Future<AssetCountByUserIdResponseDto?> getAssetCountByUserId() async {
  700. final response = await getAssetCountByUserIdWithHttpInfo();
  701. if (response.statusCode >= HttpStatus.badRequest) {
  702. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  703. }
  704. // When a remote server returns no body with a status of 204, we shall not decode it.
  705. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  706. // FormatException when trying to decode an empty string.
  707. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  708. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  709. }
  710. return null;
  711. }
  712. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  713. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  714. // ignore: prefer_const_declarations
  715. final path = r'/asset/search-terms';
  716. // ignore: prefer_final_locals
  717. Object? postBody;
  718. final queryParams = <QueryParam>[];
  719. final headerParams = <String, String>{};
  720. final formParams = <String, String>{};
  721. const contentTypes = <String>[];
  722. return apiClient.invokeAPI(
  723. path,
  724. 'GET',
  725. queryParams,
  726. postBody,
  727. headerParams,
  728. formParams,
  729. contentTypes.isEmpty ? null : contentTypes.first,
  730. );
  731. }
  732. Future<List<String>?> getAssetSearchTerms() async {
  733. final response = await getAssetSearchTermsWithHttpInfo();
  734. if (response.statusCode >= HttpStatus.badRequest) {
  735. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  736. }
  737. // When a remote server returns no body with a status of 204, we shall not decode it.
  738. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  739. // FormatException when trying to decode an empty string.
  740. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  741. final responseBody = await _decodeBodyBytes(response);
  742. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  743. .cast<String>()
  744. .toList();
  745. }
  746. return null;
  747. }
  748. /// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
  749. /// Parameters:
  750. ///
  751. /// * [String] id (required):
  752. ///
  753. /// * [ThumbnailFormat] format:
  754. ///
  755. /// * [String] key:
  756. Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
  757. // ignore: prefer_const_declarations
  758. final path = r'/asset/thumbnail/{id}'
  759. .replaceAll('{id}', id);
  760. // ignore: prefer_final_locals
  761. Object? postBody;
  762. final queryParams = <QueryParam>[];
  763. final headerParams = <String, String>{};
  764. final formParams = <String, String>{};
  765. if (format != null) {
  766. queryParams.addAll(_queryParams('', 'format', format));
  767. }
  768. if (key != null) {
  769. queryParams.addAll(_queryParams('', 'key', key));
  770. }
  771. const contentTypes = <String>[];
  772. return apiClient.invokeAPI(
  773. path,
  774. 'GET',
  775. queryParams,
  776. postBody,
  777. headerParams,
  778. formParams,
  779. contentTypes.isEmpty ? null : contentTypes.first,
  780. );
  781. }
  782. /// Parameters:
  783. ///
  784. /// * [String] id (required):
  785. ///
  786. /// * [ThumbnailFormat] format:
  787. ///
  788. /// * [String] key:
  789. Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
  790. final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
  791. if (response.statusCode >= HttpStatus.badRequest) {
  792. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  793. }
  794. // When a remote server returns no body with a status of 204, we shall not decode it.
  795. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  796. // FormatException when trying to decode an empty string.
  797. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  798. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  799. }
  800. return null;
  801. }
  802. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  803. Future<Response> getCuratedLocationsWithHttpInfo() async {
  804. // ignore: prefer_const_declarations
  805. final path = r'/asset/curated-locations';
  806. // ignore: prefer_final_locals
  807. Object? postBody;
  808. final queryParams = <QueryParam>[];
  809. final headerParams = <String, String>{};
  810. final formParams = <String, String>{};
  811. const contentTypes = <String>[];
  812. return apiClient.invokeAPI(
  813. path,
  814. 'GET',
  815. queryParams,
  816. postBody,
  817. headerParams,
  818. formParams,
  819. contentTypes.isEmpty ? null : contentTypes.first,
  820. );
  821. }
  822. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  823. final response = await getCuratedLocationsWithHttpInfo();
  824. if (response.statusCode >= HttpStatus.badRequest) {
  825. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  826. }
  827. // When a remote server returns no body with a status of 204, we shall not decode it.
  828. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  829. // FormatException when trying to decode an empty string.
  830. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  831. final responseBody = await _decodeBodyBytes(response);
  832. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  833. .cast<CuratedLocationsResponseDto>()
  834. .toList();
  835. }
  836. return null;
  837. }
  838. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  839. Future<Response> getCuratedObjectsWithHttpInfo() async {
  840. // ignore: prefer_const_declarations
  841. final path = r'/asset/curated-objects';
  842. // ignore: prefer_final_locals
  843. Object? postBody;
  844. final queryParams = <QueryParam>[];
  845. final headerParams = <String, String>{};
  846. final formParams = <String, String>{};
  847. const contentTypes = <String>[];
  848. return apiClient.invokeAPI(
  849. path,
  850. 'GET',
  851. queryParams,
  852. postBody,
  853. headerParams,
  854. formParams,
  855. contentTypes.isEmpty ? null : contentTypes.first,
  856. );
  857. }
  858. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  859. final response = await getCuratedObjectsWithHttpInfo();
  860. if (response.statusCode >= HttpStatus.badRequest) {
  861. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  862. }
  863. // When a remote server returns no body with a status of 204, we shall not decode it.
  864. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  865. // FormatException when trying to decode an empty string.
  866. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  867. final responseBody = await _decodeBodyBytes(response);
  868. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  869. .cast<CuratedObjectsResponseDto>()
  870. .toList();
  871. }
  872. return null;
  873. }
  874. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  875. /// Parameters:
  876. ///
  877. /// * [bool] isFavorite:
  878. ///
  879. /// * [DateTime] fileCreatedAfter:
  880. ///
  881. /// * [DateTime] fileCreatedBefore:
  882. Future<Response> getMapMarkersWithHttpInfo({ bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  883. // ignore: prefer_const_declarations
  884. final path = r'/asset/map-marker';
  885. // ignore: prefer_final_locals
  886. Object? postBody;
  887. final queryParams = <QueryParam>[];
  888. final headerParams = <String, String>{};
  889. final formParams = <String, String>{};
  890. if (isFavorite != null) {
  891. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  892. }
  893. if (fileCreatedAfter != null) {
  894. queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
  895. }
  896. if (fileCreatedBefore != null) {
  897. queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
  898. }
  899. const contentTypes = <String>[];
  900. return apiClient.invokeAPI(
  901. path,
  902. 'GET',
  903. queryParams,
  904. postBody,
  905. headerParams,
  906. formParams,
  907. contentTypes.isEmpty ? null : contentTypes.first,
  908. );
  909. }
  910. /// Parameters:
  911. ///
  912. /// * [bool] isFavorite:
  913. ///
  914. /// * [DateTime] fileCreatedAfter:
  915. ///
  916. /// * [DateTime] fileCreatedBefore:
  917. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  918. final response = await getMapMarkersWithHttpInfo( isFavorite: isFavorite, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, );
  919. if (response.statusCode >= HttpStatus.badRequest) {
  920. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  921. }
  922. // When a remote server returns no body with a status of 204, we shall not decode it.
  923. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  924. // FormatException when trying to decode an empty string.
  925. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  926. final responseBody = await _decodeBodyBytes(response);
  927. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  928. .cast<MapMarkerResponseDto>()
  929. .toList();
  930. }
  931. return null;
  932. }
  933. /// Get all asset of a device that are in the database, ID only.
  934. ///
  935. /// Note: This method returns the HTTP [Response].
  936. ///
  937. /// Parameters:
  938. ///
  939. /// * [String] deviceId (required):
  940. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  941. // ignore: prefer_const_declarations
  942. final path = r'/asset/{deviceId}'
  943. .replaceAll('{deviceId}', deviceId);
  944. // ignore: prefer_final_locals
  945. Object? postBody;
  946. final queryParams = <QueryParam>[];
  947. final headerParams = <String, String>{};
  948. final formParams = <String, String>{};
  949. const contentTypes = <String>[];
  950. return apiClient.invokeAPI(
  951. path,
  952. 'GET',
  953. queryParams,
  954. postBody,
  955. headerParams,
  956. formParams,
  957. contentTypes.isEmpty ? null : contentTypes.first,
  958. );
  959. }
  960. /// Get all asset of a device that are in the database, ID only.
  961. ///
  962. /// Parameters:
  963. ///
  964. /// * [String] deviceId (required):
  965. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  966. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  967. if (response.statusCode >= HttpStatus.badRequest) {
  968. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  969. }
  970. // When a remote server returns no body with a status of 204, we shall not decode it.
  971. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  972. // FormatException when trying to decode an empty string.
  973. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  974. final responseBody = await _decodeBodyBytes(response);
  975. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  976. .cast<String>()
  977. .toList();
  978. }
  979. return null;
  980. }
  981. /// Performs an HTTP 'PATCH /asset/shared-link/remove' operation and returns the [Response].
  982. /// Parameters:
  983. ///
  984. /// * [RemoveAssetsDto] removeAssetsDto (required):
  985. ///
  986. /// * [String] key:
  987. Future<Response> removeAssetsFromSharedLinkWithHttpInfo(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
  988. // ignore: prefer_const_declarations
  989. final path = r'/asset/shared-link/remove';
  990. // ignore: prefer_final_locals
  991. Object? postBody = removeAssetsDto;
  992. final queryParams = <QueryParam>[];
  993. final headerParams = <String, String>{};
  994. final formParams = <String, String>{};
  995. if (key != null) {
  996. queryParams.addAll(_queryParams('', 'key', key));
  997. }
  998. const contentTypes = <String>['application/json'];
  999. return apiClient.invokeAPI(
  1000. path,
  1001. 'PATCH',
  1002. queryParams,
  1003. postBody,
  1004. headerParams,
  1005. formParams,
  1006. contentTypes.isEmpty ? null : contentTypes.first,
  1007. );
  1008. }
  1009. /// Parameters:
  1010. ///
  1011. /// * [RemoveAssetsDto] removeAssetsDto (required):
  1012. ///
  1013. /// * [String] key:
  1014. Future<SharedLinkResponseDto?> removeAssetsFromSharedLink(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
  1015. final response = await removeAssetsFromSharedLinkWithHttpInfo(removeAssetsDto, key: key, );
  1016. if (response.statusCode >= HttpStatus.badRequest) {
  1017. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1018. }
  1019. // When a remote server returns no body with a status of 204, we shall not decode it.
  1020. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1021. // FormatException when trying to decode an empty string.
  1022. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1023. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  1024. }
  1025. return null;
  1026. }
  1027. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  1028. /// Parameters:
  1029. ///
  1030. /// * [SearchAssetDto] searchAssetDto (required):
  1031. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1032. // ignore: prefer_const_declarations
  1033. final path = r'/asset/search';
  1034. // ignore: prefer_final_locals
  1035. Object? postBody = searchAssetDto;
  1036. final queryParams = <QueryParam>[];
  1037. final headerParams = <String, String>{};
  1038. final formParams = <String, String>{};
  1039. const contentTypes = <String>['application/json'];
  1040. return apiClient.invokeAPI(
  1041. path,
  1042. 'POST',
  1043. queryParams,
  1044. postBody,
  1045. headerParams,
  1046. formParams,
  1047. contentTypes.isEmpty ? null : contentTypes.first,
  1048. );
  1049. }
  1050. /// Parameters:
  1051. ///
  1052. /// * [SearchAssetDto] searchAssetDto (required):
  1053. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1054. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1055. if (response.statusCode >= HttpStatus.badRequest) {
  1056. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1057. }
  1058. // When a remote server returns no body with a status of 204, we shall not decode it.
  1059. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1060. // FormatException when trying to decode an empty string.
  1061. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1062. final responseBody = await _decodeBodyBytes(response);
  1063. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1064. .cast<AssetResponseDto>()
  1065. .toList();
  1066. }
  1067. return null;
  1068. }
  1069. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1070. /// Parameters:
  1071. ///
  1072. /// * [String] id (required):
  1073. ///
  1074. /// * [bool] isThumb:
  1075. ///
  1076. /// * [bool] isWeb:
  1077. ///
  1078. /// * [String] key:
  1079. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1080. // ignore: prefer_const_declarations
  1081. final path = r'/asset/file/{id}'
  1082. .replaceAll('{id}', id);
  1083. // ignore: prefer_final_locals
  1084. Object? postBody;
  1085. final queryParams = <QueryParam>[];
  1086. final headerParams = <String, String>{};
  1087. final formParams = <String, String>{};
  1088. if (isThumb != null) {
  1089. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1090. }
  1091. if (isWeb != null) {
  1092. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1093. }
  1094. if (key != null) {
  1095. queryParams.addAll(_queryParams('', 'key', key));
  1096. }
  1097. const contentTypes = <String>[];
  1098. return apiClient.invokeAPI(
  1099. path,
  1100. 'GET',
  1101. queryParams,
  1102. postBody,
  1103. headerParams,
  1104. formParams,
  1105. contentTypes.isEmpty ? null : contentTypes.first,
  1106. );
  1107. }
  1108. /// Parameters:
  1109. ///
  1110. /// * [String] id (required):
  1111. ///
  1112. /// * [bool] isThumb:
  1113. ///
  1114. /// * [bool] isWeb:
  1115. ///
  1116. /// * [String] key:
  1117. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1118. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1119. if (response.statusCode >= HttpStatus.badRequest) {
  1120. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1121. }
  1122. // When a remote server returns no body with a status of 204, we shall not decode it.
  1123. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1124. // FormatException when trying to decode an empty string.
  1125. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1126. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1127. }
  1128. return null;
  1129. }
  1130. /// Update an asset
  1131. ///
  1132. /// Note: This method returns the HTTP [Response].
  1133. ///
  1134. /// Parameters:
  1135. ///
  1136. /// * [String] id (required):
  1137. ///
  1138. /// * [UpdateAssetDto] updateAssetDto (required):
  1139. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1140. // ignore: prefer_const_declarations
  1141. final path = r'/asset/{id}'
  1142. .replaceAll('{id}', id);
  1143. // ignore: prefer_final_locals
  1144. Object? postBody = updateAssetDto;
  1145. final queryParams = <QueryParam>[];
  1146. final headerParams = <String, String>{};
  1147. final formParams = <String, String>{};
  1148. const contentTypes = <String>['application/json'];
  1149. return apiClient.invokeAPI(
  1150. path,
  1151. 'PUT',
  1152. queryParams,
  1153. postBody,
  1154. headerParams,
  1155. formParams,
  1156. contentTypes.isEmpty ? null : contentTypes.first,
  1157. );
  1158. }
  1159. /// Update an asset
  1160. ///
  1161. /// Parameters:
  1162. ///
  1163. /// * [String] id (required):
  1164. ///
  1165. /// * [UpdateAssetDto] updateAssetDto (required):
  1166. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1167. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1168. if (response.statusCode >= HttpStatus.badRequest) {
  1169. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1170. }
  1171. // When a remote server returns no body with a status of 204, we shall not decode it.
  1172. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1173. // FormatException when trying to decode an empty string.
  1174. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1175. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1176. }
  1177. return null;
  1178. }
  1179. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1180. /// Parameters:
  1181. ///
  1182. /// * [AssetTypeEnum] assetType (required):
  1183. ///
  1184. /// * [MultipartFile] assetData (required):
  1185. ///
  1186. /// * [String] deviceAssetId (required):
  1187. ///
  1188. /// * [String] deviceId (required):
  1189. ///
  1190. /// * [DateTime] fileCreatedAt (required):
  1191. ///
  1192. /// * [DateTime] fileModifiedAt (required):
  1193. ///
  1194. /// * [bool] isFavorite (required):
  1195. ///
  1196. /// * [String] fileExtension (required):
  1197. ///
  1198. /// * [String] key:
  1199. ///
  1200. /// * [MultipartFile] livePhotoData:
  1201. ///
  1202. /// * [MultipartFile] sidecarData:
  1203. ///
  1204. /// * [bool] isArchived:
  1205. ///
  1206. /// * [bool] isVisible:
  1207. ///
  1208. /// * [String] duration:
  1209. Future<Response> uploadFileWithHttpInfo(AssetTypeEnum assetType, MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, String fileExtension, { String? key, MultipartFile? livePhotoData, MultipartFile? sidecarData, bool? isArchived, bool? isVisible, String? duration, }) async {
  1210. // ignore: prefer_const_declarations
  1211. final path = r'/asset/upload';
  1212. // ignore: prefer_final_locals
  1213. Object? postBody;
  1214. final queryParams = <QueryParam>[];
  1215. final headerParams = <String, String>{};
  1216. final formParams = <String, String>{};
  1217. if (key != null) {
  1218. queryParams.addAll(_queryParams('', 'key', key));
  1219. }
  1220. const contentTypes = <String>['multipart/form-data'];
  1221. bool hasFields = false;
  1222. final mp = MultipartRequest('POST', Uri.parse(path));
  1223. if (assetType != null) {
  1224. hasFields = true;
  1225. mp.fields[r'assetType'] = parameterToString(assetType);
  1226. }
  1227. if (assetData != null) {
  1228. hasFields = true;
  1229. mp.fields[r'assetData'] = assetData.field;
  1230. mp.files.add(assetData);
  1231. }
  1232. if (livePhotoData != null) {
  1233. hasFields = true;
  1234. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1235. mp.files.add(livePhotoData);
  1236. }
  1237. if (sidecarData != null) {
  1238. hasFields = true;
  1239. mp.fields[r'sidecarData'] = sidecarData.field;
  1240. mp.files.add(sidecarData);
  1241. }
  1242. if (deviceAssetId != null) {
  1243. hasFields = true;
  1244. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1245. }
  1246. if (deviceId != null) {
  1247. hasFields = true;
  1248. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1249. }
  1250. if (fileCreatedAt != null) {
  1251. hasFields = true;
  1252. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1253. }
  1254. if (fileModifiedAt != null) {
  1255. hasFields = true;
  1256. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1257. }
  1258. if (isFavorite != null) {
  1259. hasFields = true;
  1260. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1261. }
  1262. if (isArchived != null) {
  1263. hasFields = true;
  1264. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1265. }
  1266. if (isVisible != null) {
  1267. hasFields = true;
  1268. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1269. }
  1270. if (fileExtension != null) {
  1271. hasFields = true;
  1272. mp.fields[r'fileExtension'] = parameterToString(fileExtension);
  1273. }
  1274. if (duration != null) {
  1275. hasFields = true;
  1276. mp.fields[r'duration'] = parameterToString(duration);
  1277. }
  1278. if (hasFields) {
  1279. postBody = mp;
  1280. }
  1281. return apiClient.invokeAPI(
  1282. path,
  1283. 'POST',
  1284. queryParams,
  1285. postBody,
  1286. headerParams,
  1287. formParams,
  1288. contentTypes.isEmpty ? null : contentTypes.first,
  1289. );
  1290. }
  1291. /// Parameters:
  1292. ///
  1293. /// * [AssetTypeEnum] assetType (required):
  1294. ///
  1295. /// * [MultipartFile] assetData (required):
  1296. ///
  1297. /// * [String] deviceAssetId (required):
  1298. ///
  1299. /// * [String] deviceId (required):
  1300. ///
  1301. /// * [DateTime] fileCreatedAt (required):
  1302. ///
  1303. /// * [DateTime] fileModifiedAt (required):
  1304. ///
  1305. /// * [bool] isFavorite (required):
  1306. ///
  1307. /// * [String] fileExtension (required):
  1308. ///
  1309. /// * [String] key:
  1310. ///
  1311. /// * [MultipartFile] livePhotoData:
  1312. ///
  1313. /// * [MultipartFile] sidecarData:
  1314. ///
  1315. /// * [bool] isArchived:
  1316. ///
  1317. /// * [bool] isVisible:
  1318. ///
  1319. /// * [String] duration:
  1320. Future<AssetFileUploadResponseDto?> uploadFile(AssetTypeEnum assetType, MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, String fileExtension, { String? key, MultipartFile? livePhotoData, MultipartFile? sidecarData, bool? isArchived, bool? isVisible, String? duration, }) async {
  1321. final response = await uploadFileWithHttpInfo(assetType, assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, fileExtension, key: key, livePhotoData: livePhotoData, sidecarData: sidecarData, isArchived: isArchived, isVisible: isVisible, duration: duration, );
  1322. if (response.statusCode >= HttpStatus.badRequest) {
  1323. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1324. }
  1325. // When a remote server returns no body with a status of 204, we shall not decode it.
  1326. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1327. // FormatException when trying to decode an empty string.
  1328. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1329. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1330. }
  1331. return null;
  1332. }
  1333. }