asset_api.dart 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  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. ///
  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. ///
  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. /// * [String] ifNoneMatch:
  349. /// ETag of data already cached on the client
  350. Future<Response> getAllAssetsWithHttpInfo({ String? ifNoneMatch, }) async {
  351. // ignore: prefer_const_declarations
  352. final path = r'/asset';
  353. // ignore: prefer_final_locals
  354. Object? postBody;
  355. final queryParams = <QueryParam>[];
  356. final headerParams = <String, String>{};
  357. final formParams = <String, String>{};
  358. if (ifNoneMatch != null) {
  359. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  360. }
  361. const contentTypes = <String>[];
  362. return apiClient.invokeAPI(
  363. path,
  364. 'GET',
  365. queryParams,
  366. postBody,
  367. headerParams,
  368. formParams,
  369. contentTypes.isEmpty ? null : contentTypes.first,
  370. );
  371. }
  372. /// Get all AssetEntity belong to the user
  373. ///
  374. /// Parameters:
  375. ///
  376. /// * [String] ifNoneMatch:
  377. /// ETag of data already cached on the client
  378. Future<List<AssetResponseDto>?> getAllAssets({ String? ifNoneMatch, }) async {
  379. final response = await getAllAssetsWithHttpInfo( ifNoneMatch: ifNoneMatch, );
  380. if (response.statusCode >= HttpStatus.badRequest) {
  381. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  382. }
  383. // When a remote server returns no body with a status of 204, we shall not decode it.
  384. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  385. // FormatException when trying to decode an empty string.
  386. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  387. final responseBody = await _decodeBodyBytes(response);
  388. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  389. .cast<AssetResponseDto>()
  390. .toList();
  391. }
  392. return null;
  393. }
  394. /// Get a single asset's information
  395. ///
  396. /// Note: This method returns the HTTP [Response].
  397. ///
  398. /// Parameters:
  399. ///
  400. /// * [String] assetId (required):
  401. Future<Response> getAssetByIdWithHttpInfo(String assetId,) async {
  402. // ignore: prefer_const_declarations
  403. final path = r'/asset/assetById/{assetId}'
  404. .replaceAll('{assetId}', assetId);
  405. // ignore: prefer_final_locals
  406. Object? postBody;
  407. final queryParams = <QueryParam>[];
  408. final headerParams = <String, String>{};
  409. final formParams = <String, String>{};
  410. const contentTypes = <String>[];
  411. return apiClient.invokeAPI(
  412. path,
  413. 'GET',
  414. queryParams,
  415. postBody,
  416. headerParams,
  417. formParams,
  418. contentTypes.isEmpty ? null : contentTypes.first,
  419. );
  420. }
  421. /// Get a single asset's information
  422. ///
  423. /// Parameters:
  424. ///
  425. /// * [String] assetId (required):
  426. Future<AssetResponseDto?> getAssetById(String assetId,) async {
  427. final response = await getAssetByIdWithHttpInfo(assetId,);
  428. if (response.statusCode >= HttpStatus.badRequest) {
  429. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  430. }
  431. // When a remote server returns no body with a status of 204, we shall not decode it.
  432. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  433. // FormatException when trying to decode an empty string.
  434. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  435. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  436. }
  437. return null;
  438. }
  439. ///
  440. ///
  441. /// Note: This method returns the HTTP [Response].
  442. ///
  443. /// Parameters:
  444. ///
  445. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  446. Future<Response> getAssetByTimeBucketWithHttpInfo(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  447. // ignore: prefer_const_declarations
  448. final path = r'/asset/time-bucket';
  449. // ignore: prefer_final_locals
  450. Object? postBody = getAssetByTimeBucketDto;
  451. final queryParams = <QueryParam>[];
  452. final headerParams = <String, String>{};
  453. final formParams = <String, String>{};
  454. const contentTypes = <String>['application/json'];
  455. return apiClient.invokeAPI(
  456. path,
  457. 'POST',
  458. queryParams,
  459. postBody,
  460. headerParams,
  461. formParams,
  462. contentTypes.isEmpty ? null : contentTypes.first,
  463. );
  464. }
  465. ///
  466. ///
  467. /// Parameters:
  468. ///
  469. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  470. Future<List<AssetResponseDto>?> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  471. final response = await getAssetByTimeBucketWithHttpInfo(getAssetByTimeBucketDto,);
  472. if (response.statusCode >= HttpStatus.badRequest) {
  473. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  474. }
  475. // When a remote server returns no body with a status of 204, we shall not decode it.
  476. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  477. // FormatException when trying to decode an empty string.
  478. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  479. final responseBody = await _decodeBodyBytes(response);
  480. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  481. .cast<AssetResponseDto>()
  482. .toList();
  483. }
  484. return null;
  485. }
  486. ///
  487. ///
  488. /// Note: This method returns the HTTP [Response].
  489. ///
  490. /// Parameters:
  491. ///
  492. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  493. Future<Response> getAssetCountByTimeBucketWithHttpInfo(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  494. // ignore: prefer_const_declarations
  495. final path = r'/asset/count-by-time-bucket';
  496. // ignore: prefer_final_locals
  497. Object? postBody = getAssetCountByTimeBucketDto;
  498. final queryParams = <QueryParam>[];
  499. final headerParams = <String, String>{};
  500. final formParams = <String, String>{};
  501. const contentTypes = <String>['application/json'];
  502. return apiClient.invokeAPI(
  503. path,
  504. 'POST',
  505. queryParams,
  506. postBody,
  507. headerParams,
  508. formParams,
  509. contentTypes.isEmpty ? null : contentTypes.first,
  510. );
  511. }
  512. ///
  513. ///
  514. /// Parameters:
  515. ///
  516. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  517. Future<AssetCountByTimeBucketResponseDto?> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  518. final response = await getAssetCountByTimeBucketWithHttpInfo(getAssetCountByTimeBucketDto,);
  519. if (response.statusCode >= HttpStatus.badRequest) {
  520. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  521. }
  522. // When a remote server returns no body with a status of 204, we shall not decode it.
  523. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  524. // FormatException when trying to decode an empty string.
  525. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  526. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByTimeBucketResponseDto',) as AssetCountByTimeBucketResponseDto;
  527. }
  528. return null;
  529. }
  530. ///
  531. ///
  532. /// Note: This method returns the HTTP [Response].
  533. Future<Response> getAssetCountByUserIdWithHttpInfo() async {
  534. // ignore: prefer_const_declarations
  535. final path = r'/asset/count-by-user-id';
  536. // ignore: prefer_final_locals
  537. Object? postBody;
  538. final queryParams = <QueryParam>[];
  539. final headerParams = <String, String>{};
  540. final formParams = <String, String>{};
  541. const contentTypes = <String>[];
  542. return apiClient.invokeAPI(
  543. path,
  544. 'GET',
  545. queryParams,
  546. postBody,
  547. headerParams,
  548. formParams,
  549. contentTypes.isEmpty ? null : contentTypes.first,
  550. );
  551. }
  552. ///
  553. Future<AssetCountByUserIdResponseDto?> getAssetCountByUserId() async {
  554. final response = await getAssetCountByUserIdWithHttpInfo();
  555. if (response.statusCode >= HttpStatus.badRequest) {
  556. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  557. }
  558. // When a remote server returns no body with a status of 204, we shall not decode it.
  559. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  560. // FormatException when trying to decode an empty string.
  561. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  562. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  563. }
  564. return null;
  565. }
  566. ///
  567. ///
  568. /// Note: This method returns the HTTP [Response].
  569. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  570. // ignore: prefer_const_declarations
  571. final path = r'/asset/search-terms';
  572. // ignore: prefer_final_locals
  573. Object? postBody;
  574. final queryParams = <QueryParam>[];
  575. final headerParams = <String, String>{};
  576. final formParams = <String, String>{};
  577. const contentTypes = <String>[];
  578. return apiClient.invokeAPI(
  579. path,
  580. 'GET',
  581. queryParams,
  582. postBody,
  583. headerParams,
  584. formParams,
  585. contentTypes.isEmpty ? null : contentTypes.first,
  586. );
  587. }
  588. ///
  589. Future<List<String>?> getAssetSearchTerms() async {
  590. final response = await getAssetSearchTermsWithHttpInfo();
  591. if (response.statusCode >= HttpStatus.badRequest) {
  592. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  593. }
  594. // When a remote server returns no body with a status of 204, we shall not decode it.
  595. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  596. // FormatException when trying to decode an empty string.
  597. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  598. final responseBody = await _decodeBodyBytes(response);
  599. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  600. .cast<String>()
  601. .toList();
  602. }
  603. return null;
  604. }
  605. ///
  606. ///
  607. /// Note: This method returns the HTTP [Response].
  608. ///
  609. /// Parameters:
  610. ///
  611. /// * [String] assetId (required):
  612. ///
  613. /// * [ThumbnailFormat] format:
  614. Future<Response> getAssetThumbnailWithHttpInfo(String assetId, { ThumbnailFormat? format, }) async {
  615. // ignore: prefer_const_declarations
  616. final path = r'/asset/thumbnail/{assetId}'
  617. .replaceAll('{assetId}', assetId);
  618. // ignore: prefer_final_locals
  619. Object? postBody;
  620. final queryParams = <QueryParam>[];
  621. final headerParams = <String, String>{};
  622. final formParams = <String, String>{};
  623. if (format != null) {
  624. queryParams.addAll(_queryParams('', 'format', format));
  625. }
  626. const contentTypes = <String>[];
  627. return apiClient.invokeAPI(
  628. path,
  629. 'GET',
  630. queryParams,
  631. postBody,
  632. headerParams,
  633. formParams,
  634. contentTypes.isEmpty ? null : contentTypes.first,
  635. );
  636. }
  637. ///
  638. ///
  639. /// Parameters:
  640. ///
  641. /// * [String] assetId (required):
  642. ///
  643. /// * [ThumbnailFormat] format:
  644. Future<Object?> getAssetThumbnail(String assetId, { ThumbnailFormat? format, }) async {
  645. final response = await getAssetThumbnailWithHttpInfo(assetId, format: format, );
  646. if (response.statusCode >= HttpStatus.badRequest) {
  647. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  648. }
  649. // When a remote server returns no body with a status of 204, we shall not decode it.
  650. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  651. // FormatException when trying to decode an empty string.
  652. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  653. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  654. }
  655. return null;
  656. }
  657. ///
  658. ///
  659. /// Note: This method returns the HTTP [Response].
  660. Future<Response> getCuratedLocationsWithHttpInfo() async {
  661. // ignore: prefer_const_declarations
  662. final path = r'/asset/curated-locations';
  663. // ignore: prefer_final_locals
  664. Object? postBody;
  665. final queryParams = <QueryParam>[];
  666. final headerParams = <String, String>{};
  667. final formParams = <String, String>{};
  668. const contentTypes = <String>[];
  669. return apiClient.invokeAPI(
  670. path,
  671. 'GET',
  672. queryParams,
  673. postBody,
  674. headerParams,
  675. formParams,
  676. contentTypes.isEmpty ? null : contentTypes.first,
  677. );
  678. }
  679. ///
  680. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  681. final response = await getCuratedLocationsWithHttpInfo();
  682. if (response.statusCode >= HttpStatus.badRequest) {
  683. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  684. }
  685. // When a remote server returns no body with a status of 204, we shall not decode it.
  686. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  687. // FormatException when trying to decode an empty string.
  688. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  689. final responseBody = await _decodeBodyBytes(response);
  690. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  691. .cast<CuratedLocationsResponseDto>()
  692. .toList();
  693. }
  694. return null;
  695. }
  696. ///
  697. ///
  698. /// Note: This method returns the HTTP [Response].
  699. Future<Response> getCuratedObjectsWithHttpInfo() async {
  700. // ignore: prefer_const_declarations
  701. final path = r'/asset/curated-objects';
  702. // ignore: prefer_final_locals
  703. Object? postBody;
  704. final queryParams = <QueryParam>[];
  705. final headerParams = <String, String>{};
  706. final formParams = <String, String>{};
  707. const contentTypes = <String>[];
  708. return apiClient.invokeAPI(
  709. path,
  710. 'GET',
  711. queryParams,
  712. postBody,
  713. headerParams,
  714. formParams,
  715. contentTypes.isEmpty ? null : contentTypes.first,
  716. );
  717. }
  718. ///
  719. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  720. final response = await getCuratedObjectsWithHttpInfo();
  721. if (response.statusCode >= HttpStatus.badRequest) {
  722. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  723. }
  724. // When a remote server returns no body with a status of 204, we shall not decode it.
  725. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  726. // FormatException when trying to decode an empty string.
  727. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  728. final responseBody = await _decodeBodyBytes(response);
  729. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  730. .cast<CuratedObjectsResponseDto>()
  731. .toList();
  732. }
  733. return null;
  734. }
  735. /// Get all asset of a device that are in the database, ID only.
  736. ///
  737. /// Note: This method returns the HTTP [Response].
  738. ///
  739. /// Parameters:
  740. ///
  741. /// * [String] deviceId (required):
  742. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  743. // ignore: prefer_const_declarations
  744. final path = r'/asset/{deviceId}'
  745. .replaceAll('{deviceId}', deviceId);
  746. // ignore: prefer_final_locals
  747. Object? postBody;
  748. final queryParams = <QueryParam>[];
  749. final headerParams = <String, String>{};
  750. final formParams = <String, String>{};
  751. const contentTypes = <String>[];
  752. return apiClient.invokeAPI(
  753. path,
  754. 'GET',
  755. queryParams,
  756. postBody,
  757. headerParams,
  758. formParams,
  759. contentTypes.isEmpty ? null : contentTypes.first,
  760. );
  761. }
  762. /// Get all asset of a device that are in the database, ID only.
  763. ///
  764. /// Parameters:
  765. ///
  766. /// * [String] deviceId (required):
  767. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  768. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  769. if (response.statusCode >= HttpStatus.badRequest) {
  770. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  771. }
  772. // When a remote server returns no body with a status of 204, we shall not decode it.
  773. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  774. // FormatException when trying to decode an empty string.
  775. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  776. final responseBody = await _decodeBodyBytes(response);
  777. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  778. .cast<String>()
  779. .toList();
  780. }
  781. return null;
  782. }
  783. ///
  784. ///
  785. /// Note: This method returns the HTTP [Response].
  786. ///
  787. /// Parameters:
  788. ///
  789. /// * [SearchAssetDto] searchAssetDto (required):
  790. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  791. // ignore: prefer_const_declarations
  792. final path = r'/asset/search';
  793. // ignore: prefer_final_locals
  794. Object? postBody = searchAssetDto;
  795. final queryParams = <QueryParam>[];
  796. final headerParams = <String, String>{};
  797. final formParams = <String, String>{};
  798. const contentTypes = <String>['application/json'];
  799. return apiClient.invokeAPI(
  800. path,
  801. 'POST',
  802. queryParams,
  803. postBody,
  804. headerParams,
  805. formParams,
  806. contentTypes.isEmpty ? null : contentTypes.first,
  807. );
  808. }
  809. ///
  810. ///
  811. /// Parameters:
  812. ///
  813. /// * [SearchAssetDto] searchAssetDto (required):
  814. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  815. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  816. if (response.statusCode >= HttpStatus.badRequest) {
  817. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  818. }
  819. // When a remote server returns no body with a status of 204, we shall not decode it.
  820. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  821. // FormatException when trying to decode an empty string.
  822. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  823. final responseBody = await _decodeBodyBytes(response);
  824. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  825. .cast<AssetResponseDto>()
  826. .toList();
  827. }
  828. return null;
  829. }
  830. ///
  831. ///
  832. /// Note: This method returns the HTTP [Response].
  833. ///
  834. /// Parameters:
  835. ///
  836. /// * [String] assetId (required):
  837. ///
  838. /// * [bool] isThumb:
  839. ///
  840. /// * [bool] isWeb:
  841. Future<Response> serveFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, }) async {
  842. // ignore: prefer_const_declarations
  843. final path = r'/asset/file/{assetId}'
  844. .replaceAll('{assetId}', assetId);
  845. // ignore: prefer_final_locals
  846. Object? postBody;
  847. final queryParams = <QueryParam>[];
  848. final headerParams = <String, String>{};
  849. final formParams = <String, String>{};
  850. if (isThumb != null) {
  851. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  852. }
  853. if (isWeb != null) {
  854. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  855. }
  856. const contentTypes = <String>[];
  857. return apiClient.invokeAPI(
  858. path,
  859. 'GET',
  860. queryParams,
  861. postBody,
  862. headerParams,
  863. formParams,
  864. contentTypes.isEmpty ? null : contentTypes.first,
  865. );
  866. }
  867. ///
  868. ///
  869. /// Parameters:
  870. ///
  871. /// * [String] assetId (required):
  872. ///
  873. /// * [bool] isThumb:
  874. ///
  875. /// * [bool] isWeb:
  876. Future<Object?> serveFile(String assetId, { bool? isThumb, bool? isWeb, }) async {
  877. final response = await serveFileWithHttpInfo(assetId, isThumb: isThumb, isWeb: isWeb, );
  878. if (response.statusCode >= HttpStatus.badRequest) {
  879. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  880. }
  881. // When a remote server returns no body with a status of 204, we shall not decode it.
  882. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  883. // FormatException when trying to decode an empty string.
  884. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  885. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  886. }
  887. return null;
  888. }
  889. /// Update an asset
  890. ///
  891. /// Note: This method returns the HTTP [Response].
  892. ///
  893. /// Parameters:
  894. ///
  895. /// * [String] assetId (required):
  896. ///
  897. /// * [UpdateAssetDto] updateAssetDto (required):
  898. Future<Response> updateAssetWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
  899. // ignore: prefer_const_declarations
  900. final path = r'/asset/{assetId}'
  901. .replaceAll('{assetId}', assetId);
  902. // ignore: prefer_final_locals
  903. Object? postBody = updateAssetDto;
  904. final queryParams = <QueryParam>[];
  905. final headerParams = <String, String>{};
  906. final formParams = <String, String>{};
  907. const contentTypes = <String>['application/json'];
  908. return apiClient.invokeAPI(
  909. path,
  910. 'PUT',
  911. queryParams,
  912. postBody,
  913. headerParams,
  914. formParams,
  915. contentTypes.isEmpty ? null : contentTypes.first,
  916. );
  917. }
  918. /// Update an asset
  919. ///
  920. /// Parameters:
  921. ///
  922. /// * [String] assetId (required):
  923. ///
  924. /// * [UpdateAssetDto] updateAssetDto (required):
  925. Future<AssetResponseDto?> updateAsset(String assetId, UpdateAssetDto updateAssetDto,) async {
  926. final response = await updateAssetWithHttpInfo(assetId, updateAssetDto,);
  927. if (response.statusCode >= HttpStatus.badRequest) {
  928. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  929. }
  930. // When a remote server returns no body with a status of 204, we shall not decode it.
  931. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  932. // FormatException when trying to decode an empty string.
  933. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  934. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  935. }
  936. return null;
  937. }
  938. ///
  939. ///
  940. /// Note: This method returns the HTTP [Response].
  941. ///
  942. /// Parameters:
  943. ///
  944. /// * [UpdateAssetsToSharedLinkDto] updateAssetsToSharedLinkDto (required):
  945. Future<Response> updateAssetsInSharedLinkWithHttpInfo(UpdateAssetsToSharedLinkDto updateAssetsToSharedLinkDto,) async {
  946. // ignore: prefer_const_declarations
  947. final path = r'/asset/shared-link';
  948. // ignore: prefer_final_locals
  949. Object? postBody = updateAssetsToSharedLinkDto;
  950. final queryParams = <QueryParam>[];
  951. final headerParams = <String, String>{};
  952. final formParams = <String, String>{};
  953. const contentTypes = <String>['application/json'];
  954. return apiClient.invokeAPI(
  955. path,
  956. 'PATCH',
  957. queryParams,
  958. postBody,
  959. headerParams,
  960. formParams,
  961. contentTypes.isEmpty ? null : contentTypes.first,
  962. );
  963. }
  964. ///
  965. ///
  966. /// Parameters:
  967. ///
  968. /// * [UpdateAssetsToSharedLinkDto] updateAssetsToSharedLinkDto (required):
  969. Future<SharedLinkResponseDto?> updateAssetsInSharedLink(UpdateAssetsToSharedLinkDto updateAssetsToSharedLinkDto,) async {
  970. final response = await updateAssetsInSharedLinkWithHttpInfo(updateAssetsToSharedLinkDto,);
  971. if (response.statusCode >= HttpStatus.badRequest) {
  972. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  973. }
  974. // When a remote server returns no body with a status of 204, we shall not decode it.
  975. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  976. // FormatException when trying to decode an empty string.
  977. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  978. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  979. }
  980. return null;
  981. }
  982. ///
  983. ///
  984. /// Note: This method returns the HTTP [Response].
  985. ///
  986. /// Parameters:
  987. ///
  988. /// * [MultipartFile] assetData (required):
  989. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData,) async {
  990. // ignore: prefer_const_declarations
  991. final path = r'/asset/upload';
  992. // ignore: prefer_final_locals
  993. Object? postBody;
  994. final queryParams = <QueryParam>[];
  995. final headerParams = <String, String>{};
  996. final formParams = <String, String>{};
  997. const contentTypes = <String>['multipart/form-data'];
  998. bool hasFields = false;
  999. final mp = MultipartRequest('POST', Uri.parse(path));
  1000. if (assetData != null) {
  1001. hasFields = true;
  1002. mp.fields[r'assetData'] = assetData.field;
  1003. mp.files.add(assetData);
  1004. }
  1005. if (hasFields) {
  1006. postBody = mp;
  1007. }
  1008. return apiClient.invokeAPI(
  1009. path,
  1010. 'POST',
  1011. queryParams,
  1012. postBody,
  1013. headerParams,
  1014. formParams,
  1015. contentTypes.isEmpty ? null : contentTypes.first,
  1016. );
  1017. }
  1018. ///
  1019. ///
  1020. /// Parameters:
  1021. ///
  1022. /// * [MultipartFile] assetData (required):
  1023. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData,) async {
  1024. final response = await uploadFileWithHttpInfo(assetData,);
  1025. if (response.statusCode >= HttpStatus.badRequest) {
  1026. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1027. }
  1028. // When a remote server returns no body with a status of 204, we shall not decode it.
  1029. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1030. // FormatException when trying to decode an empty string.
  1031. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1032. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1033. }
  1034. return null;
  1035. }
  1036. }