asset_api.dart 50 KB

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