asset_api.dart 53 KB

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