asset_api.dart 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814
  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. /// Checks if assets exist by checksums
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
  20. Future<Response> bulkUploadCheckWithHttpInfo(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
  21. // ignore: prefer_const_declarations
  22. final path = r'/asset/bulk-upload-check';
  23. // ignore: prefer_final_locals
  24. Object? postBody = assetBulkUploadCheckDto;
  25. final queryParams = <QueryParam>[];
  26. final headerParams = <String, String>{};
  27. final formParams = <String, String>{};
  28. const contentTypes = <String>['application/json'];
  29. return apiClient.invokeAPI(
  30. path,
  31. 'POST',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. /// Checks if assets exist by checksums
  40. ///
  41. /// Parameters:
  42. ///
  43. /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
  44. Future<AssetBulkUploadCheckResponseDto?> bulkUploadCheck(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
  45. final response = await bulkUploadCheckWithHttpInfo(assetBulkUploadCheckDto,);
  46. if (response.statusCode >= HttpStatus.badRequest) {
  47. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  48. }
  49. // When a remote server returns no body with a status of 204, we shall not decode it.
  50. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  51. // FormatException when trying to decode an empty string.
  52. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  53. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetBulkUploadCheckResponseDto',) as AssetBulkUploadCheckResponseDto;
  54. }
  55. return null;
  56. }
  57. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  58. ///
  59. /// Note: This method returns the HTTP [Response].
  60. ///
  61. /// Parameters:
  62. ///
  63. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  64. Future<Response> checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  65. // ignore: prefer_const_declarations
  66. final path = r'/asset/exist';
  67. // ignore: prefer_final_locals
  68. Object? postBody = checkExistingAssetsDto;
  69. final queryParams = <QueryParam>[];
  70. final headerParams = <String, String>{};
  71. final formParams = <String, String>{};
  72. const contentTypes = <String>['application/json'];
  73. return apiClient.invokeAPI(
  74. path,
  75. 'POST',
  76. queryParams,
  77. postBody,
  78. headerParams,
  79. formParams,
  80. contentTypes.isEmpty ? null : contentTypes.first,
  81. );
  82. }
  83. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  84. ///
  85. /// Parameters:
  86. ///
  87. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  88. Future<CheckExistingAssetsResponseDto?> checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  89. final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,);
  90. if (response.statusCode >= HttpStatus.badRequest) {
  91. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  92. }
  93. // When a remote server returns no body with a status of 204, we shall not decode it.
  94. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  95. // FormatException when trying to decode an empty string.
  96. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  97. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto;
  98. }
  99. return null;
  100. }
  101. /// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
  102. /// Parameters:
  103. ///
  104. /// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
  105. Future<Response> deleteAssetsWithHttpInfo(AssetBulkDeleteDto assetBulkDeleteDto,) async {
  106. // ignore: prefer_const_declarations
  107. final path = r'/asset';
  108. // ignore: prefer_final_locals
  109. Object? postBody = assetBulkDeleteDto;
  110. final queryParams = <QueryParam>[];
  111. final headerParams = <String, String>{};
  112. final formParams = <String, String>{};
  113. const contentTypes = <String>['application/json'];
  114. return apiClient.invokeAPI(
  115. path,
  116. 'DELETE',
  117. queryParams,
  118. postBody,
  119. headerParams,
  120. formParams,
  121. contentTypes.isEmpty ? null : contentTypes.first,
  122. );
  123. }
  124. /// Parameters:
  125. ///
  126. /// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
  127. Future<void> deleteAssets(AssetBulkDeleteDto assetBulkDeleteDto,) async {
  128. final response = await deleteAssetsWithHttpInfo(assetBulkDeleteDto,);
  129. if (response.statusCode >= HttpStatus.badRequest) {
  130. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  131. }
  132. }
  133. /// Performs an HTTP 'POST /asset/download/archive' operation and returns the [Response].
  134. /// Parameters:
  135. ///
  136. /// * [AssetIdsDto] assetIdsDto (required):
  137. ///
  138. /// * [String] key:
  139. Future<Response> downloadArchiveWithHttpInfo(AssetIdsDto assetIdsDto, { String? key, }) async {
  140. // ignore: prefer_const_declarations
  141. final path = r'/asset/download/archive';
  142. // ignore: prefer_final_locals
  143. Object? postBody = assetIdsDto;
  144. final queryParams = <QueryParam>[];
  145. final headerParams = <String, String>{};
  146. final formParams = <String, String>{};
  147. if (key != null) {
  148. queryParams.addAll(_queryParams('', 'key', key));
  149. }
  150. const contentTypes = <String>['application/json'];
  151. return apiClient.invokeAPI(
  152. path,
  153. 'POST',
  154. queryParams,
  155. postBody,
  156. headerParams,
  157. formParams,
  158. contentTypes.isEmpty ? null : contentTypes.first,
  159. );
  160. }
  161. /// Parameters:
  162. ///
  163. /// * [AssetIdsDto] assetIdsDto (required):
  164. ///
  165. /// * [String] key:
  166. Future<MultipartFile?> downloadArchive(AssetIdsDto assetIdsDto, { String? key, }) async {
  167. final response = await downloadArchiveWithHttpInfo(assetIdsDto, key: key, );
  168. if (response.statusCode >= HttpStatus.badRequest) {
  169. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  170. }
  171. // When a remote server returns no body with a status of 204, we shall not decode it.
  172. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  173. // FormatException when trying to decode an empty string.
  174. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  175. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  176. }
  177. return null;
  178. }
  179. /// Performs an HTTP 'POST /asset/download/{id}' operation and returns the [Response].
  180. /// Parameters:
  181. ///
  182. /// * [String] id (required):
  183. ///
  184. /// * [String] key:
  185. Future<Response> downloadFileWithHttpInfo(String id, { String? key, }) async {
  186. // ignore: prefer_const_declarations
  187. final path = r'/asset/download/{id}'
  188. .replaceAll('{id}', id);
  189. // ignore: prefer_final_locals
  190. Object? postBody;
  191. final queryParams = <QueryParam>[];
  192. final headerParams = <String, String>{};
  193. final formParams = <String, String>{};
  194. if (key != null) {
  195. queryParams.addAll(_queryParams('', 'key', key));
  196. }
  197. const contentTypes = <String>[];
  198. return apiClient.invokeAPI(
  199. path,
  200. 'POST',
  201. queryParams,
  202. postBody,
  203. headerParams,
  204. formParams,
  205. contentTypes.isEmpty ? null : contentTypes.first,
  206. );
  207. }
  208. /// Parameters:
  209. ///
  210. /// * [String] id (required):
  211. ///
  212. /// * [String] key:
  213. Future<MultipartFile?> downloadFile(String id, { String? key, }) async {
  214. final response = await downloadFileWithHttpInfo(id, key: key, );
  215. if (response.statusCode >= HttpStatus.badRequest) {
  216. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  217. }
  218. // When a remote server returns no body with a status of 204, we shall not decode it.
  219. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  220. // FormatException when trying to decode an empty string.
  221. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  222. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  223. }
  224. return null;
  225. }
  226. /// Performs an HTTP 'POST /asset/trash/empty' operation and returns the [Response].
  227. Future<Response> emptyTrashWithHttpInfo() async {
  228. // ignore: prefer_const_declarations
  229. final path = r'/asset/trash/empty';
  230. // ignore: prefer_final_locals
  231. Object? postBody;
  232. final queryParams = <QueryParam>[];
  233. final headerParams = <String, String>{};
  234. final formParams = <String, String>{};
  235. const contentTypes = <String>[];
  236. return apiClient.invokeAPI(
  237. path,
  238. 'POST',
  239. queryParams,
  240. postBody,
  241. headerParams,
  242. formParams,
  243. contentTypes.isEmpty ? null : contentTypes.first,
  244. );
  245. }
  246. Future<void> emptyTrash() async {
  247. final response = await emptyTrashWithHttpInfo();
  248. if (response.statusCode >= HttpStatus.badRequest) {
  249. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  250. }
  251. }
  252. /// Get all AssetEntity belong to the user
  253. ///
  254. /// Note: This method returns the HTTP [Response].
  255. ///
  256. /// Parameters:
  257. ///
  258. /// * [String] userId:
  259. ///
  260. /// * [bool] isFavorite:
  261. ///
  262. /// * [bool] isArchived:
  263. ///
  264. /// * [num] skip:
  265. ///
  266. /// * [DateTime] updatedAfter:
  267. ///
  268. /// * [String] ifNoneMatch:
  269. /// ETag of data already cached on the client
  270. Future<Response> getAllAssetsWithHttpInfo({ String? userId, bool? isFavorite, bool? isArchived, num? skip, DateTime? updatedAfter, String? ifNoneMatch, }) async {
  271. // ignore: prefer_const_declarations
  272. final path = r'/asset';
  273. // ignore: prefer_final_locals
  274. Object? postBody;
  275. final queryParams = <QueryParam>[];
  276. final headerParams = <String, String>{};
  277. final formParams = <String, String>{};
  278. if (userId != null) {
  279. queryParams.addAll(_queryParams('', 'userId', userId));
  280. }
  281. if (isFavorite != null) {
  282. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  283. }
  284. if (isArchived != null) {
  285. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  286. }
  287. if (skip != null) {
  288. queryParams.addAll(_queryParams('', 'skip', skip));
  289. }
  290. if (updatedAfter != null) {
  291. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  292. }
  293. if (ifNoneMatch != null) {
  294. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  295. }
  296. const contentTypes = <String>[];
  297. return apiClient.invokeAPI(
  298. path,
  299. 'GET',
  300. queryParams,
  301. postBody,
  302. headerParams,
  303. formParams,
  304. contentTypes.isEmpty ? null : contentTypes.first,
  305. );
  306. }
  307. /// Get all AssetEntity belong to the user
  308. ///
  309. /// Parameters:
  310. ///
  311. /// * [String] userId:
  312. ///
  313. /// * [bool] isFavorite:
  314. ///
  315. /// * [bool] isArchived:
  316. ///
  317. /// * [num] skip:
  318. ///
  319. /// * [DateTime] updatedAfter:
  320. ///
  321. /// * [String] ifNoneMatch:
  322. /// ETag of data already cached on the client
  323. Future<List<AssetResponseDto>?> getAllAssets({ String? userId, bool? isFavorite, bool? isArchived, num? skip, DateTime? updatedAfter, String? ifNoneMatch, }) async {
  324. final response = await getAllAssetsWithHttpInfo( userId: userId, isFavorite: isFavorite, isArchived: isArchived, skip: skip, updatedAfter: updatedAfter, ifNoneMatch: ifNoneMatch, );
  325. if (response.statusCode >= HttpStatus.badRequest) {
  326. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  327. }
  328. // When a remote server returns no body with a status of 204, we shall not decode it.
  329. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  330. // FormatException when trying to decode an empty string.
  331. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  332. final responseBody = await _decodeBodyBytes(response);
  333. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  334. .cast<AssetResponseDto>()
  335. .toList();
  336. }
  337. return null;
  338. }
  339. /// Get a single asset's information
  340. ///
  341. /// Note: This method returns the HTTP [Response].
  342. ///
  343. /// Parameters:
  344. ///
  345. /// * [String] id (required):
  346. ///
  347. /// * [String] key:
  348. Future<Response> getAssetByIdWithHttpInfo(String id, { String? key, }) async {
  349. // ignore: prefer_const_declarations
  350. final path = r'/asset/assetById/{id}'
  351. .replaceAll('{id}', id);
  352. // ignore: prefer_final_locals
  353. Object? postBody;
  354. final queryParams = <QueryParam>[];
  355. final headerParams = <String, String>{};
  356. final formParams = <String, String>{};
  357. if (key != null) {
  358. queryParams.addAll(_queryParams('', 'key', key));
  359. }
  360. const contentTypes = <String>[];
  361. return apiClient.invokeAPI(
  362. path,
  363. 'GET',
  364. queryParams,
  365. postBody,
  366. headerParams,
  367. formParams,
  368. contentTypes.isEmpty ? null : contentTypes.first,
  369. );
  370. }
  371. /// Get a single asset's information
  372. ///
  373. /// Parameters:
  374. ///
  375. /// * [String] id (required):
  376. ///
  377. /// * [String] key:
  378. Future<AssetResponseDto?> getAssetById(String id, { String? key, }) async {
  379. final response = await getAssetByIdWithHttpInfo(id, key: key, );
  380. if (response.statusCode >= HttpStatus.badRequest) {
  381. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  382. }
  383. // When a remote server returns no body with a status of 204, we shall not decode it.
  384. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  385. // FormatException when trying to decode an empty string.
  386. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  387. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  388. }
  389. return null;
  390. }
  391. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  392. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  393. // ignore: prefer_const_declarations
  394. final path = r'/asset/search-terms';
  395. // ignore: prefer_final_locals
  396. Object? postBody;
  397. final queryParams = <QueryParam>[];
  398. final headerParams = <String, String>{};
  399. final formParams = <String, String>{};
  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. Future<List<String>?> getAssetSearchTerms() async {
  412. final response = await getAssetSearchTermsWithHttpInfo();
  413. if (response.statusCode >= HttpStatus.badRequest) {
  414. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  415. }
  416. // When a remote server returns no body with a status of 204, we shall not decode it.
  417. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  418. // FormatException when trying to decode an empty string.
  419. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  420. final responseBody = await _decodeBodyBytes(response);
  421. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  422. .cast<String>()
  423. .toList();
  424. }
  425. return null;
  426. }
  427. /// Performs an HTTP 'GET /asset/statistics' operation and returns the [Response].
  428. /// Parameters:
  429. ///
  430. /// * [bool] isArchived:
  431. ///
  432. /// * [bool] isFavorite:
  433. ///
  434. /// * [bool] isTrashed:
  435. Future<Response> getAssetStatsWithHttpInfo({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
  436. // ignore: prefer_const_declarations
  437. final path = r'/asset/statistics';
  438. // ignore: prefer_final_locals
  439. Object? postBody;
  440. final queryParams = <QueryParam>[];
  441. final headerParams = <String, String>{};
  442. final formParams = <String, String>{};
  443. if (isArchived != null) {
  444. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  445. }
  446. if (isFavorite != null) {
  447. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  448. }
  449. if (isTrashed != null) {
  450. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  451. }
  452. const contentTypes = <String>[];
  453. return apiClient.invokeAPI(
  454. path,
  455. 'GET',
  456. queryParams,
  457. postBody,
  458. headerParams,
  459. formParams,
  460. contentTypes.isEmpty ? null : contentTypes.first,
  461. );
  462. }
  463. /// Parameters:
  464. ///
  465. /// * [bool] isArchived:
  466. ///
  467. /// * [bool] isFavorite:
  468. ///
  469. /// * [bool] isTrashed:
  470. Future<AssetStatsResponseDto?> getAssetStats({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
  471. final response = await getAssetStatsWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, );
  472. if (response.statusCode >= HttpStatus.badRequest) {
  473. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  474. }
  475. // When a remote server returns no body with a status of 204, we shall not decode it.
  476. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  477. // FormatException when trying to decode an empty string.
  478. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  479. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
  480. }
  481. return null;
  482. }
  483. /// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
  484. /// Parameters:
  485. ///
  486. /// * [String] id (required):
  487. ///
  488. /// * [ThumbnailFormat] format:
  489. ///
  490. /// * [String] key:
  491. Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
  492. // ignore: prefer_const_declarations
  493. final path = r'/asset/thumbnail/{id}'
  494. .replaceAll('{id}', id);
  495. // ignore: prefer_final_locals
  496. Object? postBody;
  497. final queryParams = <QueryParam>[];
  498. final headerParams = <String, String>{};
  499. final formParams = <String, String>{};
  500. if (format != null) {
  501. queryParams.addAll(_queryParams('', 'format', format));
  502. }
  503. if (key != null) {
  504. queryParams.addAll(_queryParams('', 'key', key));
  505. }
  506. const contentTypes = <String>[];
  507. return apiClient.invokeAPI(
  508. path,
  509. 'GET',
  510. queryParams,
  511. postBody,
  512. headerParams,
  513. formParams,
  514. contentTypes.isEmpty ? null : contentTypes.first,
  515. );
  516. }
  517. /// Parameters:
  518. ///
  519. /// * [String] id (required):
  520. ///
  521. /// * [ThumbnailFormat] format:
  522. ///
  523. /// * [String] key:
  524. Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
  525. final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
  526. if (response.statusCode >= HttpStatus.badRequest) {
  527. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  528. }
  529. // When a remote server returns no body with a status of 204, we shall not decode it.
  530. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  531. // FormatException when trying to decode an empty string.
  532. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  533. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  534. }
  535. return null;
  536. }
  537. /// Performs an HTTP 'GET /asset/time-bucket' operation and returns the [Response].
  538. /// Parameters:
  539. ///
  540. /// * [TimeBucketSize] size (required):
  541. ///
  542. /// * [String] timeBucket (required):
  543. ///
  544. /// * [String] userId:
  545. ///
  546. /// * [String] albumId:
  547. ///
  548. /// * [String] personId:
  549. ///
  550. /// * [bool] isArchived:
  551. ///
  552. /// * [bool] isFavorite:
  553. ///
  554. /// * [bool] isTrashed:
  555. ///
  556. /// * [String] key:
  557. Future<Response> getByTimeBucketWithHttpInfo(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, }) async {
  558. // ignore: prefer_const_declarations
  559. final path = r'/asset/time-bucket';
  560. // ignore: prefer_final_locals
  561. Object? postBody;
  562. final queryParams = <QueryParam>[];
  563. final headerParams = <String, String>{};
  564. final formParams = <String, String>{};
  565. queryParams.addAll(_queryParams('', 'size', size));
  566. if (userId != null) {
  567. queryParams.addAll(_queryParams('', 'userId', userId));
  568. }
  569. if (albumId != null) {
  570. queryParams.addAll(_queryParams('', 'albumId', albumId));
  571. }
  572. if (personId != null) {
  573. queryParams.addAll(_queryParams('', 'personId', personId));
  574. }
  575. if (isArchived != null) {
  576. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  577. }
  578. if (isFavorite != null) {
  579. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  580. }
  581. if (isTrashed != null) {
  582. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  583. }
  584. queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
  585. if (key != null) {
  586. queryParams.addAll(_queryParams('', 'key', key));
  587. }
  588. const contentTypes = <String>[];
  589. return apiClient.invokeAPI(
  590. path,
  591. 'GET',
  592. queryParams,
  593. postBody,
  594. headerParams,
  595. formParams,
  596. contentTypes.isEmpty ? null : contentTypes.first,
  597. );
  598. }
  599. /// Parameters:
  600. ///
  601. /// * [TimeBucketSize] size (required):
  602. ///
  603. /// * [String] timeBucket (required):
  604. ///
  605. /// * [String] userId:
  606. ///
  607. /// * [String] albumId:
  608. ///
  609. /// * [String] personId:
  610. ///
  611. /// * [bool] isArchived:
  612. ///
  613. /// * [bool] isFavorite:
  614. ///
  615. /// * [bool] isTrashed:
  616. ///
  617. /// * [String] key:
  618. Future<List<AssetResponseDto>?> getByTimeBucket(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, }) async {
  619. final response = await getByTimeBucketWithHttpInfo(size, timeBucket, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, key: key, );
  620. if (response.statusCode >= HttpStatus.badRequest) {
  621. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  622. }
  623. // When a remote server returns no body with a status of 204, we shall not decode it.
  624. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  625. // FormatException when trying to decode an empty string.
  626. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  627. final responseBody = await _decodeBodyBytes(response);
  628. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  629. .cast<AssetResponseDto>()
  630. .toList();
  631. }
  632. return null;
  633. }
  634. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  635. Future<Response> getCuratedLocationsWithHttpInfo() async {
  636. // ignore: prefer_const_declarations
  637. final path = r'/asset/curated-locations';
  638. // ignore: prefer_final_locals
  639. Object? postBody;
  640. final queryParams = <QueryParam>[];
  641. final headerParams = <String, String>{};
  642. final formParams = <String, String>{};
  643. const contentTypes = <String>[];
  644. return apiClient.invokeAPI(
  645. path,
  646. 'GET',
  647. queryParams,
  648. postBody,
  649. headerParams,
  650. formParams,
  651. contentTypes.isEmpty ? null : contentTypes.first,
  652. );
  653. }
  654. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  655. final response = await getCuratedLocationsWithHttpInfo();
  656. if (response.statusCode >= HttpStatus.badRequest) {
  657. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  658. }
  659. // When a remote server returns no body with a status of 204, we shall not decode it.
  660. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  661. // FormatException when trying to decode an empty string.
  662. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  663. final responseBody = await _decodeBodyBytes(response);
  664. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  665. .cast<CuratedLocationsResponseDto>()
  666. .toList();
  667. }
  668. return null;
  669. }
  670. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  671. Future<Response> getCuratedObjectsWithHttpInfo() async {
  672. // ignore: prefer_const_declarations
  673. final path = r'/asset/curated-objects';
  674. // ignore: prefer_final_locals
  675. Object? postBody;
  676. final queryParams = <QueryParam>[];
  677. final headerParams = <String, String>{};
  678. final formParams = <String, String>{};
  679. const contentTypes = <String>[];
  680. return apiClient.invokeAPI(
  681. path,
  682. 'GET',
  683. queryParams,
  684. postBody,
  685. headerParams,
  686. formParams,
  687. contentTypes.isEmpty ? null : contentTypes.first,
  688. );
  689. }
  690. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  691. final response = await getCuratedObjectsWithHttpInfo();
  692. if (response.statusCode >= HttpStatus.badRequest) {
  693. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  694. }
  695. // When a remote server returns no body with a status of 204, we shall not decode it.
  696. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  697. // FormatException when trying to decode an empty string.
  698. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  699. final responseBody = await _decodeBodyBytes(response);
  700. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  701. .cast<CuratedObjectsResponseDto>()
  702. .toList();
  703. }
  704. return null;
  705. }
  706. /// Performs an HTTP 'POST /asset/download/info' operation and returns the [Response].
  707. /// Parameters:
  708. ///
  709. /// * [DownloadInfoDto] downloadInfoDto (required):
  710. ///
  711. /// * [String] key:
  712. Future<Response> getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  713. // ignore: prefer_const_declarations
  714. final path = r'/asset/download/info';
  715. // ignore: prefer_final_locals
  716. Object? postBody = downloadInfoDto;
  717. final queryParams = <QueryParam>[];
  718. final headerParams = <String, String>{};
  719. final formParams = <String, String>{};
  720. if (key != null) {
  721. queryParams.addAll(_queryParams('', 'key', key));
  722. }
  723. const contentTypes = <String>['application/json'];
  724. return apiClient.invokeAPI(
  725. path,
  726. 'POST',
  727. queryParams,
  728. postBody,
  729. headerParams,
  730. formParams,
  731. contentTypes.isEmpty ? null : contentTypes.first,
  732. );
  733. }
  734. /// Parameters:
  735. ///
  736. /// * [DownloadInfoDto] downloadInfoDto (required):
  737. ///
  738. /// * [String] key:
  739. Future<DownloadResponseDto?> getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  740. final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, );
  741. if (response.statusCode >= HttpStatus.badRequest) {
  742. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  743. }
  744. // When a remote server returns no body with a status of 204, we shall not decode it.
  745. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  746. // FormatException when trying to decode an empty string.
  747. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  748. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DownloadResponseDto',) as DownloadResponseDto;
  749. }
  750. return null;
  751. }
  752. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  753. /// Parameters:
  754. ///
  755. /// * [bool] isArchived:
  756. ///
  757. /// * [bool] isFavorite:
  758. ///
  759. /// * [DateTime] fileCreatedAfter:
  760. ///
  761. /// * [DateTime] fileCreatedBefore:
  762. Future<Response> getMapMarkersWithHttpInfo({ bool? isArchived, bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  763. // ignore: prefer_const_declarations
  764. final path = r'/asset/map-marker';
  765. // ignore: prefer_final_locals
  766. Object? postBody;
  767. final queryParams = <QueryParam>[];
  768. final headerParams = <String, String>{};
  769. final formParams = <String, String>{};
  770. if (isArchived != null) {
  771. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  772. }
  773. if (isFavorite != null) {
  774. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  775. }
  776. if (fileCreatedAfter != null) {
  777. queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
  778. }
  779. if (fileCreatedBefore != null) {
  780. queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
  781. }
  782. const contentTypes = <String>[];
  783. return apiClient.invokeAPI(
  784. path,
  785. 'GET',
  786. queryParams,
  787. postBody,
  788. headerParams,
  789. formParams,
  790. contentTypes.isEmpty ? null : contentTypes.first,
  791. );
  792. }
  793. /// Parameters:
  794. ///
  795. /// * [bool] isArchived:
  796. ///
  797. /// * [bool] isFavorite:
  798. ///
  799. /// * [DateTime] fileCreatedAfter:
  800. ///
  801. /// * [DateTime] fileCreatedBefore:
  802. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isArchived, bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  803. final response = await getMapMarkersWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, );
  804. if (response.statusCode >= HttpStatus.badRequest) {
  805. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  806. }
  807. // When a remote server returns no body with a status of 204, we shall not decode it.
  808. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  809. // FormatException when trying to decode an empty string.
  810. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  811. final responseBody = await _decodeBodyBytes(response);
  812. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  813. .cast<MapMarkerResponseDto>()
  814. .toList();
  815. }
  816. return null;
  817. }
  818. /// Performs an HTTP 'GET /asset/memory-lane' operation and returns the [Response].
  819. /// Parameters:
  820. ///
  821. /// * [int] day (required):
  822. ///
  823. /// * [int] month (required):
  824. Future<Response> getMemoryLaneWithHttpInfo(int day, int month,) async {
  825. // ignore: prefer_const_declarations
  826. final path = r'/asset/memory-lane';
  827. // ignore: prefer_final_locals
  828. Object? postBody;
  829. final queryParams = <QueryParam>[];
  830. final headerParams = <String, String>{};
  831. final formParams = <String, String>{};
  832. queryParams.addAll(_queryParams('', 'day', day));
  833. queryParams.addAll(_queryParams('', 'month', month));
  834. const contentTypes = <String>[];
  835. return apiClient.invokeAPI(
  836. path,
  837. 'GET',
  838. queryParams,
  839. postBody,
  840. headerParams,
  841. formParams,
  842. contentTypes.isEmpty ? null : contentTypes.first,
  843. );
  844. }
  845. /// Parameters:
  846. ///
  847. /// * [int] day (required):
  848. ///
  849. /// * [int] month (required):
  850. Future<List<MemoryLaneResponseDto>?> getMemoryLane(int day, int month,) async {
  851. final response = await getMemoryLaneWithHttpInfo(day, month,);
  852. if (response.statusCode >= HttpStatus.badRequest) {
  853. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  854. }
  855. // When a remote server returns no body with a status of 204, we shall not decode it.
  856. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  857. // FormatException when trying to decode an empty string.
  858. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  859. final responseBody = await _decodeBodyBytes(response);
  860. return (await apiClient.deserializeAsync(responseBody, 'List<MemoryLaneResponseDto>') as List)
  861. .cast<MemoryLaneResponseDto>()
  862. .toList();
  863. }
  864. return null;
  865. }
  866. /// Performs an HTTP 'GET /asset/random' operation and returns the [Response].
  867. /// Parameters:
  868. ///
  869. /// * [num] count:
  870. Future<Response> getRandomWithHttpInfo({ num? count, }) async {
  871. // ignore: prefer_const_declarations
  872. final path = r'/asset/random';
  873. // ignore: prefer_final_locals
  874. Object? postBody;
  875. final queryParams = <QueryParam>[];
  876. final headerParams = <String, String>{};
  877. final formParams = <String, String>{};
  878. if (count != null) {
  879. queryParams.addAll(_queryParams('', 'count', count));
  880. }
  881. const contentTypes = <String>[];
  882. return apiClient.invokeAPI(
  883. path,
  884. 'GET',
  885. queryParams,
  886. postBody,
  887. headerParams,
  888. formParams,
  889. contentTypes.isEmpty ? null : contentTypes.first,
  890. );
  891. }
  892. /// Parameters:
  893. ///
  894. /// * [num] count:
  895. Future<List<AssetResponseDto>?> getRandom({ num? count, }) async {
  896. final response = await getRandomWithHttpInfo( count: count, );
  897. if (response.statusCode >= HttpStatus.badRequest) {
  898. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  899. }
  900. // When a remote server returns no body with a status of 204, we shall not decode it.
  901. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  902. // FormatException when trying to decode an empty string.
  903. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  904. final responseBody = await _decodeBodyBytes(response);
  905. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  906. .cast<AssetResponseDto>()
  907. .toList();
  908. }
  909. return null;
  910. }
  911. /// Performs an HTTP 'GET /asset/time-buckets' operation and returns the [Response].
  912. /// Parameters:
  913. ///
  914. /// * [TimeBucketSize] size (required):
  915. ///
  916. /// * [String] userId:
  917. ///
  918. /// * [String] albumId:
  919. ///
  920. /// * [String] personId:
  921. ///
  922. /// * [bool] isArchived:
  923. ///
  924. /// * [bool] isFavorite:
  925. ///
  926. /// * [bool] isTrashed:
  927. ///
  928. /// * [String] key:
  929. Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, }) async {
  930. // ignore: prefer_const_declarations
  931. final path = r'/asset/time-buckets';
  932. // ignore: prefer_final_locals
  933. Object? postBody;
  934. final queryParams = <QueryParam>[];
  935. final headerParams = <String, String>{};
  936. final formParams = <String, String>{};
  937. queryParams.addAll(_queryParams('', 'size', size));
  938. if (userId != null) {
  939. queryParams.addAll(_queryParams('', 'userId', userId));
  940. }
  941. if (albumId != null) {
  942. queryParams.addAll(_queryParams('', 'albumId', albumId));
  943. }
  944. if (personId != null) {
  945. queryParams.addAll(_queryParams('', 'personId', personId));
  946. }
  947. if (isArchived != null) {
  948. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  949. }
  950. if (isFavorite != null) {
  951. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  952. }
  953. if (isTrashed != null) {
  954. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  955. }
  956. if (key != null) {
  957. queryParams.addAll(_queryParams('', 'key', key));
  958. }
  959. const contentTypes = <String>[];
  960. return apiClient.invokeAPI(
  961. path,
  962. 'GET',
  963. queryParams,
  964. postBody,
  965. headerParams,
  966. formParams,
  967. contentTypes.isEmpty ? null : contentTypes.first,
  968. );
  969. }
  970. /// Parameters:
  971. ///
  972. /// * [TimeBucketSize] size (required):
  973. ///
  974. /// * [String] userId:
  975. ///
  976. /// * [String] albumId:
  977. ///
  978. /// * [String] personId:
  979. ///
  980. /// * [bool] isArchived:
  981. ///
  982. /// * [bool] isFavorite:
  983. ///
  984. /// * [bool] isTrashed:
  985. ///
  986. /// * [String] key:
  987. Future<List<TimeBucketResponseDto>?> getTimeBuckets(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, String? key, }) async {
  988. final response = await getTimeBucketsWithHttpInfo(size, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, key: key, );
  989. if (response.statusCode >= HttpStatus.badRequest) {
  990. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  991. }
  992. // When a remote server returns no body with a status of 204, we shall not decode it.
  993. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  994. // FormatException when trying to decode an empty string.
  995. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  996. final responseBody = await _decodeBodyBytes(response);
  997. return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketResponseDto>') as List)
  998. .cast<TimeBucketResponseDto>()
  999. .toList();
  1000. }
  1001. return null;
  1002. }
  1003. /// Get all asset of a device that are in the database, ID only.
  1004. ///
  1005. /// Note: This method returns the HTTP [Response].
  1006. ///
  1007. /// Parameters:
  1008. ///
  1009. /// * [String] deviceId (required):
  1010. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  1011. // ignore: prefer_const_declarations
  1012. final path = r'/asset/{deviceId}'
  1013. .replaceAll('{deviceId}', deviceId);
  1014. // ignore: prefer_final_locals
  1015. Object? postBody;
  1016. final queryParams = <QueryParam>[];
  1017. final headerParams = <String, String>{};
  1018. final formParams = <String, String>{};
  1019. const contentTypes = <String>[];
  1020. return apiClient.invokeAPI(
  1021. path,
  1022. 'GET',
  1023. queryParams,
  1024. postBody,
  1025. headerParams,
  1026. formParams,
  1027. contentTypes.isEmpty ? null : contentTypes.first,
  1028. );
  1029. }
  1030. /// Get all asset of a device that are in the database, ID only.
  1031. ///
  1032. /// Parameters:
  1033. ///
  1034. /// * [String] deviceId (required):
  1035. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  1036. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  1037. if (response.statusCode >= HttpStatus.badRequest) {
  1038. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1039. }
  1040. // When a remote server returns no body with a status of 204, we shall not decode it.
  1041. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1042. // FormatException when trying to decode an empty string.
  1043. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1044. final responseBody = await _decodeBodyBytes(response);
  1045. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  1046. .cast<String>()
  1047. .toList();
  1048. }
  1049. return null;
  1050. }
  1051. /// Performs an HTTP 'POST /asset/import' operation and returns the [Response].
  1052. /// Parameters:
  1053. ///
  1054. /// * [ImportAssetDto] importAssetDto (required):
  1055. Future<Response> importFileWithHttpInfo(ImportAssetDto importAssetDto,) async {
  1056. // ignore: prefer_const_declarations
  1057. final path = r'/asset/import';
  1058. // ignore: prefer_final_locals
  1059. Object? postBody = importAssetDto;
  1060. final queryParams = <QueryParam>[];
  1061. final headerParams = <String, String>{};
  1062. final formParams = <String, String>{};
  1063. const contentTypes = <String>['application/json'];
  1064. return apiClient.invokeAPI(
  1065. path,
  1066. 'POST',
  1067. queryParams,
  1068. postBody,
  1069. headerParams,
  1070. formParams,
  1071. contentTypes.isEmpty ? null : contentTypes.first,
  1072. );
  1073. }
  1074. /// Parameters:
  1075. ///
  1076. /// * [ImportAssetDto] importAssetDto (required):
  1077. Future<AssetFileUploadResponseDto?> importFile(ImportAssetDto importAssetDto,) async {
  1078. final response = await importFileWithHttpInfo(importAssetDto,);
  1079. if (response.statusCode >= HttpStatus.badRequest) {
  1080. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1081. }
  1082. // When a remote server returns no body with a status of 204, we shall not decode it.
  1083. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1084. // FormatException when trying to decode an empty string.
  1085. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1086. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1087. }
  1088. return null;
  1089. }
  1090. /// Performs an HTTP 'POST /asset/restore' operation and returns the [Response].
  1091. /// Parameters:
  1092. ///
  1093. /// * [BulkIdsDto] bulkIdsDto (required):
  1094. Future<Response> restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
  1095. // ignore: prefer_const_declarations
  1096. final path = r'/asset/restore';
  1097. // ignore: prefer_final_locals
  1098. Object? postBody = bulkIdsDto;
  1099. final queryParams = <QueryParam>[];
  1100. final headerParams = <String, String>{};
  1101. final formParams = <String, String>{};
  1102. const contentTypes = <String>['application/json'];
  1103. return apiClient.invokeAPI(
  1104. path,
  1105. 'POST',
  1106. queryParams,
  1107. postBody,
  1108. headerParams,
  1109. formParams,
  1110. contentTypes.isEmpty ? null : contentTypes.first,
  1111. );
  1112. }
  1113. /// Parameters:
  1114. ///
  1115. /// * [BulkIdsDto] bulkIdsDto (required):
  1116. Future<void> restoreAssets(BulkIdsDto bulkIdsDto,) async {
  1117. final response = await restoreAssetsWithHttpInfo(bulkIdsDto,);
  1118. if (response.statusCode >= HttpStatus.badRequest) {
  1119. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1120. }
  1121. }
  1122. /// Performs an HTTP 'POST /asset/trash/restore' operation and returns the [Response].
  1123. Future<Response> restoreTrashWithHttpInfo() async {
  1124. // ignore: prefer_const_declarations
  1125. final path = r'/asset/trash/restore';
  1126. // ignore: prefer_final_locals
  1127. Object? postBody;
  1128. final queryParams = <QueryParam>[];
  1129. final headerParams = <String, String>{};
  1130. final formParams = <String, String>{};
  1131. const contentTypes = <String>[];
  1132. return apiClient.invokeAPI(
  1133. path,
  1134. 'POST',
  1135. queryParams,
  1136. postBody,
  1137. headerParams,
  1138. formParams,
  1139. contentTypes.isEmpty ? null : contentTypes.first,
  1140. );
  1141. }
  1142. Future<void> restoreTrash() async {
  1143. final response = await restoreTrashWithHttpInfo();
  1144. if (response.statusCode >= HttpStatus.badRequest) {
  1145. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1146. }
  1147. }
  1148. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1149. /// Parameters:
  1150. ///
  1151. /// * [AssetJobsDto] assetJobsDto (required):
  1152. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1153. // ignore: prefer_const_declarations
  1154. final path = r'/asset/jobs';
  1155. // ignore: prefer_final_locals
  1156. Object? postBody = assetJobsDto;
  1157. final queryParams = <QueryParam>[];
  1158. final headerParams = <String, String>{};
  1159. final formParams = <String, String>{};
  1160. const contentTypes = <String>['application/json'];
  1161. return apiClient.invokeAPI(
  1162. path,
  1163. 'POST',
  1164. queryParams,
  1165. postBody,
  1166. headerParams,
  1167. formParams,
  1168. contentTypes.isEmpty ? null : contentTypes.first,
  1169. );
  1170. }
  1171. /// Parameters:
  1172. ///
  1173. /// * [AssetJobsDto] assetJobsDto (required):
  1174. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1175. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1176. if (response.statusCode >= HttpStatus.badRequest) {
  1177. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1178. }
  1179. }
  1180. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  1181. /// Parameters:
  1182. ///
  1183. /// * [SearchAssetDto] searchAssetDto (required):
  1184. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1185. // ignore: prefer_const_declarations
  1186. final path = r'/asset/search';
  1187. // ignore: prefer_final_locals
  1188. Object? postBody = searchAssetDto;
  1189. final queryParams = <QueryParam>[];
  1190. final headerParams = <String, String>{};
  1191. final formParams = <String, String>{};
  1192. const contentTypes = <String>['application/json'];
  1193. return apiClient.invokeAPI(
  1194. path,
  1195. 'POST',
  1196. queryParams,
  1197. postBody,
  1198. headerParams,
  1199. formParams,
  1200. contentTypes.isEmpty ? null : contentTypes.first,
  1201. );
  1202. }
  1203. /// Parameters:
  1204. ///
  1205. /// * [SearchAssetDto] searchAssetDto (required):
  1206. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1207. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1208. if (response.statusCode >= HttpStatus.badRequest) {
  1209. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1210. }
  1211. // When a remote server returns no body with a status of 204, we shall not decode it.
  1212. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1213. // FormatException when trying to decode an empty string.
  1214. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1215. final responseBody = await _decodeBodyBytes(response);
  1216. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1217. .cast<AssetResponseDto>()
  1218. .toList();
  1219. }
  1220. return null;
  1221. }
  1222. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1223. /// Parameters:
  1224. ///
  1225. /// * [String] id (required):
  1226. ///
  1227. /// * [bool] isThumb:
  1228. ///
  1229. /// * [bool] isWeb:
  1230. ///
  1231. /// * [String] key:
  1232. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1233. // ignore: prefer_const_declarations
  1234. final path = r'/asset/file/{id}'
  1235. .replaceAll('{id}', id);
  1236. // ignore: prefer_final_locals
  1237. Object? postBody;
  1238. final queryParams = <QueryParam>[];
  1239. final headerParams = <String, String>{};
  1240. final formParams = <String, String>{};
  1241. if (isThumb != null) {
  1242. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1243. }
  1244. if (isWeb != null) {
  1245. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1246. }
  1247. if (key != null) {
  1248. queryParams.addAll(_queryParams('', 'key', key));
  1249. }
  1250. const contentTypes = <String>[];
  1251. return apiClient.invokeAPI(
  1252. path,
  1253. 'GET',
  1254. queryParams,
  1255. postBody,
  1256. headerParams,
  1257. formParams,
  1258. contentTypes.isEmpty ? null : contentTypes.first,
  1259. );
  1260. }
  1261. /// Parameters:
  1262. ///
  1263. /// * [String] id (required):
  1264. ///
  1265. /// * [bool] isThumb:
  1266. ///
  1267. /// * [bool] isWeb:
  1268. ///
  1269. /// * [String] key:
  1270. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1271. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1272. if (response.statusCode >= HttpStatus.badRequest) {
  1273. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1274. }
  1275. // When a remote server returns no body with a status of 204, we shall not decode it.
  1276. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1277. // FormatException when trying to decode an empty string.
  1278. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1279. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1280. }
  1281. return null;
  1282. }
  1283. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1284. /// Parameters:
  1285. ///
  1286. /// * [String] id (required):
  1287. ///
  1288. /// * [UpdateAssetDto] updateAssetDto (required):
  1289. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1290. // ignore: prefer_const_declarations
  1291. final path = r'/asset/{id}'
  1292. .replaceAll('{id}', id);
  1293. // ignore: prefer_final_locals
  1294. Object? postBody = updateAssetDto;
  1295. final queryParams = <QueryParam>[];
  1296. final headerParams = <String, String>{};
  1297. final formParams = <String, String>{};
  1298. const contentTypes = <String>['application/json'];
  1299. return apiClient.invokeAPI(
  1300. path,
  1301. 'PUT',
  1302. queryParams,
  1303. postBody,
  1304. headerParams,
  1305. formParams,
  1306. contentTypes.isEmpty ? null : contentTypes.first,
  1307. );
  1308. }
  1309. /// Parameters:
  1310. ///
  1311. /// * [String] id (required):
  1312. ///
  1313. /// * [UpdateAssetDto] updateAssetDto (required):
  1314. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1315. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1316. if (response.statusCode >= HttpStatus.badRequest) {
  1317. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1318. }
  1319. // When a remote server returns no body with a status of 204, we shall not decode it.
  1320. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1321. // FormatException when trying to decode an empty string.
  1322. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1323. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1324. }
  1325. return null;
  1326. }
  1327. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1328. /// Parameters:
  1329. ///
  1330. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1331. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1332. // ignore: prefer_const_declarations
  1333. final path = r'/asset';
  1334. // ignore: prefer_final_locals
  1335. Object? postBody = assetBulkUpdateDto;
  1336. final queryParams = <QueryParam>[];
  1337. final headerParams = <String, String>{};
  1338. final formParams = <String, String>{};
  1339. const contentTypes = <String>['application/json'];
  1340. return apiClient.invokeAPI(
  1341. path,
  1342. 'PUT',
  1343. queryParams,
  1344. postBody,
  1345. headerParams,
  1346. formParams,
  1347. contentTypes.isEmpty ? null : contentTypes.first,
  1348. );
  1349. }
  1350. /// Parameters:
  1351. ///
  1352. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1353. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1354. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1355. if (response.statusCode >= HttpStatus.badRequest) {
  1356. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1357. }
  1358. }
  1359. /// Performs an HTTP 'PUT /asset/stack/parent' operation and returns the [Response].
  1360. /// Parameters:
  1361. ///
  1362. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1363. Future<Response> updateStackParentWithHttpInfo(UpdateStackParentDto updateStackParentDto,) async {
  1364. // ignore: prefer_const_declarations
  1365. final path = r'/asset/stack/parent';
  1366. // ignore: prefer_final_locals
  1367. Object? postBody = updateStackParentDto;
  1368. final queryParams = <QueryParam>[];
  1369. final headerParams = <String, String>{};
  1370. final formParams = <String, String>{};
  1371. const contentTypes = <String>['application/json'];
  1372. return apiClient.invokeAPI(
  1373. path,
  1374. 'PUT',
  1375. queryParams,
  1376. postBody,
  1377. headerParams,
  1378. formParams,
  1379. contentTypes.isEmpty ? null : contentTypes.first,
  1380. );
  1381. }
  1382. /// Parameters:
  1383. ///
  1384. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1385. Future<void> updateStackParent(UpdateStackParentDto updateStackParentDto,) async {
  1386. final response = await updateStackParentWithHttpInfo(updateStackParentDto,);
  1387. if (response.statusCode >= HttpStatus.badRequest) {
  1388. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1389. }
  1390. }
  1391. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1392. /// Parameters:
  1393. ///
  1394. /// * [MultipartFile] assetData (required):
  1395. ///
  1396. /// * [String] deviceAssetId (required):
  1397. ///
  1398. /// * [String] deviceId (required):
  1399. ///
  1400. /// * [DateTime] fileCreatedAt (required):
  1401. ///
  1402. /// * [DateTime] fileModifiedAt (required):
  1403. ///
  1404. /// * [bool] isFavorite (required):
  1405. ///
  1406. /// * [String] key:
  1407. ///
  1408. /// * [String] duration:
  1409. ///
  1410. /// * [bool] isArchived:
  1411. ///
  1412. /// * [bool] isExternal:
  1413. ///
  1414. /// * [bool] isOffline:
  1415. ///
  1416. /// * [bool] isReadOnly:
  1417. ///
  1418. /// * [bool] isVisible:
  1419. ///
  1420. /// * [String] libraryId:
  1421. ///
  1422. /// * [MultipartFile] livePhotoData:
  1423. ///
  1424. /// * [MultipartFile] sidecarData:
  1425. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1426. // ignore: prefer_const_declarations
  1427. final path = r'/asset/upload';
  1428. // ignore: prefer_final_locals
  1429. Object? postBody;
  1430. final queryParams = <QueryParam>[];
  1431. final headerParams = <String, String>{};
  1432. final formParams = <String, String>{};
  1433. if (key != null) {
  1434. queryParams.addAll(_queryParams('', 'key', key));
  1435. }
  1436. const contentTypes = <String>['multipart/form-data'];
  1437. bool hasFields = false;
  1438. final mp = MultipartRequest('POST', Uri.parse(path));
  1439. if (assetData != null) {
  1440. hasFields = true;
  1441. mp.fields[r'assetData'] = assetData.field;
  1442. mp.files.add(assetData);
  1443. }
  1444. if (deviceAssetId != null) {
  1445. hasFields = true;
  1446. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1447. }
  1448. if (deviceId != null) {
  1449. hasFields = true;
  1450. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1451. }
  1452. if (duration != null) {
  1453. hasFields = true;
  1454. mp.fields[r'duration'] = parameterToString(duration);
  1455. }
  1456. if (fileCreatedAt != null) {
  1457. hasFields = true;
  1458. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1459. }
  1460. if (fileModifiedAt != null) {
  1461. hasFields = true;
  1462. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1463. }
  1464. if (isArchived != null) {
  1465. hasFields = true;
  1466. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1467. }
  1468. if (isExternal != null) {
  1469. hasFields = true;
  1470. mp.fields[r'isExternal'] = parameterToString(isExternal);
  1471. }
  1472. if (isFavorite != null) {
  1473. hasFields = true;
  1474. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1475. }
  1476. if (isOffline != null) {
  1477. hasFields = true;
  1478. mp.fields[r'isOffline'] = parameterToString(isOffline);
  1479. }
  1480. if (isReadOnly != null) {
  1481. hasFields = true;
  1482. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1483. }
  1484. if (isVisible != null) {
  1485. hasFields = true;
  1486. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1487. }
  1488. if (libraryId != null) {
  1489. hasFields = true;
  1490. mp.fields[r'libraryId'] = parameterToString(libraryId);
  1491. }
  1492. if (livePhotoData != null) {
  1493. hasFields = true;
  1494. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1495. mp.files.add(livePhotoData);
  1496. }
  1497. if (sidecarData != null) {
  1498. hasFields = true;
  1499. mp.fields[r'sidecarData'] = sidecarData.field;
  1500. mp.files.add(sidecarData);
  1501. }
  1502. if (hasFields) {
  1503. postBody = mp;
  1504. }
  1505. return apiClient.invokeAPI(
  1506. path,
  1507. 'POST',
  1508. queryParams,
  1509. postBody,
  1510. headerParams,
  1511. formParams,
  1512. contentTypes.isEmpty ? null : contentTypes.first,
  1513. );
  1514. }
  1515. /// Parameters:
  1516. ///
  1517. /// * [MultipartFile] assetData (required):
  1518. ///
  1519. /// * [String] deviceAssetId (required):
  1520. ///
  1521. /// * [String] deviceId (required):
  1522. ///
  1523. /// * [DateTime] fileCreatedAt (required):
  1524. ///
  1525. /// * [DateTime] fileModifiedAt (required):
  1526. ///
  1527. /// * [bool] isFavorite (required):
  1528. ///
  1529. /// * [String] key:
  1530. ///
  1531. /// * [String] duration:
  1532. ///
  1533. /// * [bool] isArchived:
  1534. ///
  1535. /// * [bool] isExternal:
  1536. ///
  1537. /// * [bool] isOffline:
  1538. ///
  1539. /// * [bool] isReadOnly:
  1540. ///
  1541. /// * [bool] isVisible:
  1542. ///
  1543. /// * [String] libraryId:
  1544. ///
  1545. /// * [MultipartFile] livePhotoData:
  1546. ///
  1547. /// * [MultipartFile] sidecarData:
  1548. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1549. final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
  1550. if (response.statusCode >= HttpStatus.badRequest) {
  1551. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1552. }
  1553. // When a remote server returns no body with a status of 204, we shall not decode it.
  1554. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1555. // FormatException when trying to decode an empty string.
  1556. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1557. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1558. }
  1559. return null;
  1560. }
  1561. }