asset_api.dart 52 KB

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