asset_api.dart 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637
  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. /// * [DeleteAssetDto] deleteAssetDto (required):
  156. Future<Response> deleteAssetWithHttpInfo(DeleteAssetDto deleteAssetDto,) async {
  157. // ignore: prefer_const_declarations
  158. final path = r'/asset';
  159. // ignore: prefer_final_locals
  160. Object? postBody = deleteAssetDto;
  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. /// * [DeleteAssetDto] deleteAssetDto (required):
  178. Future<List<DeleteAssetResponseDto>?> deleteAsset(DeleteAssetDto deleteAssetDto,) async {
  179. final response = await deleteAssetWithHttpInfo(deleteAssetDto,);
  180. if (response.statusCode >= HttpStatus.badRequest) {
  181. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  182. }
  183. // When a remote server returns no body with a status of 204, we shall not decode it.
  184. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  185. // FormatException when trying to decode an empty string.
  186. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  187. final responseBody = await _decodeBodyBytes(response);
  188. return (await apiClient.deserializeAsync(responseBody, 'List<DeleteAssetResponseDto>') as List)
  189. .cast<DeleteAssetResponseDto>()
  190. .toList();
  191. }
  192. return null;
  193. }
  194. /// Performs an HTTP 'POST /asset/download/archive' operation and returns the [Response].
  195. /// Parameters:
  196. ///
  197. /// * [AssetIdsDto] assetIdsDto (required):
  198. ///
  199. /// * [String] key:
  200. Future<Response> downloadArchiveWithHttpInfo(AssetIdsDto assetIdsDto, { String? key, }) async {
  201. // ignore: prefer_const_declarations
  202. final path = r'/asset/download/archive';
  203. // ignore: prefer_final_locals
  204. Object? postBody = assetIdsDto;
  205. final queryParams = <QueryParam>[];
  206. final headerParams = <String, String>{};
  207. final formParams = <String, String>{};
  208. if (key != null) {
  209. queryParams.addAll(_queryParams('', 'key', key));
  210. }
  211. const contentTypes = <String>['application/json'];
  212. return apiClient.invokeAPI(
  213. path,
  214. 'POST',
  215. queryParams,
  216. postBody,
  217. headerParams,
  218. formParams,
  219. contentTypes.isEmpty ? null : contentTypes.first,
  220. );
  221. }
  222. /// Parameters:
  223. ///
  224. /// * [AssetIdsDto] assetIdsDto (required):
  225. ///
  226. /// * [String] key:
  227. Future<MultipartFile?> downloadArchive(AssetIdsDto assetIdsDto, { String? key, }) async {
  228. final response = await downloadArchiveWithHttpInfo(assetIdsDto, key: key, );
  229. if (response.statusCode >= HttpStatus.badRequest) {
  230. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  231. }
  232. // When a remote server returns no body with a status of 204, we shall not decode it.
  233. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  234. // FormatException when trying to decode an empty string.
  235. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  236. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  237. }
  238. return null;
  239. }
  240. /// Performs an HTTP 'POST /asset/download/{id}' operation and returns the [Response].
  241. /// Parameters:
  242. ///
  243. /// * [String] id (required):
  244. ///
  245. /// * [String] key:
  246. Future<Response> downloadFileWithHttpInfo(String id, { String? key, }) async {
  247. // ignore: prefer_const_declarations
  248. final path = r'/asset/download/{id}'
  249. .replaceAll('{id}', id);
  250. // ignore: prefer_final_locals
  251. Object? postBody;
  252. final queryParams = <QueryParam>[];
  253. final headerParams = <String, String>{};
  254. final formParams = <String, String>{};
  255. if (key != null) {
  256. queryParams.addAll(_queryParams('', 'key', key));
  257. }
  258. const contentTypes = <String>[];
  259. return apiClient.invokeAPI(
  260. path,
  261. 'POST',
  262. queryParams,
  263. postBody,
  264. headerParams,
  265. formParams,
  266. contentTypes.isEmpty ? null : contentTypes.first,
  267. );
  268. }
  269. /// Parameters:
  270. ///
  271. /// * [String] id (required):
  272. ///
  273. /// * [String] key:
  274. Future<MultipartFile?> downloadFile(String id, { String? key, }) async {
  275. final response = await downloadFileWithHttpInfo(id, key: key, );
  276. if (response.statusCode >= HttpStatus.badRequest) {
  277. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  278. }
  279. // When a remote server returns no body with a status of 204, we shall not decode it.
  280. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  281. // FormatException when trying to decode an empty string.
  282. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  283. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  284. }
  285. return null;
  286. }
  287. /// Get all AssetEntity belong to the user
  288. ///
  289. /// Note: This method returns the HTTP [Response].
  290. ///
  291. /// Parameters:
  292. ///
  293. /// * [String] userId:
  294. ///
  295. /// * [bool] isFavorite:
  296. ///
  297. /// * [bool] isArchived:
  298. ///
  299. /// * [num] skip:
  300. ///
  301. /// * [DateTime] updatedAfter:
  302. ///
  303. /// * [String] ifNoneMatch:
  304. /// ETag of data already cached on the client
  305. Future<Response> getAllAssetsWithHttpInfo({ String? userId, bool? isFavorite, bool? isArchived, num? skip, DateTime? updatedAfter, String? ifNoneMatch, }) async {
  306. // ignore: prefer_const_declarations
  307. final path = r'/asset';
  308. // ignore: prefer_final_locals
  309. Object? postBody;
  310. final queryParams = <QueryParam>[];
  311. final headerParams = <String, String>{};
  312. final formParams = <String, String>{};
  313. if (userId != null) {
  314. queryParams.addAll(_queryParams('', 'userId', userId));
  315. }
  316. if (isFavorite != null) {
  317. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  318. }
  319. if (isArchived != null) {
  320. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  321. }
  322. if (skip != null) {
  323. queryParams.addAll(_queryParams('', 'skip', skip));
  324. }
  325. if (updatedAfter != null) {
  326. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  327. }
  328. if (ifNoneMatch != null) {
  329. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  330. }
  331. const contentTypes = <String>[];
  332. return apiClient.invokeAPI(
  333. path,
  334. 'GET',
  335. queryParams,
  336. postBody,
  337. headerParams,
  338. formParams,
  339. contentTypes.isEmpty ? null : contentTypes.first,
  340. );
  341. }
  342. /// Get all AssetEntity belong to the user
  343. ///
  344. /// Parameters:
  345. ///
  346. /// * [String] userId:
  347. ///
  348. /// * [bool] isFavorite:
  349. ///
  350. /// * [bool] isArchived:
  351. ///
  352. /// * [num] skip:
  353. ///
  354. /// * [DateTime] updatedAfter:
  355. ///
  356. /// * [String] ifNoneMatch:
  357. /// ETag of data already cached on the client
  358. Future<List<AssetResponseDto>?> getAllAssets({ String? userId, bool? isFavorite, bool? isArchived, num? skip, DateTime? updatedAfter, String? ifNoneMatch, }) async {
  359. final response = await getAllAssetsWithHttpInfo( userId: userId, isFavorite: isFavorite, isArchived: isArchived, skip: skip, updatedAfter: updatedAfter, ifNoneMatch: ifNoneMatch, );
  360. if (response.statusCode >= HttpStatus.badRequest) {
  361. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  362. }
  363. // When a remote server returns no body with a status of 204, we shall not decode it.
  364. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  365. // FormatException when trying to decode an empty string.
  366. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  367. final responseBody = await _decodeBodyBytes(response);
  368. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  369. .cast<AssetResponseDto>()
  370. .toList();
  371. }
  372. return null;
  373. }
  374. /// Get a single asset's information
  375. ///
  376. /// Note: This method returns the HTTP [Response].
  377. ///
  378. /// Parameters:
  379. ///
  380. /// * [String] id (required):
  381. ///
  382. /// * [String] key:
  383. Future<Response> getAssetByIdWithHttpInfo(String id, { String? key, }) async {
  384. // ignore: prefer_const_declarations
  385. final path = r'/asset/assetById/{id}'
  386. .replaceAll('{id}', id);
  387. // ignore: prefer_final_locals
  388. Object? postBody;
  389. final queryParams = <QueryParam>[];
  390. final headerParams = <String, String>{};
  391. final formParams = <String, String>{};
  392. if (key != null) {
  393. queryParams.addAll(_queryParams('', 'key', key));
  394. }
  395. const contentTypes = <String>[];
  396. return apiClient.invokeAPI(
  397. path,
  398. 'GET',
  399. queryParams,
  400. postBody,
  401. headerParams,
  402. formParams,
  403. contentTypes.isEmpty ? null : contentTypes.first,
  404. );
  405. }
  406. /// Get a single asset's information
  407. ///
  408. /// Parameters:
  409. ///
  410. /// * [String] id (required):
  411. ///
  412. /// * [String] key:
  413. Future<AssetResponseDto?> getAssetById(String id, { String? key, }) async {
  414. final response = await getAssetByIdWithHttpInfo(id, key: key, );
  415. if (response.statusCode >= HttpStatus.badRequest) {
  416. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  417. }
  418. // When a remote server returns no body with a status of 204, we shall not decode it.
  419. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  420. // FormatException when trying to decode an empty string.
  421. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  422. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  423. }
  424. return null;
  425. }
  426. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  427. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  428. // ignore: prefer_const_declarations
  429. final path = r'/asset/search-terms';
  430. // ignore: prefer_final_locals
  431. Object? postBody;
  432. final queryParams = <QueryParam>[];
  433. final headerParams = <String, String>{};
  434. final formParams = <String, String>{};
  435. const contentTypes = <String>[];
  436. return apiClient.invokeAPI(
  437. path,
  438. 'GET',
  439. queryParams,
  440. postBody,
  441. headerParams,
  442. formParams,
  443. contentTypes.isEmpty ? null : contentTypes.first,
  444. );
  445. }
  446. Future<List<String>?> getAssetSearchTerms() async {
  447. final response = await getAssetSearchTermsWithHttpInfo();
  448. if (response.statusCode >= HttpStatus.badRequest) {
  449. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  450. }
  451. // When a remote server returns no body with a status of 204, we shall not decode it.
  452. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  453. // FormatException when trying to decode an empty string.
  454. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  455. final responseBody = await _decodeBodyBytes(response);
  456. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  457. .cast<String>()
  458. .toList();
  459. }
  460. return null;
  461. }
  462. /// Performs an HTTP 'GET /asset/statistics' operation and returns the [Response].
  463. /// Parameters:
  464. ///
  465. /// * [bool] isArchived:
  466. ///
  467. /// * [bool] isFavorite:
  468. Future<Response> getAssetStatsWithHttpInfo({ bool? isArchived, bool? isFavorite, }) async {
  469. // ignore: prefer_const_declarations
  470. final path = r'/asset/statistics';
  471. // ignore: prefer_final_locals
  472. Object? postBody;
  473. final queryParams = <QueryParam>[];
  474. final headerParams = <String, String>{};
  475. final formParams = <String, String>{};
  476. if (isArchived != null) {
  477. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  478. }
  479. if (isFavorite != null) {
  480. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  481. }
  482. const contentTypes = <String>[];
  483. return apiClient.invokeAPI(
  484. path,
  485. 'GET',
  486. queryParams,
  487. postBody,
  488. headerParams,
  489. formParams,
  490. contentTypes.isEmpty ? null : contentTypes.first,
  491. );
  492. }
  493. /// Parameters:
  494. ///
  495. /// * [bool] isArchived:
  496. ///
  497. /// * [bool] isFavorite:
  498. Future<AssetStatsResponseDto?> getAssetStats({ bool? isArchived, bool? isFavorite, }) async {
  499. final response = await getAssetStatsWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, );
  500. if (response.statusCode >= HttpStatus.badRequest) {
  501. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  502. }
  503. // When a remote server returns no body with a status of 204, we shall not decode it.
  504. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  505. // FormatException when trying to decode an empty string.
  506. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  507. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
  508. }
  509. return null;
  510. }
  511. /// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
  512. /// Parameters:
  513. ///
  514. /// * [String] id (required):
  515. ///
  516. /// * [ThumbnailFormat] format:
  517. ///
  518. /// * [String] key:
  519. Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
  520. // ignore: prefer_const_declarations
  521. final path = r'/asset/thumbnail/{id}'
  522. .replaceAll('{id}', id);
  523. // ignore: prefer_final_locals
  524. Object? postBody;
  525. final queryParams = <QueryParam>[];
  526. final headerParams = <String, String>{};
  527. final formParams = <String, String>{};
  528. if (format != null) {
  529. queryParams.addAll(_queryParams('', 'format', format));
  530. }
  531. if (key != null) {
  532. queryParams.addAll(_queryParams('', 'key', key));
  533. }
  534. const contentTypes = <String>[];
  535. return apiClient.invokeAPI(
  536. path,
  537. 'GET',
  538. queryParams,
  539. postBody,
  540. headerParams,
  541. formParams,
  542. contentTypes.isEmpty ? null : contentTypes.first,
  543. );
  544. }
  545. /// Parameters:
  546. ///
  547. /// * [String] id (required):
  548. ///
  549. /// * [ThumbnailFormat] format:
  550. ///
  551. /// * [String] key:
  552. Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
  553. final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
  554. if (response.statusCode >= HttpStatus.badRequest) {
  555. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  556. }
  557. // When a remote server returns no body with a status of 204, we shall not decode it.
  558. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  559. // FormatException when trying to decode an empty string.
  560. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  561. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  562. }
  563. return null;
  564. }
  565. /// Performs an HTTP 'GET /asset/time-bucket' operation and returns the [Response].
  566. /// Parameters:
  567. ///
  568. /// * [TimeBucketSize] size (required):
  569. ///
  570. /// * [String] timeBucket (required):
  571. ///
  572. /// * [String] userId:
  573. ///
  574. /// * [String] albumId:
  575. ///
  576. /// * [String] personId:
  577. ///
  578. /// * [bool] isArchived:
  579. ///
  580. /// * [bool] isFavorite:
  581. ///
  582. /// * [String] key:
  583. Future<Response> getByTimeBucketWithHttpInfo(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  584. // ignore: prefer_const_declarations
  585. final path = r'/asset/time-bucket';
  586. // ignore: prefer_final_locals
  587. Object? postBody;
  588. final queryParams = <QueryParam>[];
  589. final headerParams = <String, String>{};
  590. final formParams = <String, String>{};
  591. queryParams.addAll(_queryParams('', 'size', size));
  592. if (userId != null) {
  593. queryParams.addAll(_queryParams('', 'userId', userId));
  594. }
  595. if (albumId != null) {
  596. queryParams.addAll(_queryParams('', 'albumId', albumId));
  597. }
  598. if (personId != null) {
  599. queryParams.addAll(_queryParams('', 'personId', personId));
  600. }
  601. if (isArchived != null) {
  602. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  603. }
  604. if (isFavorite != null) {
  605. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  606. }
  607. queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
  608. if (key != null) {
  609. queryParams.addAll(_queryParams('', 'key', key));
  610. }
  611. const contentTypes = <String>[];
  612. return apiClient.invokeAPI(
  613. path,
  614. 'GET',
  615. queryParams,
  616. postBody,
  617. headerParams,
  618. formParams,
  619. contentTypes.isEmpty ? null : contentTypes.first,
  620. );
  621. }
  622. /// Parameters:
  623. ///
  624. /// * [TimeBucketSize] size (required):
  625. ///
  626. /// * [String] timeBucket (required):
  627. ///
  628. /// * [String] userId:
  629. ///
  630. /// * [String] albumId:
  631. ///
  632. /// * [String] personId:
  633. ///
  634. /// * [bool] isArchived:
  635. ///
  636. /// * [bool] isFavorite:
  637. ///
  638. /// * [String] key:
  639. Future<List<AssetResponseDto>?> getByTimeBucket(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  640. final response = await getByTimeBucketWithHttpInfo(size, timeBucket, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, key: key, );
  641. if (response.statusCode >= HttpStatus.badRequest) {
  642. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  643. }
  644. // When a remote server returns no body with a status of 204, we shall not decode it.
  645. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  646. // FormatException when trying to decode an empty string.
  647. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  648. final responseBody = await _decodeBodyBytes(response);
  649. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  650. .cast<AssetResponseDto>()
  651. .toList();
  652. }
  653. return null;
  654. }
  655. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  656. Future<Response> getCuratedLocationsWithHttpInfo() async {
  657. // ignore: prefer_const_declarations
  658. final path = r'/asset/curated-locations';
  659. // ignore: prefer_final_locals
  660. Object? postBody;
  661. final queryParams = <QueryParam>[];
  662. final headerParams = <String, String>{};
  663. final formParams = <String, String>{};
  664. const contentTypes = <String>[];
  665. return apiClient.invokeAPI(
  666. path,
  667. 'GET',
  668. queryParams,
  669. postBody,
  670. headerParams,
  671. formParams,
  672. contentTypes.isEmpty ? null : contentTypes.first,
  673. );
  674. }
  675. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  676. final response = await getCuratedLocationsWithHttpInfo();
  677. if (response.statusCode >= HttpStatus.badRequest) {
  678. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  679. }
  680. // When a remote server returns no body with a status of 204, we shall not decode it.
  681. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  682. // FormatException when trying to decode an empty string.
  683. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  684. final responseBody = await _decodeBodyBytes(response);
  685. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  686. .cast<CuratedLocationsResponseDto>()
  687. .toList();
  688. }
  689. return null;
  690. }
  691. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  692. Future<Response> getCuratedObjectsWithHttpInfo() async {
  693. // ignore: prefer_const_declarations
  694. final path = r'/asset/curated-objects';
  695. // ignore: prefer_final_locals
  696. Object? postBody;
  697. final queryParams = <QueryParam>[];
  698. final headerParams = <String, String>{};
  699. final formParams = <String, String>{};
  700. const contentTypes = <String>[];
  701. return apiClient.invokeAPI(
  702. path,
  703. 'GET',
  704. queryParams,
  705. postBody,
  706. headerParams,
  707. formParams,
  708. contentTypes.isEmpty ? null : contentTypes.first,
  709. );
  710. }
  711. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  712. final response = await getCuratedObjectsWithHttpInfo();
  713. if (response.statusCode >= HttpStatus.badRequest) {
  714. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  715. }
  716. // When a remote server returns no body with a status of 204, we shall not decode it.
  717. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  718. // FormatException when trying to decode an empty string.
  719. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  720. final responseBody = await _decodeBodyBytes(response);
  721. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  722. .cast<CuratedObjectsResponseDto>()
  723. .toList();
  724. }
  725. return null;
  726. }
  727. /// Performs an HTTP 'POST /asset/download/info' operation and returns the [Response].
  728. /// Parameters:
  729. ///
  730. /// * [DownloadInfoDto] downloadInfoDto (required):
  731. ///
  732. /// * [String] key:
  733. Future<Response> getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  734. // ignore: prefer_const_declarations
  735. final path = r'/asset/download/info';
  736. // ignore: prefer_final_locals
  737. Object? postBody = downloadInfoDto;
  738. final queryParams = <QueryParam>[];
  739. final headerParams = <String, String>{};
  740. final formParams = <String, String>{};
  741. if (key != null) {
  742. queryParams.addAll(_queryParams('', 'key', key));
  743. }
  744. const contentTypes = <String>['application/json'];
  745. return apiClient.invokeAPI(
  746. path,
  747. 'POST',
  748. queryParams,
  749. postBody,
  750. headerParams,
  751. formParams,
  752. contentTypes.isEmpty ? null : contentTypes.first,
  753. );
  754. }
  755. /// Parameters:
  756. ///
  757. /// * [DownloadInfoDto] downloadInfoDto (required):
  758. ///
  759. /// * [String] key:
  760. Future<DownloadResponseDto?> getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  761. final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, );
  762. if (response.statusCode >= HttpStatus.badRequest) {
  763. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  764. }
  765. // When a remote server returns no body with a status of 204, we shall not decode it.
  766. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  767. // FormatException when trying to decode an empty string.
  768. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  769. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DownloadResponseDto',) as DownloadResponseDto;
  770. }
  771. return null;
  772. }
  773. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  774. /// Parameters:
  775. ///
  776. /// * [bool] isFavorite:
  777. ///
  778. /// * [DateTime] fileCreatedAfter:
  779. ///
  780. /// * [DateTime] fileCreatedBefore:
  781. Future<Response> getMapMarkersWithHttpInfo({ bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  782. // ignore: prefer_const_declarations
  783. final path = r'/asset/map-marker';
  784. // ignore: prefer_final_locals
  785. Object? postBody;
  786. final queryParams = <QueryParam>[];
  787. final headerParams = <String, String>{};
  788. final formParams = <String, String>{};
  789. if (isFavorite != null) {
  790. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  791. }
  792. if (fileCreatedAfter != null) {
  793. queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
  794. }
  795. if (fileCreatedBefore != null) {
  796. queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
  797. }
  798. const contentTypes = <String>[];
  799. return apiClient.invokeAPI(
  800. path,
  801. 'GET',
  802. queryParams,
  803. postBody,
  804. headerParams,
  805. formParams,
  806. contentTypes.isEmpty ? null : contentTypes.first,
  807. );
  808. }
  809. /// Parameters:
  810. ///
  811. /// * [bool] isFavorite:
  812. ///
  813. /// * [DateTime] fileCreatedAfter:
  814. ///
  815. /// * [DateTime] fileCreatedBefore:
  816. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  817. final response = await getMapMarkersWithHttpInfo( isFavorite: isFavorite, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, );
  818. if (response.statusCode >= HttpStatus.badRequest) {
  819. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  820. }
  821. // When a remote server returns no body with a status of 204, we shall not decode it.
  822. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  823. // FormatException when trying to decode an empty string.
  824. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  825. final responseBody = await _decodeBodyBytes(response);
  826. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  827. .cast<MapMarkerResponseDto>()
  828. .toList();
  829. }
  830. return null;
  831. }
  832. /// Performs an HTTP 'GET /asset/memory-lane' operation and returns the [Response].
  833. /// Parameters:
  834. ///
  835. /// * [DateTime] timestamp (required):
  836. /// Get pictures for +24 hours from this time going back x years
  837. Future<Response> getMemoryLaneWithHttpInfo(DateTime timestamp,) async {
  838. // ignore: prefer_const_declarations
  839. final path = r'/asset/memory-lane';
  840. // ignore: prefer_final_locals
  841. Object? postBody;
  842. final queryParams = <QueryParam>[];
  843. final headerParams = <String, String>{};
  844. final formParams = <String, String>{};
  845. queryParams.addAll(_queryParams('', 'timestamp', timestamp));
  846. const contentTypes = <String>[];
  847. return apiClient.invokeAPI(
  848. path,
  849. 'GET',
  850. queryParams,
  851. postBody,
  852. headerParams,
  853. formParams,
  854. contentTypes.isEmpty ? null : contentTypes.first,
  855. );
  856. }
  857. /// Parameters:
  858. ///
  859. /// * [DateTime] timestamp (required):
  860. /// Get pictures for +24 hours from this time going back x years
  861. Future<List<MemoryLaneResponseDto>?> getMemoryLane(DateTime timestamp,) async {
  862. final response = await getMemoryLaneWithHttpInfo(timestamp,);
  863. if (response.statusCode >= HttpStatus.badRequest) {
  864. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  865. }
  866. // When a remote server returns no body with a status of 204, we shall not decode it.
  867. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  868. // FormatException when trying to decode an empty string.
  869. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  870. final responseBody = await _decodeBodyBytes(response);
  871. return (await apiClient.deserializeAsync(responseBody, 'List<MemoryLaneResponseDto>') as List)
  872. .cast<MemoryLaneResponseDto>()
  873. .toList();
  874. }
  875. return null;
  876. }
  877. /// Performs an HTTP 'GET /asset/time-buckets' operation and returns the [Response].
  878. /// Parameters:
  879. ///
  880. /// * [TimeBucketSize] size (required):
  881. ///
  882. /// * [String] userId:
  883. ///
  884. /// * [String] albumId:
  885. ///
  886. /// * [String] personId:
  887. ///
  888. /// * [bool] isArchived:
  889. ///
  890. /// * [bool] isFavorite:
  891. ///
  892. /// * [String] key:
  893. Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  894. // ignore: prefer_const_declarations
  895. final path = r'/asset/time-buckets';
  896. // ignore: prefer_final_locals
  897. Object? postBody;
  898. final queryParams = <QueryParam>[];
  899. final headerParams = <String, String>{};
  900. final formParams = <String, String>{};
  901. queryParams.addAll(_queryParams('', 'size', size));
  902. if (userId != null) {
  903. queryParams.addAll(_queryParams('', 'userId', userId));
  904. }
  905. if (albumId != null) {
  906. queryParams.addAll(_queryParams('', 'albumId', albumId));
  907. }
  908. if (personId != null) {
  909. queryParams.addAll(_queryParams('', 'personId', personId));
  910. }
  911. if (isArchived != null) {
  912. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  913. }
  914. if (isFavorite != null) {
  915. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  916. }
  917. if (key != null) {
  918. queryParams.addAll(_queryParams('', 'key', key));
  919. }
  920. const contentTypes = <String>[];
  921. return apiClient.invokeAPI(
  922. path,
  923. 'GET',
  924. queryParams,
  925. postBody,
  926. headerParams,
  927. formParams,
  928. contentTypes.isEmpty ? null : contentTypes.first,
  929. );
  930. }
  931. /// Parameters:
  932. ///
  933. /// * [TimeBucketSize] size (required):
  934. ///
  935. /// * [String] userId:
  936. ///
  937. /// * [String] albumId:
  938. ///
  939. /// * [String] personId:
  940. ///
  941. /// * [bool] isArchived:
  942. ///
  943. /// * [bool] isFavorite:
  944. ///
  945. /// * [String] key:
  946. Future<List<TimeBucketResponseDto>?> getTimeBuckets(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  947. final response = await getTimeBucketsWithHttpInfo(size, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, key: key, );
  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<TimeBucketResponseDto>') as List)
  957. .cast<TimeBucketResponseDto>()
  958. .toList();
  959. }
  960. return null;
  961. }
  962. /// Get all asset of a device that are in the database, ID only.
  963. ///
  964. /// Note: This method returns the HTTP [Response].
  965. ///
  966. /// Parameters:
  967. ///
  968. /// * [String] deviceId (required):
  969. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  970. // ignore: prefer_const_declarations
  971. final path = r'/asset/{deviceId}'
  972. .replaceAll('{deviceId}', deviceId);
  973. // ignore: prefer_final_locals
  974. Object? postBody;
  975. final queryParams = <QueryParam>[];
  976. final headerParams = <String, String>{};
  977. final formParams = <String, String>{};
  978. const contentTypes = <String>[];
  979. return apiClient.invokeAPI(
  980. path,
  981. 'GET',
  982. queryParams,
  983. postBody,
  984. headerParams,
  985. formParams,
  986. contentTypes.isEmpty ? null : contentTypes.first,
  987. );
  988. }
  989. /// Get all asset of a device that are in the database, ID only.
  990. ///
  991. /// Parameters:
  992. ///
  993. /// * [String] deviceId (required):
  994. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  995. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  996. if (response.statusCode >= HttpStatus.badRequest) {
  997. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  998. }
  999. // When a remote server returns no body with a status of 204, we shall not decode it.
  1000. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1001. // FormatException when trying to decode an empty string.
  1002. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1003. final responseBody = await _decodeBodyBytes(response);
  1004. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  1005. .cast<String>()
  1006. .toList();
  1007. }
  1008. return null;
  1009. }
  1010. /// Performs an HTTP 'POST /asset/import' operation and returns the [Response].
  1011. /// Parameters:
  1012. ///
  1013. /// * [ImportAssetDto] importAssetDto (required):
  1014. Future<Response> importFileWithHttpInfo(ImportAssetDto importAssetDto,) async {
  1015. // ignore: prefer_const_declarations
  1016. final path = r'/asset/import';
  1017. // ignore: prefer_final_locals
  1018. Object? postBody = importAssetDto;
  1019. final queryParams = <QueryParam>[];
  1020. final headerParams = <String, String>{};
  1021. final formParams = <String, String>{};
  1022. const contentTypes = <String>['application/json'];
  1023. return apiClient.invokeAPI(
  1024. path,
  1025. 'POST',
  1026. queryParams,
  1027. postBody,
  1028. headerParams,
  1029. formParams,
  1030. contentTypes.isEmpty ? null : contentTypes.first,
  1031. );
  1032. }
  1033. /// Parameters:
  1034. ///
  1035. /// * [ImportAssetDto] importAssetDto (required):
  1036. Future<AssetFileUploadResponseDto?> importFile(ImportAssetDto importAssetDto,) async {
  1037. final response = await importFileWithHttpInfo(importAssetDto,);
  1038. if (response.statusCode >= HttpStatus.badRequest) {
  1039. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1040. }
  1041. // When a remote server returns no body with a status of 204, we shall not decode it.
  1042. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1043. // FormatException when trying to decode an empty string.
  1044. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1045. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1046. }
  1047. return null;
  1048. }
  1049. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1050. /// Parameters:
  1051. ///
  1052. /// * [AssetJobsDto] assetJobsDto (required):
  1053. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1054. // ignore: prefer_const_declarations
  1055. final path = r'/asset/jobs';
  1056. // ignore: prefer_final_locals
  1057. Object? postBody = assetJobsDto;
  1058. final queryParams = <QueryParam>[];
  1059. final headerParams = <String, String>{};
  1060. final formParams = <String, String>{};
  1061. const contentTypes = <String>['application/json'];
  1062. return apiClient.invokeAPI(
  1063. path,
  1064. 'POST',
  1065. queryParams,
  1066. postBody,
  1067. headerParams,
  1068. formParams,
  1069. contentTypes.isEmpty ? null : contentTypes.first,
  1070. );
  1071. }
  1072. /// Parameters:
  1073. ///
  1074. /// * [AssetJobsDto] assetJobsDto (required):
  1075. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1076. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1077. if (response.statusCode >= HttpStatus.badRequest) {
  1078. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1079. }
  1080. }
  1081. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  1082. /// Parameters:
  1083. ///
  1084. /// * [SearchAssetDto] searchAssetDto (required):
  1085. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1086. // ignore: prefer_const_declarations
  1087. final path = r'/asset/search';
  1088. // ignore: prefer_final_locals
  1089. Object? postBody = searchAssetDto;
  1090. final queryParams = <QueryParam>[];
  1091. final headerParams = <String, String>{};
  1092. final formParams = <String, String>{};
  1093. const contentTypes = <String>['application/json'];
  1094. return apiClient.invokeAPI(
  1095. path,
  1096. 'POST',
  1097. queryParams,
  1098. postBody,
  1099. headerParams,
  1100. formParams,
  1101. contentTypes.isEmpty ? null : contentTypes.first,
  1102. );
  1103. }
  1104. /// Parameters:
  1105. ///
  1106. /// * [SearchAssetDto] searchAssetDto (required):
  1107. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1108. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1109. if (response.statusCode >= HttpStatus.badRequest) {
  1110. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1111. }
  1112. // When a remote server returns no body with a status of 204, we shall not decode it.
  1113. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1114. // FormatException when trying to decode an empty string.
  1115. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1116. final responseBody = await _decodeBodyBytes(response);
  1117. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1118. .cast<AssetResponseDto>()
  1119. .toList();
  1120. }
  1121. return null;
  1122. }
  1123. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1124. /// Parameters:
  1125. ///
  1126. /// * [String] id (required):
  1127. ///
  1128. /// * [bool] isThumb:
  1129. ///
  1130. /// * [bool] isWeb:
  1131. ///
  1132. /// * [String] key:
  1133. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1134. // ignore: prefer_const_declarations
  1135. final path = r'/asset/file/{id}'
  1136. .replaceAll('{id}', id);
  1137. // ignore: prefer_final_locals
  1138. Object? postBody;
  1139. final queryParams = <QueryParam>[];
  1140. final headerParams = <String, String>{};
  1141. final formParams = <String, String>{};
  1142. if (isThumb != null) {
  1143. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1144. }
  1145. if (isWeb != null) {
  1146. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1147. }
  1148. if (key != null) {
  1149. queryParams.addAll(_queryParams('', 'key', key));
  1150. }
  1151. const contentTypes = <String>[];
  1152. return apiClient.invokeAPI(
  1153. path,
  1154. 'GET',
  1155. queryParams,
  1156. postBody,
  1157. headerParams,
  1158. formParams,
  1159. contentTypes.isEmpty ? null : contentTypes.first,
  1160. );
  1161. }
  1162. /// Parameters:
  1163. ///
  1164. /// * [String] id (required):
  1165. ///
  1166. /// * [bool] isThumb:
  1167. ///
  1168. /// * [bool] isWeb:
  1169. ///
  1170. /// * [String] key:
  1171. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1172. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1173. if (response.statusCode >= HttpStatus.badRequest) {
  1174. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1175. }
  1176. // When a remote server returns no body with a status of 204, we shall not decode it.
  1177. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1178. // FormatException when trying to decode an empty string.
  1179. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1180. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1181. }
  1182. return null;
  1183. }
  1184. /// Update an asset
  1185. ///
  1186. /// Note: This method returns the HTTP [Response].
  1187. ///
  1188. /// Parameters:
  1189. ///
  1190. /// * [String] id (required):
  1191. ///
  1192. /// * [UpdateAssetDto] updateAssetDto (required):
  1193. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1194. // ignore: prefer_const_declarations
  1195. final path = r'/asset/{id}'
  1196. .replaceAll('{id}', id);
  1197. // ignore: prefer_final_locals
  1198. Object? postBody = updateAssetDto;
  1199. final queryParams = <QueryParam>[];
  1200. final headerParams = <String, String>{};
  1201. final formParams = <String, String>{};
  1202. const contentTypes = <String>['application/json'];
  1203. return apiClient.invokeAPI(
  1204. path,
  1205. 'PUT',
  1206. queryParams,
  1207. postBody,
  1208. headerParams,
  1209. formParams,
  1210. contentTypes.isEmpty ? null : contentTypes.first,
  1211. );
  1212. }
  1213. /// Update an asset
  1214. ///
  1215. /// Parameters:
  1216. ///
  1217. /// * [String] id (required):
  1218. ///
  1219. /// * [UpdateAssetDto] updateAssetDto (required):
  1220. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1221. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1222. if (response.statusCode >= HttpStatus.badRequest) {
  1223. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1224. }
  1225. // When a remote server returns no body with a status of 204, we shall not decode it.
  1226. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1227. // FormatException when trying to decode an empty string.
  1228. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1229. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1230. }
  1231. return null;
  1232. }
  1233. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1234. /// Parameters:
  1235. ///
  1236. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1237. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1238. // ignore: prefer_const_declarations
  1239. final path = r'/asset';
  1240. // ignore: prefer_final_locals
  1241. Object? postBody = assetBulkUpdateDto;
  1242. final queryParams = <QueryParam>[];
  1243. final headerParams = <String, String>{};
  1244. final formParams = <String, String>{};
  1245. const contentTypes = <String>['application/json'];
  1246. return apiClient.invokeAPI(
  1247. path,
  1248. 'PUT',
  1249. queryParams,
  1250. postBody,
  1251. headerParams,
  1252. formParams,
  1253. contentTypes.isEmpty ? null : contentTypes.first,
  1254. );
  1255. }
  1256. /// Parameters:
  1257. ///
  1258. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1259. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1260. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1261. if (response.statusCode >= HttpStatus.badRequest) {
  1262. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1263. }
  1264. }
  1265. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1266. /// Parameters:
  1267. ///
  1268. /// * [MultipartFile] assetData (required):
  1269. ///
  1270. /// * [String] deviceAssetId (required):
  1271. ///
  1272. /// * [String] deviceId (required):
  1273. ///
  1274. /// * [DateTime] fileCreatedAt (required):
  1275. ///
  1276. /// * [DateTime] fileModifiedAt (required):
  1277. ///
  1278. /// * [bool] isFavorite (required):
  1279. ///
  1280. /// * [String] key:
  1281. ///
  1282. /// * [String] duration:
  1283. ///
  1284. /// * [bool] isArchived:
  1285. ///
  1286. /// * [bool] isReadOnly:
  1287. ///
  1288. /// * [bool] isVisible:
  1289. ///
  1290. /// * [MultipartFile] livePhotoData:
  1291. ///
  1292. /// * [MultipartFile] sidecarData:
  1293. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isReadOnly, bool? isVisible, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1294. // ignore: prefer_const_declarations
  1295. final path = r'/asset/upload';
  1296. // ignore: prefer_final_locals
  1297. Object? postBody;
  1298. final queryParams = <QueryParam>[];
  1299. final headerParams = <String, String>{};
  1300. final formParams = <String, String>{};
  1301. if (key != null) {
  1302. queryParams.addAll(_queryParams('', 'key', key));
  1303. }
  1304. const contentTypes = <String>['multipart/form-data'];
  1305. bool hasFields = false;
  1306. final mp = MultipartRequest('POST', Uri.parse(path));
  1307. if (assetData != null) {
  1308. hasFields = true;
  1309. mp.fields[r'assetData'] = assetData.field;
  1310. mp.files.add(assetData);
  1311. }
  1312. if (deviceAssetId != null) {
  1313. hasFields = true;
  1314. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1315. }
  1316. if (deviceId != null) {
  1317. hasFields = true;
  1318. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1319. }
  1320. if (duration != null) {
  1321. hasFields = true;
  1322. mp.fields[r'duration'] = parameterToString(duration);
  1323. }
  1324. if (fileCreatedAt != null) {
  1325. hasFields = true;
  1326. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1327. }
  1328. if (fileModifiedAt != null) {
  1329. hasFields = true;
  1330. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1331. }
  1332. if (isArchived != null) {
  1333. hasFields = true;
  1334. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1335. }
  1336. if (isFavorite != null) {
  1337. hasFields = true;
  1338. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1339. }
  1340. if (isReadOnly != null) {
  1341. hasFields = true;
  1342. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1343. }
  1344. if (isVisible != null) {
  1345. hasFields = true;
  1346. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1347. }
  1348. if (livePhotoData != null) {
  1349. hasFields = true;
  1350. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1351. mp.files.add(livePhotoData);
  1352. }
  1353. if (sidecarData != null) {
  1354. hasFields = true;
  1355. mp.fields[r'sidecarData'] = sidecarData.field;
  1356. mp.files.add(sidecarData);
  1357. }
  1358. if (hasFields) {
  1359. postBody = mp;
  1360. }
  1361. return apiClient.invokeAPI(
  1362. path,
  1363. 'POST',
  1364. queryParams,
  1365. postBody,
  1366. headerParams,
  1367. formParams,
  1368. contentTypes.isEmpty ? null : contentTypes.first,
  1369. );
  1370. }
  1371. /// Parameters:
  1372. ///
  1373. /// * [MultipartFile] assetData (required):
  1374. ///
  1375. /// * [String] deviceAssetId (required):
  1376. ///
  1377. /// * [String] deviceId (required):
  1378. ///
  1379. /// * [DateTime] fileCreatedAt (required):
  1380. ///
  1381. /// * [DateTime] fileModifiedAt (required):
  1382. ///
  1383. /// * [bool] isFavorite (required):
  1384. ///
  1385. /// * [String] key:
  1386. ///
  1387. /// * [String] duration:
  1388. ///
  1389. /// * [bool] isArchived:
  1390. ///
  1391. /// * [bool] isReadOnly:
  1392. ///
  1393. /// * [bool] isVisible:
  1394. ///
  1395. /// * [MultipartFile] livePhotoData:
  1396. ///
  1397. /// * [MultipartFile] sidecarData:
  1398. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isReadOnly, bool? isVisible, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1399. final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key: key, duration: duration, isArchived: isArchived, isReadOnly: isReadOnly, isVisible: isVisible, livePhotoData: livePhotoData, sidecarData: sidecarData, );
  1400. if (response.statusCode >= HttpStatus.badRequest) {
  1401. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1402. }
  1403. // When a remote server returns no body with a status of 204, we shall not decode it.
  1404. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1405. // FormatException when trying to decode an empty string.
  1406. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1407. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1408. }
  1409. return null;
  1410. }
  1411. }