asset_api.dart 57 KB

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