asset_api.dart 48 KB

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