asset_api.dart 53 KB

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