asset_api.dart 58 KB

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