asset_api.dart 55 KB

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