asset_api.dart 53 KB

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