asset_api.dart 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237
  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. /// Check duplicated asset before uploading - for Web upload used
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
  20. Future<Response> checkDuplicateAssetWithHttpInfo(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
  21. // ignore: prefer_const_declarations
  22. final path = r'/asset/check';
  23. // ignore: prefer_final_locals
  24. Object? postBody = checkDuplicateAssetDto;
  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. /// Check duplicated asset before uploading - for Web upload used
  40. ///
  41. /// Parameters:
  42. ///
  43. /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
  44. Future<CheckDuplicateAssetResponseDto?> checkDuplicateAsset(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
  45. final response = await checkDuplicateAssetWithHttpInfo(checkDuplicateAssetDto,);
  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), 'CheckDuplicateAssetResponseDto',) as CheckDuplicateAssetResponseDto;
  54. }
  55. return null;
  56. }
  57. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  58. ///
  59. /// Note: This method returns the HTTP [Response].
  60. ///
  61. /// Parameters:
  62. ///
  63. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  64. Future<Response> checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  65. // ignore: prefer_const_declarations
  66. final path = r'/asset/exist';
  67. // ignore: prefer_final_locals
  68. Object? postBody = checkExistingAssetsDto;
  69. final queryParams = <QueryParam>[];
  70. final headerParams = <String, String>{};
  71. final formParams = <String, String>{};
  72. const contentTypes = <String>['application/json'];
  73. return apiClient.invokeAPI(
  74. path,
  75. 'POST',
  76. queryParams,
  77. postBody,
  78. headerParams,
  79. formParams,
  80. contentTypes.isEmpty ? null : contentTypes.first,
  81. );
  82. }
  83. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  84. ///
  85. /// Parameters:
  86. ///
  87. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  88. Future<CheckExistingAssetsResponseDto?> checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  89. final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,);
  90. if (response.statusCode >= HttpStatus.badRequest) {
  91. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  92. }
  93. // When a remote server returns no body with a status of 204, we shall not decode it.
  94. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  95. // FormatException when trying to decode an empty string.
  96. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  97. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto;
  98. }
  99. return null;
  100. }
  101. ///
  102. ///
  103. /// Note: This method returns the HTTP [Response].
  104. ///
  105. /// Parameters:
  106. ///
  107. /// * [CreateAssetsShareLinkDto] createAssetsShareLinkDto (required):
  108. Future<Response> createAssetsSharedLinkWithHttpInfo(CreateAssetsShareLinkDto createAssetsShareLinkDto,) async {
  109. // ignore: prefer_const_declarations
  110. final path = r'/asset/shared-link';
  111. // ignore: prefer_final_locals
  112. Object? postBody = createAssetsShareLinkDto;
  113. final queryParams = <QueryParam>[];
  114. final headerParams = <String, String>{};
  115. final formParams = <String, String>{};
  116. const contentTypes = <String>['application/json'];
  117. return apiClient.invokeAPI(
  118. path,
  119. 'POST',
  120. queryParams,
  121. postBody,
  122. headerParams,
  123. formParams,
  124. contentTypes.isEmpty ? null : contentTypes.first,
  125. );
  126. }
  127. ///
  128. ///
  129. /// Parameters:
  130. ///
  131. /// * [CreateAssetsShareLinkDto] createAssetsShareLinkDto (required):
  132. Future<SharedLinkResponseDto?> createAssetsSharedLink(CreateAssetsShareLinkDto createAssetsShareLinkDto,) async {
  133. final response = await createAssetsSharedLinkWithHttpInfo(createAssetsShareLinkDto,);
  134. if (response.statusCode >= HttpStatus.badRequest) {
  135. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  136. }
  137. // When a remote server returns no body with a status of 204, we shall not decode it.
  138. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  139. // FormatException when trying to decode an empty string.
  140. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  141. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  142. }
  143. return null;
  144. }
  145. ///
  146. ///
  147. /// Note: This method returns the HTTP [Response].
  148. ///
  149. /// Parameters:
  150. ///
  151. /// * [DeleteAssetDto] deleteAssetDto (required):
  152. Future<Response> deleteAssetWithHttpInfo(DeleteAssetDto deleteAssetDto,) async {
  153. // ignore: prefer_const_declarations
  154. final path = r'/asset';
  155. // ignore: prefer_final_locals
  156. Object? postBody = deleteAssetDto;
  157. final queryParams = <QueryParam>[];
  158. final headerParams = <String, String>{};
  159. final formParams = <String, String>{};
  160. const contentTypes = <String>['application/json'];
  161. return apiClient.invokeAPI(
  162. path,
  163. 'DELETE',
  164. queryParams,
  165. postBody,
  166. headerParams,
  167. formParams,
  168. contentTypes.isEmpty ? null : contentTypes.first,
  169. );
  170. }
  171. ///
  172. ///
  173. /// Parameters:
  174. ///
  175. /// * [DeleteAssetDto] deleteAssetDto (required):
  176. Future<List<DeleteAssetResponseDto>?> deleteAsset(DeleteAssetDto deleteAssetDto,) async {
  177. final response = await deleteAssetWithHttpInfo(deleteAssetDto,);
  178. if (response.statusCode >= HttpStatus.badRequest) {
  179. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  180. }
  181. // When a remote server returns no body with a status of 204, we shall not decode it.
  182. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  183. // FormatException when trying to decode an empty string.
  184. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  185. final responseBody = await _decodeBodyBytes(response);
  186. return (await apiClient.deserializeAsync(responseBody, 'List<DeleteAssetResponseDto>') as List)
  187. .cast<DeleteAssetResponseDto>()
  188. .toList();
  189. }
  190. return null;
  191. }
  192. ///
  193. ///
  194. /// Note: This method returns the HTTP [Response].
  195. ///
  196. /// Parameters:
  197. ///
  198. /// * [String] assetId (required):
  199. ///
  200. /// * [bool] isThumb:
  201. ///
  202. /// * [bool] isWeb:
  203. Future<Response> downloadFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, }) async {
  204. // ignore: prefer_const_declarations
  205. final path = r'/asset/download/{assetId}'
  206. .replaceAll('{assetId}', assetId);
  207. // ignore: prefer_final_locals
  208. Object? postBody;
  209. final queryParams = <QueryParam>[];
  210. final headerParams = <String, String>{};
  211. final formParams = <String, String>{};
  212. if (isThumb != null) {
  213. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  214. }
  215. if (isWeb != null) {
  216. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  217. }
  218. const contentTypes = <String>[];
  219. return apiClient.invokeAPI(
  220. path,
  221. 'GET',
  222. queryParams,
  223. postBody,
  224. headerParams,
  225. formParams,
  226. contentTypes.isEmpty ? null : contentTypes.first,
  227. );
  228. }
  229. ///
  230. ///
  231. /// Parameters:
  232. ///
  233. /// * [String] assetId (required):
  234. ///
  235. /// * [bool] isThumb:
  236. ///
  237. /// * [bool] isWeb:
  238. Future<Object?> downloadFile(String assetId, { bool? isThumb, bool? isWeb, }) async {
  239. final response = await downloadFileWithHttpInfo(assetId, isThumb: isThumb, isWeb: isWeb, );
  240. if (response.statusCode >= HttpStatus.badRequest) {
  241. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  242. }
  243. // When a remote server returns no body with a status of 204, we shall not decode it.
  244. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  245. // FormatException when trying to decode an empty string.
  246. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  247. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  248. }
  249. return null;
  250. }
  251. ///
  252. ///
  253. /// Note: This method returns the HTTP [Response].
  254. ///
  255. /// Parameters:
  256. ///
  257. /// * [DownloadFilesDto] downloadFilesDto (required):
  258. Future<Response> downloadFilesWithHttpInfo(DownloadFilesDto downloadFilesDto,) async {
  259. // ignore: prefer_const_declarations
  260. final path = r'/asset/download-files';
  261. // ignore: prefer_final_locals
  262. Object? postBody = downloadFilesDto;
  263. final queryParams = <QueryParam>[];
  264. final headerParams = <String, String>{};
  265. final formParams = <String, String>{};
  266. const contentTypes = <String>['application/json'];
  267. return apiClient.invokeAPI(
  268. path,
  269. 'POST',
  270. queryParams,
  271. postBody,
  272. headerParams,
  273. formParams,
  274. contentTypes.isEmpty ? null : contentTypes.first,
  275. );
  276. }
  277. ///
  278. ///
  279. /// Parameters:
  280. ///
  281. /// * [DownloadFilesDto] downloadFilesDto (required):
  282. Future<Object?> downloadFiles(DownloadFilesDto downloadFilesDto,) async {
  283. final response = await downloadFilesWithHttpInfo(downloadFilesDto,);
  284. if (response.statusCode >= HttpStatus.badRequest) {
  285. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  286. }
  287. // When a remote server returns no body with a status of 204, we shall not decode it.
  288. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  289. // FormatException when trying to decode an empty string.
  290. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  291. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  292. }
  293. return null;
  294. }
  295. /// Current this is not used in any UI element
  296. ///
  297. /// Note: This method returns the HTTP [Response].
  298. ///
  299. /// Parameters:
  300. ///
  301. /// * [num] skip:
  302. Future<Response> downloadLibraryWithHttpInfo({ num? skip, }) async {
  303. // ignore: prefer_const_declarations
  304. final path = r'/asset/download-library';
  305. // ignore: prefer_final_locals
  306. Object? postBody;
  307. final queryParams = <QueryParam>[];
  308. final headerParams = <String, String>{};
  309. final formParams = <String, String>{};
  310. if (skip != null) {
  311. queryParams.addAll(_queryParams('', 'skip', skip));
  312. }
  313. const contentTypes = <String>[];
  314. return apiClient.invokeAPI(
  315. path,
  316. 'GET',
  317. queryParams,
  318. postBody,
  319. headerParams,
  320. formParams,
  321. contentTypes.isEmpty ? null : contentTypes.first,
  322. );
  323. }
  324. /// Current this is not used in any UI element
  325. ///
  326. /// Parameters:
  327. ///
  328. /// * [num] skip:
  329. Future<Object?> downloadLibrary({ num? skip, }) async {
  330. final response = await downloadLibraryWithHttpInfo( skip: skip, );
  331. if (response.statusCode >= HttpStatus.badRequest) {
  332. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  333. }
  334. // When a remote server returns no body with a status of 204, we shall not decode it.
  335. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  336. // FormatException when trying to decode an empty string.
  337. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  338. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  339. }
  340. return null;
  341. }
  342. /// Get all AssetEntity belong to the user
  343. ///
  344. /// Note: This method returns the HTTP [Response].
  345. ///
  346. /// Parameters:
  347. ///
  348. /// * [bool] isFavorite:
  349. ///
  350. /// * [num] skip:
  351. ///
  352. /// * [String] ifNoneMatch:
  353. /// ETag of data already cached on the client
  354. Future<Response> getAllAssetsWithHttpInfo({ bool? isFavorite, num? skip, String? ifNoneMatch, }) async {
  355. // ignore: prefer_const_declarations
  356. final path = r'/asset';
  357. // ignore: prefer_final_locals
  358. Object? postBody;
  359. final queryParams = <QueryParam>[];
  360. final headerParams = <String, String>{};
  361. final formParams = <String, String>{};
  362. if (isFavorite != null) {
  363. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  364. }
  365. if (skip != null) {
  366. queryParams.addAll(_queryParams('', 'skip', skip));
  367. }
  368. if (ifNoneMatch != null) {
  369. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  370. }
  371. const contentTypes = <String>[];
  372. return apiClient.invokeAPI(
  373. path,
  374. 'GET',
  375. queryParams,
  376. postBody,
  377. headerParams,
  378. formParams,
  379. contentTypes.isEmpty ? null : contentTypes.first,
  380. );
  381. }
  382. /// Get all AssetEntity belong to the user
  383. ///
  384. /// Parameters:
  385. ///
  386. /// * [bool] isFavorite:
  387. ///
  388. /// * [num] skip:
  389. ///
  390. /// * [String] ifNoneMatch:
  391. /// ETag of data already cached on the client
  392. Future<List<AssetResponseDto>?> getAllAssets({ bool? isFavorite, num? skip, String? ifNoneMatch, }) async {
  393. final response = await getAllAssetsWithHttpInfo( isFavorite: isFavorite, skip: skip, ifNoneMatch: ifNoneMatch, );
  394. if (response.statusCode >= HttpStatus.badRequest) {
  395. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  396. }
  397. // When a remote server returns no body with a status of 204, we shall not decode it.
  398. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  399. // FormatException when trying to decode an empty string.
  400. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  401. final responseBody = await _decodeBodyBytes(response);
  402. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  403. .cast<AssetResponseDto>()
  404. .toList();
  405. }
  406. return null;
  407. }
  408. /// Get a single asset's information
  409. ///
  410. /// Note: This method returns the HTTP [Response].
  411. ///
  412. /// Parameters:
  413. ///
  414. /// * [String] assetId (required):
  415. Future<Response> getAssetByIdWithHttpInfo(String assetId,) async {
  416. // ignore: prefer_const_declarations
  417. final path = r'/asset/assetById/{assetId}'
  418. .replaceAll('{assetId}', assetId);
  419. // ignore: prefer_final_locals
  420. Object? postBody;
  421. final queryParams = <QueryParam>[];
  422. final headerParams = <String, String>{};
  423. final formParams = <String, String>{};
  424. const contentTypes = <String>[];
  425. return apiClient.invokeAPI(
  426. path,
  427. 'GET',
  428. queryParams,
  429. postBody,
  430. headerParams,
  431. formParams,
  432. contentTypes.isEmpty ? null : contentTypes.first,
  433. );
  434. }
  435. /// Get a single asset's information
  436. ///
  437. /// Parameters:
  438. ///
  439. /// * [String] assetId (required):
  440. Future<AssetResponseDto?> getAssetById(String assetId,) async {
  441. final response = await getAssetByIdWithHttpInfo(assetId,);
  442. if (response.statusCode >= HttpStatus.badRequest) {
  443. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  444. }
  445. // When a remote server returns no body with a status of 204, we shall not decode it.
  446. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  447. // FormatException when trying to decode an empty string.
  448. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  449. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  450. }
  451. return null;
  452. }
  453. ///
  454. ///
  455. /// Note: This method returns the HTTP [Response].
  456. ///
  457. /// Parameters:
  458. ///
  459. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  460. Future<Response> getAssetByTimeBucketWithHttpInfo(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  461. // ignore: prefer_const_declarations
  462. final path = r'/asset/time-bucket';
  463. // ignore: prefer_final_locals
  464. Object? postBody = getAssetByTimeBucketDto;
  465. final queryParams = <QueryParam>[];
  466. final headerParams = <String, String>{};
  467. final formParams = <String, String>{};
  468. const contentTypes = <String>['application/json'];
  469. return apiClient.invokeAPI(
  470. path,
  471. 'POST',
  472. queryParams,
  473. postBody,
  474. headerParams,
  475. formParams,
  476. contentTypes.isEmpty ? null : contentTypes.first,
  477. );
  478. }
  479. ///
  480. ///
  481. /// Parameters:
  482. ///
  483. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  484. Future<List<AssetResponseDto>?> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  485. final response = await getAssetByTimeBucketWithHttpInfo(getAssetByTimeBucketDto,);
  486. if (response.statusCode >= HttpStatus.badRequest) {
  487. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  488. }
  489. // When a remote server returns no body with a status of 204, we shall not decode it.
  490. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  491. // FormatException when trying to decode an empty string.
  492. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  493. final responseBody = await _decodeBodyBytes(response);
  494. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  495. .cast<AssetResponseDto>()
  496. .toList();
  497. }
  498. return null;
  499. }
  500. ///
  501. ///
  502. /// Note: This method returns the HTTP [Response].
  503. ///
  504. /// Parameters:
  505. ///
  506. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  507. Future<Response> getAssetCountByTimeBucketWithHttpInfo(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  508. // ignore: prefer_const_declarations
  509. final path = r'/asset/count-by-time-bucket';
  510. // ignore: prefer_final_locals
  511. Object? postBody = getAssetCountByTimeBucketDto;
  512. final queryParams = <QueryParam>[];
  513. final headerParams = <String, String>{};
  514. final formParams = <String, String>{};
  515. const contentTypes = <String>['application/json'];
  516. return apiClient.invokeAPI(
  517. path,
  518. 'POST',
  519. queryParams,
  520. postBody,
  521. headerParams,
  522. formParams,
  523. contentTypes.isEmpty ? null : contentTypes.first,
  524. );
  525. }
  526. ///
  527. ///
  528. /// Parameters:
  529. ///
  530. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  531. Future<AssetCountByTimeBucketResponseDto?> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  532. final response = await getAssetCountByTimeBucketWithHttpInfo(getAssetCountByTimeBucketDto,);
  533. if (response.statusCode >= HttpStatus.badRequest) {
  534. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  535. }
  536. // When a remote server returns no body with a status of 204, we shall not decode it.
  537. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  538. // FormatException when trying to decode an empty string.
  539. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  540. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByTimeBucketResponseDto',) as AssetCountByTimeBucketResponseDto;
  541. }
  542. return null;
  543. }
  544. ///
  545. ///
  546. /// Note: This method returns the HTTP [Response].
  547. Future<Response> getAssetCountByUserIdWithHttpInfo() async {
  548. // ignore: prefer_const_declarations
  549. final path = r'/asset/count-by-user-id';
  550. // ignore: prefer_final_locals
  551. Object? postBody;
  552. final queryParams = <QueryParam>[];
  553. final headerParams = <String, String>{};
  554. final formParams = <String, String>{};
  555. const contentTypes = <String>[];
  556. return apiClient.invokeAPI(
  557. path,
  558. 'GET',
  559. queryParams,
  560. postBody,
  561. headerParams,
  562. formParams,
  563. contentTypes.isEmpty ? null : contentTypes.first,
  564. );
  565. }
  566. ///
  567. Future<AssetCountByUserIdResponseDto?> getAssetCountByUserId() async {
  568. final response = await getAssetCountByUserIdWithHttpInfo();
  569. if (response.statusCode >= HttpStatus.badRequest) {
  570. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  571. }
  572. // When a remote server returns no body with a status of 204, we shall not decode it.
  573. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  574. // FormatException when trying to decode an empty string.
  575. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  576. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  577. }
  578. return null;
  579. }
  580. ///
  581. ///
  582. /// Note: This method returns the HTTP [Response].
  583. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  584. // ignore: prefer_const_declarations
  585. final path = r'/asset/search-terms';
  586. // ignore: prefer_final_locals
  587. Object? postBody;
  588. final queryParams = <QueryParam>[];
  589. final headerParams = <String, String>{};
  590. final formParams = <String, String>{};
  591. const contentTypes = <String>[];
  592. return apiClient.invokeAPI(
  593. path,
  594. 'GET',
  595. queryParams,
  596. postBody,
  597. headerParams,
  598. formParams,
  599. contentTypes.isEmpty ? null : contentTypes.first,
  600. );
  601. }
  602. ///
  603. Future<List<String>?> getAssetSearchTerms() async {
  604. final response = await getAssetSearchTermsWithHttpInfo();
  605. if (response.statusCode >= HttpStatus.badRequest) {
  606. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  607. }
  608. // When a remote server returns no body with a status of 204, we shall not decode it.
  609. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  610. // FormatException when trying to decode an empty string.
  611. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  612. final responseBody = await _decodeBodyBytes(response);
  613. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  614. .cast<String>()
  615. .toList();
  616. }
  617. return null;
  618. }
  619. ///
  620. ///
  621. /// Note: This method returns the HTTP [Response].
  622. ///
  623. /// Parameters:
  624. ///
  625. /// * [String] assetId (required):
  626. ///
  627. /// * [ThumbnailFormat] format:
  628. Future<Response> getAssetThumbnailWithHttpInfo(String assetId, { ThumbnailFormat? format, }) async {
  629. // ignore: prefer_const_declarations
  630. final path = r'/asset/thumbnail/{assetId}'
  631. .replaceAll('{assetId}', assetId);
  632. // ignore: prefer_final_locals
  633. Object? postBody;
  634. final queryParams = <QueryParam>[];
  635. final headerParams = <String, String>{};
  636. final formParams = <String, String>{};
  637. if (format != null) {
  638. queryParams.addAll(_queryParams('', 'format', format));
  639. }
  640. const contentTypes = <String>[];
  641. return apiClient.invokeAPI(
  642. path,
  643. 'GET',
  644. queryParams,
  645. postBody,
  646. headerParams,
  647. formParams,
  648. contentTypes.isEmpty ? null : contentTypes.first,
  649. );
  650. }
  651. ///
  652. ///
  653. /// Parameters:
  654. ///
  655. /// * [String] assetId (required):
  656. ///
  657. /// * [ThumbnailFormat] format:
  658. Future<Object?> getAssetThumbnail(String assetId, { ThumbnailFormat? format, }) async {
  659. final response = await getAssetThumbnailWithHttpInfo(assetId, format: format, );
  660. if (response.statusCode >= HttpStatus.badRequest) {
  661. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  662. }
  663. // When a remote server returns no body with a status of 204, we shall not decode it.
  664. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  665. // FormatException when trying to decode an empty string.
  666. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  667. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  668. }
  669. return null;
  670. }
  671. ///
  672. ///
  673. /// Note: This method returns the HTTP [Response].
  674. Future<Response> getCuratedLocationsWithHttpInfo() async {
  675. // ignore: prefer_const_declarations
  676. final path = r'/asset/curated-locations';
  677. // ignore: prefer_final_locals
  678. Object? postBody;
  679. final queryParams = <QueryParam>[];
  680. final headerParams = <String, String>{};
  681. final formParams = <String, String>{};
  682. const contentTypes = <String>[];
  683. return apiClient.invokeAPI(
  684. path,
  685. 'GET',
  686. queryParams,
  687. postBody,
  688. headerParams,
  689. formParams,
  690. contentTypes.isEmpty ? null : contentTypes.first,
  691. );
  692. }
  693. ///
  694. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  695. final response = await getCuratedLocationsWithHttpInfo();
  696. if (response.statusCode >= HttpStatus.badRequest) {
  697. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  698. }
  699. // When a remote server returns no body with a status of 204, we shall not decode it.
  700. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  701. // FormatException when trying to decode an empty string.
  702. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  703. final responseBody = await _decodeBodyBytes(response);
  704. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  705. .cast<CuratedLocationsResponseDto>()
  706. .toList();
  707. }
  708. return null;
  709. }
  710. ///
  711. ///
  712. /// Note: This method returns the HTTP [Response].
  713. Future<Response> getCuratedObjectsWithHttpInfo() async {
  714. // ignore: prefer_const_declarations
  715. final path = r'/asset/curated-objects';
  716. // ignore: prefer_final_locals
  717. Object? postBody;
  718. final queryParams = <QueryParam>[];
  719. final headerParams = <String, String>{};
  720. final formParams = <String, String>{};
  721. const contentTypes = <String>[];
  722. return apiClient.invokeAPI(
  723. path,
  724. 'GET',
  725. queryParams,
  726. postBody,
  727. headerParams,
  728. formParams,
  729. contentTypes.isEmpty ? null : contentTypes.first,
  730. );
  731. }
  732. ///
  733. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  734. final response = await getCuratedObjectsWithHttpInfo();
  735. if (response.statusCode >= HttpStatus.badRequest) {
  736. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  737. }
  738. // When a remote server returns no body with a status of 204, we shall not decode it.
  739. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  740. // FormatException when trying to decode an empty string.
  741. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  742. final responseBody = await _decodeBodyBytes(response);
  743. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  744. .cast<CuratedObjectsResponseDto>()
  745. .toList();
  746. }
  747. return null;
  748. }
  749. /// Get all asset of a device that are in the database, ID only.
  750. ///
  751. /// Note: This method returns the HTTP [Response].
  752. ///
  753. /// Parameters:
  754. ///
  755. /// * [String] deviceId (required):
  756. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  757. // ignore: prefer_const_declarations
  758. final path = r'/asset/{deviceId}'
  759. .replaceAll('{deviceId}', deviceId);
  760. // ignore: prefer_final_locals
  761. Object? postBody;
  762. final queryParams = <QueryParam>[];
  763. final headerParams = <String, String>{};
  764. final formParams = <String, String>{};
  765. const contentTypes = <String>[];
  766. return apiClient.invokeAPI(
  767. path,
  768. 'GET',
  769. queryParams,
  770. postBody,
  771. headerParams,
  772. formParams,
  773. contentTypes.isEmpty ? null : contentTypes.first,
  774. );
  775. }
  776. /// Get all asset of a device that are in the database, ID only.
  777. ///
  778. /// Parameters:
  779. ///
  780. /// * [String] deviceId (required):
  781. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  782. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  783. if (response.statusCode >= HttpStatus.badRequest) {
  784. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  785. }
  786. // When a remote server returns no body with a status of 204, we shall not decode it.
  787. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  788. // FormatException when trying to decode an empty string.
  789. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  790. final responseBody = await _decodeBodyBytes(response);
  791. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  792. .cast<String>()
  793. .toList();
  794. }
  795. return null;
  796. }
  797. ///
  798. ///
  799. /// Note: This method returns the HTTP [Response].
  800. ///
  801. /// Parameters:
  802. ///
  803. /// * [SearchAssetDto] searchAssetDto (required):
  804. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  805. // ignore: prefer_const_declarations
  806. final path = r'/asset/search';
  807. // ignore: prefer_final_locals
  808. Object? postBody = searchAssetDto;
  809. final queryParams = <QueryParam>[];
  810. final headerParams = <String, String>{};
  811. final formParams = <String, String>{};
  812. const contentTypes = <String>['application/json'];
  813. return apiClient.invokeAPI(
  814. path,
  815. 'POST',
  816. queryParams,
  817. postBody,
  818. headerParams,
  819. formParams,
  820. contentTypes.isEmpty ? null : contentTypes.first,
  821. );
  822. }
  823. ///
  824. ///
  825. /// Parameters:
  826. ///
  827. /// * [SearchAssetDto] searchAssetDto (required):
  828. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  829. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  830. if (response.statusCode >= HttpStatus.badRequest) {
  831. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  832. }
  833. // When a remote server returns no body with a status of 204, we shall not decode it.
  834. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  835. // FormatException when trying to decode an empty string.
  836. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  837. final responseBody = await _decodeBodyBytes(response);
  838. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  839. .cast<AssetResponseDto>()
  840. .toList();
  841. }
  842. return null;
  843. }
  844. ///
  845. ///
  846. /// Note: This method returns the HTTP [Response].
  847. ///
  848. /// Parameters:
  849. ///
  850. /// * [String] assetId (required):
  851. ///
  852. /// * [bool] isThumb:
  853. ///
  854. /// * [bool] isWeb:
  855. Future<Response> serveFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, }) async {
  856. // ignore: prefer_const_declarations
  857. final path = r'/asset/file/{assetId}'
  858. .replaceAll('{assetId}', assetId);
  859. // ignore: prefer_final_locals
  860. Object? postBody;
  861. final queryParams = <QueryParam>[];
  862. final headerParams = <String, String>{};
  863. final formParams = <String, String>{};
  864. if (isThumb != null) {
  865. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  866. }
  867. if (isWeb != null) {
  868. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  869. }
  870. const contentTypes = <String>[];
  871. return apiClient.invokeAPI(
  872. path,
  873. 'GET',
  874. queryParams,
  875. postBody,
  876. headerParams,
  877. formParams,
  878. contentTypes.isEmpty ? null : contentTypes.first,
  879. );
  880. }
  881. ///
  882. ///
  883. /// Parameters:
  884. ///
  885. /// * [String] assetId (required):
  886. ///
  887. /// * [bool] isThumb:
  888. ///
  889. /// * [bool] isWeb:
  890. Future<Object?> serveFile(String assetId, { bool? isThumb, bool? isWeb, }) async {
  891. final response = await serveFileWithHttpInfo(assetId, isThumb: isThumb, isWeb: isWeb, );
  892. if (response.statusCode >= HttpStatus.badRequest) {
  893. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  894. }
  895. // When a remote server returns no body with a status of 204, we shall not decode it.
  896. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  897. // FormatException when trying to decode an empty string.
  898. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  899. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  900. }
  901. return null;
  902. }
  903. /// Update an asset
  904. ///
  905. /// Note: This method returns the HTTP [Response].
  906. ///
  907. /// Parameters:
  908. ///
  909. /// * [String] assetId (required):
  910. ///
  911. /// * [UpdateAssetDto] updateAssetDto (required):
  912. Future<Response> updateAssetWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
  913. // ignore: prefer_const_declarations
  914. final path = r'/asset/{assetId}'
  915. .replaceAll('{assetId}', assetId);
  916. // ignore: prefer_final_locals
  917. Object? postBody = updateAssetDto;
  918. final queryParams = <QueryParam>[];
  919. final headerParams = <String, String>{};
  920. final formParams = <String, String>{};
  921. const contentTypes = <String>['application/json'];
  922. return apiClient.invokeAPI(
  923. path,
  924. 'PUT',
  925. queryParams,
  926. postBody,
  927. headerParams,
  928. formParams,
  929. contentTypes.isEmpty ? null : contentTypes.first,
  930. );
  931. }
  932. /// Update an asset
  933. ///
  934. /// Parameters:
  935. ///
  936. /// * [String] assetId (required):
  937. ///
  938. /// * [UpdateAssetDto] updateAssetDto (required):
  939. Future<AssetResponseDto?> updateAsset(String assetId, UpdateAssetDto updateAssetDto,) async {
  940. final response = await updateAssetWithHttpInfo(assetId, updateAssetDto,);
  941. if (response.statusCode >= HttpStatus.badRequest) {
  942. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  943. }
  944. // When a remote server returns no body with a status of 204, we shall not decode it.
  945. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  946. // FormatException when trying to decode an empty string.
  947. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  948. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  949. }
  950. return null;
  951. }
  952. ///
  953. ///
  954. /// Note: This method returns the HTTP [Response].
  955. ///
  956. /// Parameters:
  957. ///
  958. /// * [UpdateAssetsToSharedLinkDto] updateAssetsToSharedLinkDto (required):
  959. Future<Response> updateAssetsInSharedLinkWithHttpInfo(UpdateAssetsToSharedLinkDto updateAssetsToSharedLinkDto,) async {
  960. // ignore: prefer_const_declarations
  961. final path = r'/asset/shared-link';
  962. // ignore: prefer_final_locals
  963. Object? postBody = updateAssetsToSharedLinkDto;
  964. final queryParams = <QueryParam>[];
  965. final headerParams = <String, String>{};
  966. final formParams = <String, String>{};
  967. const contentTypes = <String>['application/json'];
  968. return apiClient.invokeAPI(
  969. path,
  970. 'PATCH',
  971. queryParams,
  972. postBody,
  973. headerParams,
  974. formParams,
  975. contentTypes.isEmpty ? null : contentTypes.first,
  976. );
  977. }
  978. ///
  979. ///
  980. /// Parameters:
  981. ///
  982. /// * [UpdateAssetsToSharedLinkDto] updateAssetsToSharedLinkDto (required):
  983. Future<SharedLinkResponseDto?> updateAssetsInSharedLink(UpdateAssetsToSharedLinkDto updateAssetsToSharedLinkDto,) async {
  984. final response = await updateAssetsInSharedLinkWithHttpInfo(updateAssetsToSharedLinkDto,);
  985. if (response.statusCode >= HttpStatus.badRequest) {
  986. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  987. }
  988. // When a remote server returns no body with a status of 204, we shall not decode it.
  989. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  990. // FormatException when trying to decode an empty string.
  991. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  992. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  993. }
  994. return null;
  995. }
  996. ///
  997. ///
  998. /// Note: This method returns the HTTP [Response].
  999. ///
  1000. /// Parameters:
  1001. ///
  1002. /// * [MultipartFile] assetData (required):
  1003. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData,) async {
  1004. // ignore: prefer_const_declarations
  1005. final path = r'/asset/upload';
  1006. // ignore: prefer_final_locals
  1007. Object? postBody;
  1008. final queryParams = <QueryParam>[];
  1009. final headerParams = <String, String>{};
  1010. final formParams = <String, String>{};
  1011. const contentTypes = <String>['multipart/form-data'];
  1012. bool hasFields = false;
  1013. final mp = MultipartRequest('POST', Uri.parse(path));
  1014. if (assetData != null) {
  1015. hasFields = true;
  1016. mp.fields[r'assetData'] = assetData.field;
  1017. mp.files.add(assetData);
  1018. }
  1019. if (hasFields) {
  1020. postBody = mp;
  1021. }
  1022. return apiClient.invokeAPI(
  1023. path,
  1024. 'POST',
  1025. queryParams,
  1026. postBody,
  1027. headerParams,
  1028. formParams,
  1029. contentTypes.isEmpty ? null : contentTypes.first,
  1030. );
  1031. }
  1032. ///
  1033. ///
  1034. /// Parameters:
  1035. ///
  1036. /// * [MultipartFile] assetData (required):
  1037. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData,) async {
  1038. final response = await uploadFileWithHttpInfo(assetData,);
  1039. if (response.statusCode >= HttpStatus.badRequest) {
  1040. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1041. }
  1042. // When a remote server returns no body with a status of 204, we shall not decode it.
  1043. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1044. // FormatException when trying to decode an empty string.
  1045. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1046. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1047. }
  1048. return null;
  1049. }
  1050. }