asset_api.dart 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710
  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/archive' 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/archive';
  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. /// * [num] skip:
  300. ///
  301. /// * [DateTime] updatedAfter:
  302. ///
  303. /// * [String] ifNoneMatch:
  304. /// ETag of data already cached on the client
  305. Future<Response> getAllAssetsWithHttpInfo({ String? userId, bool? isFavorite, bool? isArchived, num? skip, DateTime? updatedAfter, String? ifNoneMatch, }) async {
  306. // ignore: prefer_const_declarations
  307. final path = r'/asset';
  308. // ignore: prefer_final_locals
  309. Object? postBody;
  310. final queryParams = <QueryParam>[];
  311. final headerParams = <String, String>{};
  312. final formParams = <String, String>{};
  313. if (userId != null) {
  314. queryParams.addAll(_queryParams('', 'userId', userId));
  315. }
  316. if (isFavorite != null) {
  317. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  318. }
  319. if (isArchived != null) {
  320. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  321. }
  322. if (skip != null) {
  323. queryParams.addAll(_queryParams('', 'skip', skip));
  324. }
  325. if (updatedAfter != null) {
  326. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  327. }
  328. if (ifNoneMatch != null) {
  329. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  330. }
  331. const contentTypes = <String>[];
  332. return apiClient.invokeAPI(
  333. path,
  334. 'GET',
  335. queryParams,
  336. postBody,
  337. headerParams,
  338. formParams,
  339. contentTypes.isEmpty ? null : contentTypes.first,
  340. );
  341. }
  342. /// Get all AssetEntity belong to the user
  343. ///
  344. /// Parameters:
  345. ///
  346. /// * [String] userId:
  347. ///
  348. /// * [bool] isFavorite:
  349. ///
  350. /// * [bool] isArchived:
  351. ///
  352. /// * [num] skip:
  353. ///
  354. /// * [DateTime] updatedAfter:
  355. ///
  356. /// * [String] ifNoneMatch:
  357. /// ETag of data already cached on the client
  358. Future<List<AssetResponseDto>?> getAllAssets({ String? userId, bool? isFavorite, bool? isArchived, num? skip, DateTime? updatedAfter, String? ifNoneMatch, }) async {
  359. final response = await getAllAssetsWithHttpInfo( userId: userId, isFavorite: isFavorite, isArchived: isArchived, skip: skip, updatedAfter: updatedAfter, ifNoneMatch: ifNoneMatch, );
  360. if (response.statusCode >= HttpStatus.badRequest) {
  361. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  362. }
  363. // When a remote server returns no body with a status of 204, we shall not decode it.
  364. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  365. // FormatException when trying to decode an empty string.
  366. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  367. final responseBody = await _decodeBodyBytes(response);
  368. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  369. .cast<AssetResponseDto>()
  370. .toList();
  371. }
  372. return null;
  373. }
  374. /// Get a single asset's information
  375. ///
  376. /// Note: This method returns the HTTP [Response].
  377. ///
  378. /// Parameters:
  379. ///
  380. /// * [String] id (required):
  381. ///
  382. /// * [String] key:
  383. Future<Response> getAssetByIdWithHttpInfo(String id, { String? key, }) async {
  384. // ignore: prefer_const_declarations
  385. final path = r'/asset/assetById/{id}'
  386. .replaceAll('{id}', id);
  387. // ignore: prefer_final_locals
  388. Object? postBody;
  389. final queryParams = <QueryParam>[];
  390. final headerParams = <String, String>{};
  391. final formParams = <String, String>{};
  392. if (key != null) {
  393. queryParams.addAll(_queryParams('', 'key', key));
  394. }
  395. const contentTypes = <String>[];
  396. return apiClient.invokeAPI(
  397. path,
  398. 'GET',
  399. queryParams,
  400. postBody,
  401. headerParams,
  402. formParams,
  403. contentTypes.isEmpty ? null : contentTypes.first,
  404. );
  405. }
  406. /// Get a single asset's information
  407. ///
  408. /// Parameters:
  409. ///
  410. /// * [String] id (required):
  411. ///
  412. /// * [String] key:
  413. Future<AssetResponseDto?> getAssetById(String id, { String? key, }) async {
  414. final response = await getAssetByIdWithHttpInfo(id, key: key, );
  415. if (response.statusCode >= HttpStatus.badRequest) {
  416. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  417. }
  418. // When a remote server returns no body with a status of 204, we shall not decode it.
  419. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  420. // FormatException when trying to decode an empty string.
  421. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  422. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  423. }
  424. return null;
  425. }
  426. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  427. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  428. // ignore: prefer_const_declarations
  429. final path = r'/asset/search-terms';
  430. // ignore: prefer_final_locals
  431. Object? postBody;
  432. final queryParams = <QueryParam>[];
  433. final headerParams = <String, String>{};
  434. final formParams = <String, String>{};
  435. const contentTypes = <String>[];
  436. return apiClient.invokeAPI(
  437. path,
  438. 'GET',
  439. queryParams,
  440. postBody,
  441. headerParams,
  442. formParams,
  443. contentTypes.isEmpty ? null : contentTypes.first,
  444. );
  445. }
  446. Future<List<String>?> getAssetSearchTerms() async {
  447. final response = await getAssetSearchTermsWithHttpInfo();
  448. if (response.statusCode >= HttpStatus.badRequest) {
  449. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  450. }
  451. // When a remote server returns no body with a status of 204, we shall not decode it.
  452. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  453. // FormatException when trying to decode an empty string.
  454. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  455. final responseBody = await _decodeBodyBytes(response);
  456. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  457. .cast<String>()
  458. .toList();
  459. }
  460. return null;
  461. }
  462. /// Performs an HTTP 'GET /asset/statistics' operation and returns the [Response].
  463. /// Parameters:
  464. ///
  465. /// * [bool] isArchived:
  466. ///
  467. /// * [bool] isFavorite:
  468. Future<Response> getAssetStatsWithHttpInfo({ bool? isArchived, bool? isFavorite, }) async {
  469. // ignore: prefer_const_declarations
  470. final path = r'/asset/statistics';
  471. // ignore: prefer_final_locals
  472. Object? postBody;
  473. final queryParams = <QueryParam>[];
  474. final headerParams = <String, String>{};
  475. final formParams = <String, String>{};
  476. if (isArchived != null) {
  477. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  478. }
  479. if (isFavorite != null) {
  480. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  481. }
  482. const contentTypes = <String>[];
  483. return apiClient.invokeAPI(
  484. path,
  485. 'GET',
  486. queryParams,
  487. postBody,
  488. headerParams,
  489. formParams,
  490. contentTypes.isEmpty ? null : contentTypes.first,
  491. );
  492. }
  493. /// Parameters:
  494. ///
  495. /// * [bool] isArchived:
  496. ///
  497. /// * [bool] isFavorite:
  498. Future<AssetStatsResponseDto?> getAssetStats({ bool? isArchived, bool? isFavorite, }) async {
  499. final response = await getAssetStatsWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, );
  500. if (response.statusCode >= HttpStatus.badRequest) {
  501. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  502. }
  503. // When a remote server returns no body with a status of 204, we shall not decode it.
  504. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  505. // FormatException when trying to decode an empty string.
  506. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  507. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
  508. }
  509. return null;
  510. }
  511. /// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
  512. /// Parameters:
  513. ///
  514. /// * [String] id (required):
  515. ///
  516. /// * [ThumbnailFormat] format:
  517. ///
  518. /// * [String] key:
  519. Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
  520. // ignore: prefer_const_declarations
  521. final path = r'/asset/thumbnail/{id}'
  522. .replaceAll('{id}', id);
  523. // ignore: prefer_final_locals
  524. Object? postBody;
  525. final queryParams = <QueryParam>[];
  526. final headerParams = <String, String>{};
  527. final formParams = <String, String>{};
  528. if (format != null) {
  529. queryParams.addAll(_queryParams('', 'format', format));
  530. }
  531. if (key != null) {
  532. queryParams.addAll(_queryParams('', 'key', key));
  533. }
  534. const contentTypes = <String>[];
  535. return apiClient.invokeAPI(
  536. path,
  537. 'GET',
  538. queryParams,
  539. postBody,
  540. headerParams,
  541. formParams,
  542. contentTypes.isEmpty ? null : contentTypes.first,
  543. );
  544. }
  545. /// Parameters:
  546. ///
  547. /// * [String] id (required):
  548. ///
  549. /// * [ThumbnailFormat] format:
  550. ///
  551. /// * [String] key:
  552. Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
  553. final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
  554. if (response.statusCode >= HttpStatus.badRequest) {
  555. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  556. }
  557. // When a remote server returns no body with a status of 204, we shall not decode it.
  558. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  559. // FormatException when trying to decode an empty string.
  560. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  561. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  562. }
  563. return null;
  564. }
  565. /// Performs an HTTP 'GET /asset/time-bucket' operation and returns the [Response].
  566. /// Parameters:
  567. ///
  568. /// * [TimeBucketSize] size (required):
  569. ///
  570. /// * [String] timeBucket (required):
  571. ///
  572. /// * [String] userId:
  573. ///
  574. /// * [String] albumId:
  575. ///
  576. /// * [String] personId:
  577. ///
  578. /// * [bool] isArchived:
  579. ///
  580. /// * [bool] isFavorite:
  581. ///
  582. /// * [String] key:
  583. Future<Response> getByTimeBucketWithHttpInfo(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  584. // ignore: prefer_const_declarations
  585. final path = r'/asset/time-bucket';
  586. // ignore: prefer_final_locals
  587. Object? postBody;
  588. final queryParams = <QueryParam>[];
  589. final headerParams = <String, String>{};
  590. final formParams = <String, String>{};
  591. queryParams.addAll(_queryParams('', 'size', size));
  592. if (userId != null) {
  593. queryParams.addAll(_queryParams('', 'userId', userId));
  594. }
  595. if (albumId != null) {
  596. queryParams.addAll(_queryParams('', 'albumId', albumId));
  597. }
  598. if (personId != null) {
  599. queryParams.addAll(_queryParams('', 'personId', personId));
  600. }
  601. if (isArchived != null) {
  602. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  603. }
  604. if (isFavorite != null) {
  605. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  606. }
  607. queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
  608. if (key != null) {
  609. queryParams.addAll(_queryParams('', 'key', key));
  610. }
  611. const contentTypes = <String>[];
  612. return apiClient.invokeAPI(
  613. path,
  614. 'GET',
  615. queryParams,
  616. postBody,
  617. headerParams,
  618. formParams,
  619. contentTypes.isEmpty ? null : contentTypes.first,
  620. );
  621. }
  622. /// Parameters:
  623. ///
  624. /// * [TimeBucketSize] size (required):
  625. ///
  626. /// * [String] timeBucket (required):
  627. ///
  628. /// * [String] userId:
  629. ///
  630. /// * [String] albumId:
  631. ///
  632. /// * [String] personId:
  633. ///
  634. /// * [bool] isArchived:
  635. ///
  636. /// * [bool] isFavorite:
  637. ///
  638. /// * [String] key:
  639. Future<List<AssetResponseDto>?> getByTimeBucket(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  640. final response = await getByTimeBucketWithHttpInfo(size, timeBucket, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, key: key, );
  641. if (response.statusCode >= HttpStatus.badRequest) {
  642. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  643. }
  644. // When a remote server returns no body with a status of 204, we shall not decode it.
  645. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  646. // FormatException when trying to decode an empty string.
  647. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  648. final responseBody = await _decodeBodyBytes(response);
  649. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  650. .cast<AssetResponseDto>()
  651. .toList();
  652. }
  653. return null;
  654. }
  655. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  656. Future<Response> getCuratedLocationsWithHttpInfo() async {
  657. // ignore: prefer_const_declarations
  658. final path = r'/asset/curated-locations';
  659. // ignore: prefer_final_locals
  660. Object? postBody;
  661. final queryParams = <QueryParam>[];
  662. final headerParams = <String, String>{};
  663. final formParams = <String, String>{};
  664. const contentTypes = <String>[];
  665. return apiClient.invokeAPI(
  666. path,
  667. 'GET',
  668. queryParams,
  669. postBody,
  670. headerParams,
  671. formParams,
  672. contentTypes.isEmpty ? null : contentTypes.first,
  673. );
  674. }
  675. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  676. final response = await getCuratedLocationsWithHttpInfo();
  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. final responseBody = await _decodeBodyBytes(response);
  685. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  686. .cast<CuratedLocationsResponseDto>()
  687. .toList();
  688. }
  689. return null;
  690. }
  691. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  692. Future<Response> getCuratedObjectsWithHttpInfo() async {
  693. // ignore: prefer_const_declarations
  694. final path = r'/asset/curated-objects';
  695. // ignore: prefer_final_locals
  696. Object? postBody;
  697. final queryParams = <QueryParam>[];
  698. final headerParams = <String, String>{};
  699. final formParams = <String, String>{};
  700. const contentTypes = <String>[];
  701. return apiClient.invokeAPI(
  702. path,
  703. 'GET',
  704. queryParams,
  705. postBody,
  706. headerParams,
  707. formParams,
  708. contentTypes.isEmpty ? null : contentTypes.first,
  709. );
  710. }
  711. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  712. final response = await getCuratedObjectsWithHttpInfo();
  713. if (response.statusCode >= HttpStatus.badRequest) {
  714. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  715. }
  716. // When a remote server returns no body with a status of 204, we shall not decode it.
  717. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  718. // FormatException when trying to decode an empty string.
  719. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  720. final responseBody = await _decodeBodyBytes(response);
  721. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  722. .cast<CuratedObjectsResponseDto>()
  723. .toList();
  724. }
  725. return null;
  726. }
  727. /// Performs an HTTP 'POST /asset/download/info' operation and returns the [Response].
  728. /// Parameters:
  729. ///
  730. /// * [DownloadInfoDto] downloadInfoDto (required):
  731. ///
  732. /// * [String] key:
  733. Future<Response> getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  734. // ignore: prefer_const_declarations
  735. final path = r'/asset/download/info';
  736. // ignore: prefer_final_locals
  737. Object? postBody = downloadInfoDto;
  738. final queryParams = <QueryParam>[];
  739. final headerParams = <String, String>{};
  740. final formParams = <String, String>{};
  741. if (key != null) {
  742. queryParams.addAll(_queryParams('', 'key', key));
  743. }
  744. const contentTypes = <String>['application/json'];
  745. return apiClient.invokeAPI(
  746. path,
  747. 'POST',
  748. queryParams,
  749. postBody,
  750. headerParams,
  751. formParams,
  752. contentTypes.isEmpty ? null : contentTypes.first,
  753. );
  754. }
  755. /// Parameters:
  756. ///
  757. /// * [DownloadInfoDto] downloadInfoDto (required):
  758. ///
  759. /// * [String] key:
  760. Future<DownloadResponseDto?> getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  761. final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, );
  762. if (response.statusCode >= HttpStatus.badRequest) {
  763. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  764. }
  765. // When a remote server returns no body with a status of 204, we shall not decode it.
  766. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  767. // FormatException when trying to decode an empty string.
  768. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  769. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DownloadResponseDto',) as DownloadResponseDto;
  770. }
  771. return null;
  772. }
  773. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  774. /// Parameters:
  775. ///
  776. /// * [bool] isFavorite:
  777. ///
  778. /// * [DateTime] fileCreatedAfter:
  779. ///
  780. /// * [DateTime] fileCreatedBefore:
  781. Future<Response> getMapMarkersWithHttpInfo({ bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  782. // ignore: prefer_const_declarations
  783. final path = r'/asset/map-marker';
  784. // ignore: prefer_final_locals
  785. Object? postBody;
  786. final queryParams = <QueryParam>[];
  787. final headerParams = <String, String>{};
  788. final formParams = <String, String>{};
  789. if (isFavorite != null) {
  790. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  791. }
  792. if (fileCreatedAfter != null) {
  793. queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
  794. }
  795. if (fileCreatedBefore != null) {
  796. queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
  797. }
  798. const contentTypes = <String>[];
  799. return apiClient.invokeAPI(
  800. path,
  801. 'GET',
  802. queryParams,
  803. postBody,
  804. headerParams,
  805. formParams,
  806. contentTypes.isEmpty ? null : contentTypes.first,
  807. );
  808. }
  809. /// Parameters:
  810. ///
  811. /// * [bool] isFavorite:
  812. ///
  813. /// * [DateTime] fileCreatedAfter:
  814. ///
  815. /// * [DateTime] fileCreatedBefore:
  816. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  817. final response = await getMapMarkersWithHttpInfo( isFavorite: isFavorite, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, );
  818. if (response.statusCode >= HttpStatus.badRequest) {
  819. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  820. }
  821. // When a remote server returns no body with a status of 204, we shall not decode it.
  822. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  823. // FormatException when trying to decode an empty string.
  824. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  825. final responseBody = await _decodeBodyBytes(response);
  826. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  827. .cast<MapMarkerResponseDto>()
  828. .toList();
  829. }
  830. return null;
  831. }
  832. /// Performs an HTTP 'GET /asset/memory-lane' operation and returns the [Response].
  833. /// Parameters:
  834. ///
  835. /// * [DateTime] timestamp (required):
  836. /// Get pictures for +24 hours from this time going back x years
  837. Future<Response> getMemoryLaneWithHttpInfo(DateTime timestamp,) async {
  838. // ignore: prefer_const_declarations
  839. final path = r'/asset/memory-lane';
  840. // ignore: prefer_final_locals
  841. Object? postBody;
  842. final queryParams = <QueryParam>[];
  843. final headerParams = <String, String>{};
  844. final formParams = <String, String>{};
  845. queryParams.addAll(_queryParams('', 'timestamp', timestamp));
  846. const contentTypes = <String>[];
  847. return apiClient.invokeAPI(
  848. path,
  849. 'GET',
  850. queryParams,
  851. postBody,
  852. headerParams,
  853. formParams,
  854. contentTypes.isEmpty ? null : contentTypes.first,
  855. );
  856. }
  857. /// Parameters:
  858. ///
  859. /// * [DateTime] timestamp (required):
  860. /// Get pictures for +24 hours from this time going back x years
  861. Future<List<MemoryLaneResponseDto>?> getMemoryLane(DateTime timestamp,) async {
  862. final response = await getMemoryLaneWithHttpInfo(timestamp,);
  863. if (response.statusCode >= HttpStatus.badRequest) {
  864. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  865. }
  866. // When a remote server returns no body with a status of 204, we shall not decode it.
  867. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  868. // FormatException when trying to decode an empty string.
  869. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  870. final responseBody = await _decodeBodyBytes(response);
  871. return (await apiClient.deserializeAsync(responseBody, 'List<MemoryLaneResponseDto>') as List)
  872. .cast<MemoryLaneResponseDto>()
  873. .toList();
  874. }
  875. return null;
  876. }
  877. /// Performs an HTTP 'GET /asset/random' operation and returns the [Response].
  878. /// Parameters:
  879. ///
  880. /// * [num] count:
  881. Future<Response> getRandomWithHttpInfo({ num? count, }) async {
  882. // ignore: prefer_const_declarations
  883. final path = r'/asset/random';
  884. // ignore: prefer_final_locals
  885. Object? postBody;
  886. final queryParams = <QueryParam>[];
  887. final headerParams = <String, String>{};
  888. final formParams = <String, String>{};
  889. if (count != null) {
  890. queryParams.addAll(_queryParams('', 'count', count));
  891. }
  892. const contentTypes = <String>[];
  893. return apiClient.invokeAPI(
  894. path,
  895. 'GET',
  896. queryParams,
  897. postBody,
  898. headerParams,
  899. formParams,
  900. contentTypes.isEmpty ? null : contentTypes.first,
  901. );
  902. }
  903. /// Parameters:
  904. ///
  905. /// * [num] count:
  906. Future<List<AssetResponseDto>?> getRandom({ num? count, }) async {
  907. final response = await getRandomWithHttpInfo( count: count, );
  908. if (response.statusCode >= HttpStatus.badRequest) {
  909. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  910. }
  911. // When a remote server returns no body with a status of 204, we shall not decode it.
  912. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  913. // FormatException when trying to decode an empty string.
  914. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  915. final responseBody = await _decodeBodyBytes(response);
  916. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  917. .cast<AssetResponseDto>()
  918. .toList();
  919. }
  920. return null;
  921. }
  922. /// Performs an HTTP 'GET /asset/time-buckets' operation and returns the [Response].
  923. /// Parameters:
  924. ///
  925. /// * [TimeBucketSize] size (required):
  926. ///
  927. /// * [String] userId:
  928. ///
  929. /// * [String] albumId:
  930. ///
  931. /// * [String] personId:
  932. ///
  933. /// * [bool] isArchived:
  934. ///
  935. /// * [bool] isFavorite:
  936. ///
  937. /// * [String] key:
  938. Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  939. // ignore: prefer_const_declarations
  940. final path = r'/asset/time-buckets';
  941. // ignore: prefer_final_locals
  942. Object? postBody;
  943. final queryParams = <QueryParam>[];
  944. final headerParams = <String, String>{};
  945. final formParams = <String, String>{};
  946. queryParams.addAll(_queryParams('', 'size', size));
  947. if (userId != null) {
  948. queryParams.addAll(_queryParams('', 'userId', userId));
  949. }
  950. if (albumId != null) {
  951. queryParams.addAll(_queryParams('', 'albumId', albumId));
  952. }
  953. if (personId != null) {
  954. queryParams.addAll(_queryParams('', 'personId', personId));
  955. }
  956. if (isArchived != null) {
  957. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  958. }
  959. if (isFavorite != null) {
  960. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  961. }
  962. if (key != null) {
  963. queryParams.addAll(_queryParams('', 'key', key));
  964. }
  965. const contentTypes = <String>[];
  966. return apiClient.invokeAPI(
  967. path,
  968. 'GET',
  969. queryParams,
  970. postBody,
  971. headerParams,
  972. formParams,
  973. contentTypes.isEmpty ? null : contentTypes.first,
  974. );
  975. }
  976. /// Parameters:
  977. ///
  978. /// * [TimeBucketSize] size (required):
  979. ///
  980. /// * [String] userId:
  981. ///
  982. /// * [String] albumId:
  983. ///
  984. /// * [String] personId:
  985. ///
  986. /// * [bool] isArchived:
  987. ///
  988. /// * [bool] isFavorite:
  989. ///
  990. /// * [String] key:
  991. Future<List<TimeBucketResponseDto>?> getTimeBuckets(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  992. final response = await getTimeBucketsWithHttpInfo(size, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, key: key, );
  993. if (response.statusCode >= HttpStatus.badRequest) {
  994. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  995. }
  996. // When a remote server returns no body with a status of 204, we shall not decode it.
  997. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  998. // FormatException when trying to decode an empty string.
  999. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1000. final responseBody = await _decodeBodyBytes(response);
  1001. return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketResponseDto>') as List)
  1002. .cast<TimeBucketResponseDto>()
  1003. .toList();
  1004. }
  1005. return null;
  1006. }
  1007. /// Get all asset of a device that are in the database, ID only.
  1008. ///
  1009. /// Note: This method returns the HTTP [Response].
  1010. ///
  1011. /// Parameters:
  1012. ///
  1013. /// * [String] deviceId (required):
  1014. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  1015. // ignore: prefer_const_declarations
  1016. final path = r'/asset/{deviceId}'
  1017. .replaceAll('{deviceId}', deviceId);
  1018. // ignore: prefer_final_locals
  1019. Object? postBody;
  1020. final queryParams = <QueryParam>[];
  1021. final headerParams = <String, String>{};
  1022. final formParams = <String, String>{};
  1023. const contentTypes = <String>[];
  1024. return apiClient.invokeAPI(
  1025. path,
  1026. 'GET',
  1027. queryParams,
  1028. postBody,
  1029. headerParams,
  1030. formParams,
  1031. contentTypes.isEmpty ? null : contentTypes.first,
  1032. );
  1033. }
  1034. /// Get all asset of a device that are in the database, ID only.
  1035. ///
  1036. /// Parameters:
  1037. ///
  1038. /// * [String] deviceId (required):
  1039. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  1040. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  1041. if (response.statusCode >= HttpStatus.badRequest) {
  1042. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1043. }
  1044. // When a remote server returns no body with a status of 204, we shall not decode it.
  1045. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1046. // FormatException when trying to decode an empty string.
  1047. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1048. final responseBody = await _decodeBodyBytes(response);
  1049. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  1050. .cast<String>()
  1051. .toList();
  1052. }
  1053. return null;
  1054. }
  1055. /// Performs an HTTP 'POST /asset/import' operation and returns the [Response].
  1056. /// Parameters:
  1057. ///
  1058. /// * [ImportAssetDto] importAssetDto (required):
  1059. Future<Response> importFileWithHttpInfo(ImportAssetDto importAssetDto,) async {
  1060. // ignore: prefer_const_declarations
  1061. final path = r'/asset/import';
  1062. // ignore: prefer_final_locals
  1063. Object? postBody = importAssetDto;
  1064. final queryParams = <QueryParam>[];
  1065. final headerParams = <String, String>{};
  1066. final formParams = <String, String>{};
  1067. const contentTypes = <String>['application/json'];
  1068. return apiClient.invokeAPI(
  1069. path,
  1070. 'POST',
  1071. queryParams,
  1072. postBody,
  1073. headerParams,
  1074. formParams,
  1075. contentTypes.isEmpty ? null : contentTypes.first,
  1076. );
  1077. }
  1078. /// Parameters:
  1079. ///
  1080. /// * [ImportAssetDto] importAssetDto (required):
  1081. Future<AssetFileUploadResponseDto?> importFile(ImportAssetDto importAssetDto,) async {
  1082. final response = await importFileWithHttpInfo(importAssetDto,);
  1083. if (response.statusCode >= HttpStatus.badRequest) {
  1084. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1085. }
  1086. // When a remote server returns no body with a status of 204, we shall not decode it.
  1087. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1088. // FormatException when trying to decode an empty string.
  1089. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1090. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1091. }
  1092. return null;
  1093. }
  1094. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1095. /// Parameters:
  1096. ///
  1097. /// * [AssetJobsDto] assetJobsDto (required):
  1098. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1099. // ignore: prefer_const_declarations
  1100. final path = r'/asset/jobs';
  1101. // ignore: prefer_final_locals
  1102. Object? postBody = assetJobsDto;
  1103. final queryParams = <QueryParam>[];
  1104. final headerParams = <String, String>{};
  1105. final formParams = <String, String>{};
  1106. const contentTypes = <String>['application/json'];
  1107. return apiClient.invokeAPI(
  1108. path,
  1109. 'POST',
  1110. queryParams,
  1111. postBody,
  1112. headerParams,
  1113. formParams,
  1114. contentTypes.isEmpty ? null : contentTypes.first,
  1115. );
  1116. }
  1117. /// Parameters:
  1118. ///
  1119. /// * [AssetJobsDto] assetJobsDto (required):
  1120. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1121. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1122. if (response.statusCode >= HttpStatus.badRequest) {
  1123. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1124. }
  1125. }
  1126. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  1127. /// Parameters:
  1128. ///
  1129. /// * [SearchAssetDto] searchAssetDto (required):
  1130. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1131. // ignore: prefer_const_declarations
  1132. final path = r'/asset/search';
  1133. // ignore: prefer_final_locals
  1134. Object? postBody = searchAssetDto;
  1135. final queryParams = <QueryParam>[];
  1136. final headerParams = <String, String>{};
  1137. final formParams = <String, String>{};
  1138. const contentTypes = <String>['application/json'];
  1139. return apiClient.invokeAPI(
  1140. path,
  1141. 'POST',
  1142. queryParams,
  1143. postBody,
  1144. headerParams,
  1145. formParams,
  1146. contentTypes.isEmpty ? null : contentTypes.first,
  1147. );
  1148. }
  1149. /// Parameters:
  1150. ///
  1151. /// * [SearchAssetDto] searchAssetDto (required):
  1152. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1153. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1154. if (response.statusCode >= HttpStatus.badRequest) {
  1155. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1156. }
  1157. // When a remote server returns no body with a status of 204, we shall not decode it.
  1158. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1159. // FormatException when trying to decode an empty string.
  1160. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1161. final responseBody = await _decodeBodyBytes(response);
  1162. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1163. .cast<AssetResponseDto>()
  1164. .toList();
  1165. }
  1166. return null;
  1167. }
  1168. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1169. /// Parameters:
  1170. ///
  1171. /// * [String] id (required):
  1172. ///
  1173. /// * [bool] isThumb:
  1174. ///
  1175. /// * [bool] isWeb:
  1176. ///
  1177. /// * [String] key:
  1178. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1179. // ignore: prefer_const_declarations
  1180. final path = r'/asset/file/{id}'
  1181. .replaceAll('{id}', id);
  1182. // ignore: prefer_final_locals
  1183. Object? postBody;
  1184. final queryParams = <QueryParam>[];
  1185. final headerParams = <String, String>{};
  1186. final formParams = <String, String>{};
  1187. if (isThumb != null) {
  1188. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1189. }
  1190. if (isWeb != null) {
  1191. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1192. }
  1193. if (key != null) {
  1194. queryParams.addAll(_queryParams('', 'key', key));
  1195. }
  1196. const contentTypes = <String>[];
  1197. return apiClient.invokeAPI(
  1198. path,
  1199. 'GET',
  1200. queryParams,
  1201. postBody,
  1202. headerParams,
  1203. formParams,
  1204. contentTypes.isEmpty ? null : contentTypes.first,
  1205. );
  1206. }
  1207. /// Parameters:
  1208. ///
  1209. /// * [String] id (required):
  1210. ///
  1211. /// * [bool] isThumb:
  1212. ///
  1213. /// * [bool] isWeb:
  1214. ///
  1215. /// * [String] key:
  1216. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1217. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1218. if (response.statusCode >= HttpStatus.badRequest) {
  1219. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1220. }
  1221. // When a remote server returns no body with a status of 204, we shall not decode it.
  1222. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1223. // FormatException when trying to decode an empty string.
  1224. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1225. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1226. }
  1227. return null;
  1228. }
  1229. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1230. /// Parameters:
  1231. ///
  1232. /// * [String] id (required):
  1233. ///
  1234. /// * [UpdateAssetDto] updateAssetDto (required):
  1235. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1236. // ignore: prefer_const_declarations
  1237. final path = r'/asset/{id}'
  1238. .replaceAll('{id}', id);
  1239. // ignore: prefer_final_locals
  1240. Object? postBody = updateAssetDto;
  1241. final queryParams = <QueryParam>[];
  1242. final headerParams = <String, String>{};
  1243. final formParams = <String, String>{};
  1244. const contentTypes = <String>['application/json'];
  1245. return apiClient.invokeAPI(
  1246. path,
  1247. 'PUT',
  1248. queryParams,
  1249. postBody,
  1250. headerParams,
  1251. formParams,
  1252. contentTypes.isEmpty ? null : contentTypes.first,
  1253. );
  1254. }
  1255. /// Parameters:
  1256. ///
  1257. /// * [String] id (required):
  1258. ///
  1259. /// * [UpdateAssetDto] updateAssetDto (required):
  1260. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1261. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1262. if (response.statusCode >= HttpStatus.badRequest) {
  1263. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1264. }
  1265. // When a remote server returns no body with a status of 204, we shall not decode it.
  1266. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1267. // FormatException when trying to decode an empty string.
  1268. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1269. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1270. }
  1271. return null;
  1272. }
  1273. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1274. /// Parameters:
  1275. ///
  1276. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1277. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1278. // ignore: prefer_const_declarations
  1279. final path = r'/asset';
  1280. // ignore: prefer_final_locals
  1281. Object? postBody = assetBulkUpdateDto;
  1282. final queryParams = <QueryParam>[];
  1283. final headerParams = <String, String>{};
  1284. final formParams = <String, String>{};
  1285. const contentTypes = <String>['application/json'];
  1286. return apiClient.invokeAPI(
  1287. path,
  1288. 'PUT',
  1289. queryParams,
  1290. postBody,
  1291. headerParams,
  1292. formParams,
  1293. contentTypes.isEmpty ? null : contentTypes.first,
  1294. );
  1295. }
  1296. /// Parameters:
  1297. ///
  1298. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1299. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1300. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1301. if (response.statusCode >= HttpStatus.badRequest) {
  1302. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1303. }
  1304. }
  1305. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1306. /// Parameters:
  1307. ///
  1308. /// * [MultipartFile] assetData (required):
  1309. ///
  1310. /// * [String] deviceAssetId (required):
  1311. ///
  1312. /// * [String] deviceId (required):
  1313. ///
  1314. /// * [DateTime] fileCreatedAt (required):
  1315. ///
  1316. /// * [DateTime] fileModifiedAt (required):
  1317. ///
  1318. /// * [bool] isFavorite (required):
  1319. ///
  1320. /// * [String] key:
  1321. ///
  1322. /// * [String] duration:
  1323. ///
  1324. /// * [bool] isArchived:
  1325. ///
  1326. /// * [bool] isExternal:
  1327. ///
  1328. /// * [bool] isOffline:
  1329. ///
  1330. /// * [bool] isReadOnly:
  1331. ///
  1332. /// * [bool] isVisible:
  1333. ///
  1334. /// * [String] libraryId:
  1335. ///
  1336. /// * [MultipartFile] livePhotoData:
  1337. ///
  1338. /// * [MultipartFile] sidecarData:
  1339. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1340. // ignore: prefer_const_declarations
  1341. final path = r'/asset/upload';
  1342. // ignore: prefer_final_locals
  1343. Object? postBody;
  1344. final queryParams = <QueryParam>[];
  1345. final headerParams = <String, String>{};
  1346. final formParams = <String, String>{};
  1347. if (key != null) {
  1348. queryParams.addAll(_queryParams('', 'key', key));
  1349. }
  1350. const contentTypes = <String>['multipart/form-data'];
  1351. bool hasFields = false;
  1352. final mp = MultipartRequest('POST', Uri.parse(path));
  1353. if (assetData != null) {
  1354. hasFields = true;
  1355. mp.fields[r'assetData'] = assetData.field;
  1356. mp.files.add(assetData);
  1357. }
  1358. if (deviceAssetId != null) {
  1359. hasFields = true;
  1360. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1361. }
  1362. if (deviceId != null) {
  1363. hasFields = true;
  1364. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1365. }
  1366. if (duration != null) {
  1367. hasFields = true;
  1368. mp.fields[r'duration'] = parameterToString(duration);
  1369. }
  1370. if (fileCreatedAt != null) {
  1371. hasFields = true;
  1372. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1373. }
  1374. if (fileModifiedAt != null) {
  1375. hasFields = true;
  1376. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1377. }
  1378. if (isArchived != null) {
  1379. hasFields = true;
  1380. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1381. }
  1382. if (isExternal != null) {
  1383. hasFields = true;
  1384. mp.fields[r'isExternal'] = parameterToString(isExternal);
  1385. }
  1386. if (isFavorite != null) {
  1387. hasFields = true;
  1388. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1389. }
  1390. if (isOffline != null) {
  1391. hasFields = true;
  1392. mp.fields[r'isOffline'] = parameterToString(isOffline);
  1393. }
  1394. if (isReadOnly != null) {
  1395. hasFields = true;
  1396. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1397. }
  1398. if (isVisible != null) {
  1399. hasFields = true;
  1400. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1401. }
  1402. if (libraryId != null) {
  1403. hasFields = true;
  1404. mp.fields[r'libraryId'] = parameterToString(libraryId);
  1405. }
  1406. if (livePhotoData != null) {
  1407. hasFields = true;
  1408. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1409. mp.files.add(livePhotoData);
  1410. }
  1411. if (sidecarData != null) {
  1412. hasFields = true;
  1413. mp.fields[r'sidecarData'] = sidecarData.field;
  1414. mp.files.add(sidecarData);
  1415. }
  1416. if (hasFields) {
  1417. postBody = mp;
  1418. }
  1419. return apiClient.invokeAPI(
  1420. path,
  1421. 'POST',
  1422. queryParams,
  1423. postBody,
  1424. headerParams,
  1425. formParams,
  1426. contentTypes.isEmpty ? null : contentTypes.first,
  1427. );
  1428. }
  1429. /// Parameters:
  1430. ///
  1431. /// * [MultipartFile] assetData (required):
  1432. ///
  1433. /// * [String] deviceAssetId (required):
  1434. ///
  1435. /// * [String] deviceId (required):
  1436. ///
  1437. /// * [DateTime] fileCreatedAt (required):
  1438. ///
  1439. /// * [DateTime] fileModifiedAt (required):
  1440. ///
  1441. /// * [bool] isFavorite (required):
  1442. ///
  1443. /// * [String] key:
  1444. ///
  1445. /// * [String] duration:
  1446. ///
  1447. /// * [bool] isArchived:
  1448. ///
  1449. /// * [bool] isExternal:
  1450. ///
  1451. /// * [bool] isOffline:
  1452. ///
  1453. /// * [bool] isReadOnly:
  1454. ///
  1455. /// * [bool] isVisible:
  1456. ///
  1457. /// * [String] libraryId:
  1458. ///
  1459. /// * [MultipartFile] livePhotoData:
  1460. ///
  1461. /// * [MultipartFile] sidecarData:
  1462. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1463. final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
  1464. if (response.statusCode >= HttpStatus.badRequest) {
  1465. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1466. }
  1467. // When a remote server returns no body with a status of 204, we shall not decode it.
  1468. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1469. // FormatException when trying to decode an empty string.
  1470. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1471. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1472. }
  1473. return null;
  1474. }
  1475. }