asset_api.dart 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632
  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/time-buckets' operation and returns the [Response].
  878. /// Parameters:
  879. ///
  880. /// * [TimeBucketSize] size (required):
  881. ///
  882. /// * [String] userId:
  883. ///
  884. /// * [String] albumId:
  885. ///
  886. /// * [String] personId:
  887. ///
  888. /// * [bool] isArchived:
  889. ///
  890. /// * [bool] isFavorite:
  891. ///
  892. /// * [String] key:
  893. Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  894. // ignore: prefer_const_declarations
  895. final path = r'/asset/time-buckets';
  896. // ignore: prefer_final_locals
  897. Object? postBody;
  898. final queryParams = <QueryParam>[];
  899. final headerParams = <String, String>{};
  900. final formParams = <String, String>{};
  901. queryParams.addAll(_queryParams('', 'size', size));
  902. if (userId != null) {
  903. queryParams.addAll(_queryParams('', 'userId', userId));
  904. }
  905. if (albumId != null) {
  906. queryParams.addAll(_queryParams('', 'albumId', albumId));
  907. }
  908. if (personId != null) {
  909. queryParams.addAll(_queryParams('', 'personId', personId));
  910. }
  911. if (isArchived != null) {
  912. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  913. }
  914. if (isFavorite != null) {
  915. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  916. }
  917. if (key != null) {
  918. queryParams.addAll(_queryParams('', 'key', key));
  919. }
  920. const contentTypes = <String>[];
  921. return apiClient.invokeAPI(
  922. path,
  923. 'GET',
  924. queryParams,
  925. postBody,
  926. headerParams,
  927. formParams,
  928. contentTypes.isEmpty ? null : contentTypes.first,
  929. );
  930. }
  931. /// Parameters:
  932. ///
  933. /// * [TimeBucketSize] size (required):
  934. ///
  935. /// * [String] userId:
  936. ///
  937. /// * [String] albumId:
  938. ///
  939. /// * [String] personId:
  940. ///
  941. /// * [bool] isArchived:
  942. ///
  943. /// * [bool] isFavorite:
  944. ///
  945. /// * [String] key:
  946. Future<List<TimeBucketResponseDto>?> getTimeBuckets(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, String? key, }) async {
  947. final response = await getTimeBucketsWithHttpInfo(size, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, key: key, );
  948. if (response.statusCode >= HttpStatus.badRequest) {
  949. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  950. }
  951. // When a remote server returns no body with a status of 204, we shall not decode it.
  952. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  953. // FormatException when trying to decode an empty string.
  954. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  955. final responseBody = await _decodeBodyBytes(response);
  956. return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketResponseDto>') as List)
  957. .cast<TimeBucketResponseDto>()
  958. .toList();
  959. }
  960. return null;
  961. }
  962. /// Get all asset of a device that are in the database, ID only.
  963. ///
  964. /// Note: This method returns the HTTP [Response].
  965. ///
  966. /// Parameters:
  967. ///
  968. /// * [String] deviceId (required):
  969. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  970. // ignore: prefer_const_declarations
  971. final path = r'/asset/{deviceId}'
  972. .replaceAll('{deviceId}', deviceId);
  973. // ignore: prefer_final_locals
  974. Object? postBody;
  975. final queryParams = <QueryParam>[];
  976. final headerParams = <String, String>{};
  977. final formParams = <String, String>{};
  978. const contentTypes = <String>[];
  979. return apiClient.invokeAPI(
  980. path,
  981. 'GET',
  982. queryParams,
  983. postBody,
  984. headerParams,
  985. formParams,
  986. contentTypes.isEmpty ? null : contentTypes.first,
  987. );
  988. }
  989. /// Get all asset of a device that are in the database, ID only.
  990. ///
  991. /// Parameters:
  992. ///
  993. /// * [String] deviceId (required):
  994. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  995. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  996. if (response.statusCode >= HttpStatus.badRequest) {
  997. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  998. }
  999. // When a remote server returns no body with a status of 204, we shall not decode it.
  1000. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1001. // FormatException when trying to decode an empty string.
  1002. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1003. final responseBody = await _decodeBodyBytes(response);
  1004. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  1005. .cast<String>()
  1006. .toList();
  1007. }
  1008. return null;
  1009. }
  1010. /// Performs an HTTP 'POST /asset/import' operation and returns the [Response].
  1011. /// Parameters:
  1012. ///
  1013. /// * [ImportAssetDto] importAssetDto (required):
  1014. Future<Response> importFileWithHttpInfo(ImportAssetDto importAssetDto,) async {
  1015. // ignore: prefer_const_declarations
  1016. final path = r'/asset/import';
  1017. // ignore: prefer_final_locals
  1018. Object? postBody = importAssetDto;
  1019. final queryParams = <QueryParam>[];
  1020. final headerParams = <String, String>{};
  1021. final formParams = <String, String>{};
  1022. const contentTypes = <String>['application/json'];
  1023. return apiClient.invokeAPI(
  1024. path,
  1025. 'POST',
  1026. queryParams,
  1027. postBody,
  1028. headerParams,
  1029. formParams,
  1030. contentTypes.isEmpty ? null : contentTypes.first,
  1031. );
  1032. }
  1033. /// Parameters:
  1034. ///
  1035. /// * [ImportAssetDto] importAssetDto (required):
  1036. Future<AssetFileUploadResponseDto?> importFile(ImportAssetDto importAssetDto,) async {
  1037. final response = await importFileWithHttpInfo(importAssetDto,);
  1038. if (response.statusCode >= HttpStatus.badRequest) {
  1039. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1040. }
  1041. // When a remote server returns no body with a status of 204, we shall not decode it.
  1042. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1043. // FormatException when trying to decode an empty string.
  1044. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1045. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1046. }
  1047. return null;
  1048. }
  1049. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1050. /// Parameters:
  1051. ///
  1052. /// * [AssetJobsDto] assetJobsDto (required):
  1053. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1054. // ignore: prefer_const_declarations
  1055. final path = r'/asset/jobs';
  1056. // ignore: prefer_final_locals
  1057. Object? postBody = assetJobsDto;
  1058. final queryParams = <QueryParam>[];
  1059. final headerParams = <String, String>{};
  1060. final formParams = <String, String>{};
  1061. const contentTypes = <String>['application/json'];
  1062. return apiClient.invokeAPI(
  1063. path,
  1064. 'POST',
  1065. queryParams,
  1066. postBody,
  1067. headerParams,
  1068. formParams,
  1069. contentTypes.isEmpty ? null : contentTypes.first,
  1070. );
  1071. }
  1072. /// Parameters:
  1073. ///
  1074. /// * [AssetJobsDto] assetJobsDto (required):
  1075. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1076. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1077. if (response.statusCode >= HttpStatus.badRequest) {
  1078. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1079. }
  1080. }
  1081. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  1082. /// Parameters:
  1083. ///
  1084. /// * [SearchAssetDto] searchAssetDto (required):
  1085. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1086. // ignore: prefer_const_declarations
  1087. final path = r'/asset/search';
  1088. // ignore: prefer_final_locals
  1089. Object? postBody = searchAssetDto;
  1090. final queryParams = <QueryParam>[];
  1091. final headerParams = <String, String>{};
  1092. final formParams = <String, String>{};
  1093. const contentTypes = <String>['application/json'];
  1094. return apiClient.invokeAPI(
  1095. path,
  1096. 'POST',
  1097. queryParams,
  1098. postBody,
  1099. headerParams,
  1100. formParams,
  1101. contentTypes.isEmpty ? null : contentTypes.first,
  1102. );
  1103. }
  1104. /// Parameters:
  1105. ///
  1106. /// * [SearchAssetDto] searchAssetDto (required):
  1107. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1108. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1109. if (response.statusCode >= HttpStatus.badRequest) {
  1110. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1111. }
  1112. // When a remote server returns no body with a status of 204, we shall not decode it.
  1113. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1114. // FormatException when trying to decode an empty string.
  1115. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1116. final responseBody = await _decodeBodyBytes(response);
  1117. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1118. .cast<AssetResponseDto>()
  1119. .toList();
  1120. }
  1121. return null;
  1122. }
  1123. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1124. /// Parameters:
  1125. ///
  1126. /// * [String] id (required):
  1127. ///
  1128. /// * [bool] isThumb:
  1129. ///
  1130. /// * [bool] isWeb:
  1131. ///
  1132. /// * [String] key:
  1133. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1134. // ignore: prefer_const_declarations
  1135. final path = r'/asset/file/{id}'
  1136. .replaceAll('{id}', id);
  1137. // ignore: prefer_final_locals
  1138. Object? postBody;
  1139. final queryParams = <QueryParam>[];
  1140. final headerParams = <String, String>{};
  1141. final formParams = <String, String>{};
  1142. if (isThumb != null) {
  1143. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1144. }
  1145. if (isWeb != null) {
  1146. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1147. }
  1148. if (key != null) {
  1149. queryParams.addAll(_queryParams('', 'key', key));
  1150. }
  1151. const contentTypes = <String>[];
  1152. return apiClient.invokeAPI(
  1153. path,
  1154. 'GET',
  1155. queryParams,
  1156. postBody,
  1157. headerParams,
  1158. formParams,
  1159. contentTypes.isEmpty ? null : contentTypes.first,
  1160. );
  1161. }
  1162. /// Parameters:
  1163. ///
  1164. /// * [String] id (required):
  1165. ///
  1166. /// * [bool] isThumb:
  1167. ///
  1168. /// * [bool] isWeb:
  1169. ///
  1170. /// * [String] key:
  1171. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1172. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1173. if (response.statusCode >= HttpStatus.badRequest) {
  1174. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1175. }
  1176. // When a remote server returns no body with a status of 204, we shall not decode it.
  1177. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1178. // FormatException when trying to decode an empty string.
  1179. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1180. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1181. }
  1182. return null;
  1183. }
  1184. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1185. /// Parameters:
  1186. ///
  1187. /// * [String] id (required):
  1188. ///
  1189. /// * [UpdateAssetDto] updateAssetDto (required):
  1190. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1191. // ignore: prefer_const_declarations
  1192. final path = r'/asset/{id}'
  1193. .replaceAll('{id}', id);
  1194. // ignore: prefer_final_locals
  1195. Object? postBody = updateAssetDto;
  1196. final queryParams = <QueryParam>[];
  1197. final headerParams = <String, String>{};
  1198. final formParams = <String, String>{};
  1199. const contentTypes = <String>['application/json'];
  1200. return apiClient.invokeAPI(
  1201. path,
  1202. 'PUT',
  1203. queryParams,
  1204. postBody,
  1205. headerParams,
  1206. formParams,
  1207. contentTypes.isEmpty ? null : contentTypes.first,
  1208. );
  1209. }
  1210. /// Parameters:
  1211. ///
  1212. /// * [String] id (required):
  1213. ///
  1214. /// * [UpdateAssetDto] updateAssetDto (required):
  1215. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1216. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1217. if (response.statusCode >= HttpStatus.badRequest) {
  1218. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1219. }
  1220. // When a remote server returns no body with a status of 204, we shall not decode it.
  1221. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1222. // FormatException when trying to decode an empty string.
  1223. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1224. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1225. }
  1226. return null;
  1227. }
  1228. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1229. /// Parameters:
  1230. ///
  1231. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1232. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1233. // ignore: prefer_const_declarations
  1234. final path = r'/asset';
  1235. // ignore: prefer_final_locals
  1236. Object? postBody = assetBulkUpdateDto;
  1237. final queryParams = <QueryParam>[];
  1238. final headerParams = <String, String>{};
  1239. final formParams = <String, String>{};
  1240. const contentTypes = <String>['application/json'];
  1241. return apiClient.invokeAPI(
  1242. path,
  1243. 'PUT',
  1244. queryParams,
  1245. postBody,
  1246. headerParams,
  1247. formParams,
  1248. contentTypes.isEmpty ? null : contentTypes.first,
  1249. );
  1250. }
  1251. /// Parameters:
  1252. ///
  1253. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1254. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1255. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1256. if (response.statusCode >= HttpStatus.badRequest) {
  1257. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1258. }
  1259. }
  1260. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1261. /// Parameters:
  1262. ///
  1263. /// * [MultipartFile] assetData (required):
  1264. ///
  1265. /// * [String] deviceAssetId (required):
  1266. ///
  1267. /// * [String] deviceId (required):
  1268. ///
  1269. /// * [DateTime] fileCreatedAt (required):
  1270. ///
  1271. /// * [DateTime] fileModifiedAt (required):
  1272. ///
  1273. /// * [bool] isFavorite (required):
  1274. ///
  1275. /// * [String] key:
  1276. ///
  1277. /// * [String] duration:
  1278. ///
  1279. /// * [bool] isArchived:
  1280. ///
  1281. /// * [bool] isReadOnly:
  1282. ///
  1283. /// * [bool] isVisible:
  1284. ///
  1285. /// * [MultipartFile] livePhotoData:
  1286. ///
  1287. /// * [MultipartFile] sidecarData:
  1288. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isReadOnly, bool? isVisible, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1289. // ignore: prefer_const_declarations
  1290. final path = r'/asset/upload';
  1291. // ignore: prefer_final_locals
  1292. Object? postBody;
  1293. final queryParams = <QueryParam>[];
  1294. final headerParams = <String, String>{};
  1295. final formParams = <String, String>{};
  1296. if (key != null) {
  1297. queryParams.addAll(_queryParams('', 'key', key));
  1298. }
  1299. const contentTypes = <String>['multipart/form-data'];
  1300. bool hasFields = false;
  1301. final mp = MultipartRequest('POST', Uri.parse(path));
  1302. if (assetData != null) {
  1303. hasFields = true;
  1304. mp.fields[r'assetData'] = assetData.field;
  1305. mp.files.add(assetData);
  1306. }
  1307. if (deviceAssetId != null) {
  1308. hasFields = true;
  1309. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1310. }
  1311. if (deviceId != null) {
  1312. hasFields = true;
  1313. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1314. }
  1315. if (duration != null) {
  1316. hasFields = true;
  1317. mp.fields[r'duration'] = parameterToString(duration);
  1318. }
  1319. if (fileCreatedAt != null) {
  1320. hasFields = true;
  1321. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1322. }
  1323. if (fileModifiedAt != null) {
  1324. hasFields = true;
  1325. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1326. }
  1327. if (isArchived != null) {
  1328. hasFields = true;
  1329. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1330. }
  1331. if (isFavorite != null) {
  1332. hasFields = true;
  1333. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1334. }
  1335. if (isReadOnly != null) {
  1336. hasFields = true;
  1337. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1338. }
  1339. if (isVisible != null) {
  1340. hasFields = true;
  1341. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1342. }
  1343. if (livePhotoData != null) {
  1344. hasFields = true;
  1345. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1346. mp.files.add(livePhotoData);
  1347. }
  1348. if (sidecarData != null) {
  1349. hasFields = true;
  1350. mp.fields[r'sidecarData'] = sidecarData.field;
  1351. mp.files.add(sidecarData);
  1352. }
  1353. if (hasFields) {
  1354. postBody = mp;
  1355. }
  1356. return apiClient.invokeAPI(
  1357. path,
  1358. 'POST',
  1359. queryParams,
  1360. postBody,
  1361. headerParams,
  1362. formParams,
  1363. contentTypes.isEmpty ? null : contentTypes.first,
  1364. );
  1365. }
  1366. /// Parameters:
  1367. ///
  1368. /// * [MultipartFile] assetData (required):
  1369. ///
  1370. /// * [String] deviceAssetId (required):
  1371. ///
  1372. /// * [String] deviceId (required):
  1373. ///
  1374. /// * [DateTime] fileCreatedAt (required):
  1375. ///
  1376. /// * [DateTime] fileModifiedAt (required):
  1377. ///
  1378. /// * [bool] isFavorite (required):
  1379. ///
  1380. /// * [String] key:
  1381. ///
  1382. /// * [String] duration:
  1383. ///
  1384. /// * [bool] isArchived:
  1385. ///
  1386. /// * [bool] isReadOnly:
  1387. ///
  1388. /// * [bool] isVisible:
  1389. ///
  1390. /// * [MultipartFile] livePhotoData:
  1391. ///
  1392. /// * [MultipartFile] sidecarData:
  1393. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isReadOnly, bool? isVisible, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1394. final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key: key, duration: duration, isArchived: isArchived, isReadOnly: isReadOnly, isVisible: isVisible, livePhotoData: livePhotoData, sidecarData: sidecarData, );
  1395. if (response.statusCode >= HttpStatus.badRequest) {
  1396. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1397. }
  1398. // When a remote server returns no body with a status of 204, we shall not decode it.
  1399. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1400. // FormatException when trying to decode an empty string.
  1401. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1402. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1403. }
  1404. return null;
  1405. }
  1406. }