asset_api.dart 48 KB

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