asset_api.dart 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  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. ///
  14. ///
  15. /// Check duplicated asset before uploading - for Web upload used
  16. ///
  17. /// Note: This method returns the HTTP [Response].
  18. ///
  19. /// Parameters:
  20. ///
  21. /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
  22. Future<Response> checkDuplicateAssetWithHttpInfo(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
  23. // ignore: prefer_const_declarations
  24. final path = r'/asset/check';
  25. // ignore: prefer_final_locals
  26. Object? postBody = checkDuplicateAssetDto;
  27. final queryParams = <QueryParam>[];
  28. final headerParams = <String, String>{};
  29. final formParams = <String, String>{};
  30. const contentTypes = <String>['application/json'];
  31. return apiClient.invokeAPI(
  32. path,
  33. 'POST',
  34. queryParams,
  35. postBody,
  36. headerParams,
  37. formParams,
  38. contentTypes.isEmpty ? null : contentTypes.first,
  39. );
  40. }
  41. ///
  42. ///
  43. /// Check duplicated asset before uploading - for Web upload used
  44. ///
  45. /// Parameters:
  46. ///
  47. /// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
  48. Future<CheckDuplicateAssetResponseDto?> checkDuplicateAsset(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
  49. final response = await checkDuplicateAssetWithHttpInfo(checkDuplicateAssetDto,);
  50. if (response.statusCode >= HttpStatus.badRequest) {
  51. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  52. }
  53. // When a remote server returns no body with a status of 204, we shall not decode it.
  54. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  55. // FormatException when trying to decode an empty string.
  56. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  57. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckDuplicateAssetResponseDto',) as CheckDuplicateAssetResponseDto;
  58. }
  59. return null;
  60. }
  61. ///
  62. ///
  63. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  64. ///
  65. /// Note: This method returns the HTTP [Response].
  66. ///
  67. /// Parameters:
  68. ///
  69. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  70. Future<Response> checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  71. // ignore: prefer_const_declarations
  72. final path = r'/asset/exist';
  73. // ignore: prefer_final_locals
  74. Object? postBody = checkExistingAssetsDto;
  75. final queryParams = <QueryParam>[];
  76. final headerParams = <String, String>{};
  77. final formParams = <String, String>{};
  78. const contentTypes = <String>['application/json'];
  79. return apiClient.invokeAPI(
  80. path,
  81. 'POST',
  82. queryParams,
  83. postBody,
  84. headerParams,
  85. formParams,
  86. contentTypes.isEmpty ? null : contentTypes.first,
  87. );
  88. }
  89. ///
  90. ///
  91. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  92. ///
  93. /// Parameters:
  94. ///
  95. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  96. Future<CheckExistingAssetsResponseDto?> checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  97. final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,);
  98. if (response.statusCode >= HttpStatus.badRequest) {
  99. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  100. }
  101. // When a remote server returns no body with a status of 204, we shall not decode it.
  102. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  103. // FormatException when trying to decode an empty string.
  104. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  105. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto;
  106. }
  107. return null;
  108. }
  109. /// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
  110. /// Parameters:
  111. ///
  112. /// * [DeleteAssetDto] deleteAssetDto (required):
  113. Future<Response> deleteAssetWithHttpInfo(DeleteAssetDto deleteAssetDto,) async {
  114. // ignore: prefer_const_declarations
  115. final path = r'/asset';
  116. // ignore: prefer_final_locals
  117. Object? postBody = deleteAssetDto;
  118. final queryParams = <QueryParam>[];
  119. final headerParams = <String, String>{};
  120. final formParams = <String, String>{};
  121. const contentTypes = <String>['application/json'];
  122. return apiClient.invokeAPI(
  123. path,
  124. 'DELETE',
  125. queryParams,
  126. postBody,
  127. headerParams,
  128. formParams,
  129. contentTypes.isEmpty ? null : contentTypes.first,
  130. );
  131. }
  132. /// Parameters:
  133. ///
  134. /// * [DeleteAssetDto] deleteAssetDto (required):
  135. Future<List<DeleteAssetResponseDto>?> deleteAsset(DeleteAssetDto deleteAssetDto,) async {
  136. final response = await deleteAssetWithHttpInfo(deleteAssetDto,);
  137. if (response.statusCode >= HttpStatus.badRequest) {
  138. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  139. }
  140. // When a remote server returns no body with a status of 204, we shall not decode it.
  141. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  142. // FormatException when trying to decode an empty string.
  143. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  144. final responseBody = await _decodeBodyBytes(response);
  145. return (await apiClient.deserializeAsync(responseBody, 'List<DeleteAssetResponseDto>') as List)
  146. .cast<DeleteAssetResponseDto>()
  147. .toList();
  148. }
  149. return null;
  150. }
  151. /// Performs an HTTP 'GET /asset/download' operation and returns the [Response].
  152. /// Parameters:
  153. ///
  154. /// * [String] aid (required):
  155. ///
  156. /// * [String] did (required):
  157. ///
  158. /// * [bool] isThumb:
  159. ///
  160. /// * [bool] isWeb:
  161. Future<Response> downloadFileWithHttpInfo(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
  162. // ignore: prefer_const_declarations
  163. final path = r'/asset/download';
  164. // ignore: prefer_final_locals
  165. Object? postBody;
  166. final queryParams = <QueryParam>[];
  167. final headerParams = <String, String>{};
  168. final formParams = <String, String>{};
  169. queryParams.addAll(_queryParams('', 'aid', aid));
  170. queryParams.addAll(_queryParams('', 'did', did));
  171. if (isThumb != null) {
  172. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  173. }
  174. if (isWeb != null) {
  175. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  176. }
  177. const contentTypes = <String>[];
  178. return apiClient.invokeAPI(
  179. path,
  180. 'GET',
  181. queryParams,
  182. postBody,
  183. headerParams,
  184. formParams,
  185. contentTypes.isEmpty ? null : contentTypes.first,
  186. );
  187. }
  188. /// Parameters:
  189. ///
  190. /// * [String] aid (required):
  191. ///
  192. /// * [String] did (required):
  193. ///
  194. /// * [bool] isThumb:
  195. ///
  196. /// * [bool] isWeb:
  197. Future<Object?> downloadFile(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
  198. final response = await downloadFileWithHttpInfo(aid, did, isThumb: isThumb, isWeb: isWeb, );
  199. if (response.statusCode >= HttpStatus.badRequest) {
  200. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  201. }
  202. // When a remote server returns no body with a status of 204, we shall not decode it.
  203. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  204. // FormatException when trying to decode an empty string.
  205. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  206. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  207. }
  208. return null;
  209. }
  210. /// Performs an HTTP 'GET /asset/download-library' operation and returns the [Response].
  211. /// Parameters:
  212. ///
  213. /// * [num] skip:
  214. Future<Response> downloadLibraryWithHttpInfo({ num? skip, }) async {
  215. // ignore: prefer_const_declarations
  216. final path = r'/asset/download-library';
  217. // ignore: prefer_final_locals
  218. Object? postBody;
  219. final queryParams = <QueryParam>[];
  220. final headerParams = <String, String>{};
  221. final formParams = <String, String>{};
  222. if (skip != null) {
  223. queryParams.addAll(_queryParams('', 'skip', skip));
  224. }
  225. const contentTypes = <String>[];
  226. return apiClient.invokeAPI(
  227. path,
  228. 'GET',
  229. queryParams,
  230. postBody,
  231. headerParams,
  232. formParams,
  233. contentTypes.isEmpty ? null : contentTypes.first,
  234. );
  235. }
  236. /// Parameters:
  237. ///
  238. /// * [num] skip:
  239. Future<Object?> downloadLibrary({ num? skip, }) async {
  240. final response = await downloadLibraryWithHttpInfo( skip: skip, );
  241. if (response.statusCode >= HttpStatus.badRequest) {
  242. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  243. }
  244. // When a remote server returns no body with a status of 204, we shall not decode it.
  245. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  246. // FormatException when trying to decode an empty string.
  247. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  248. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  249. }
  250. return null;
  251. }
  252. ///
  253. ///
  254. /// Get all AssetEntity belong to the user
  255. ///
  256. /// Note: This method returns the HTTP [Response].
  257. Future<Response> getAllAssetsWithHttpInfo() async {
  258. // ignore: prefer_const_declarations
  259. final path = r'/asset';
  260. // ignore: prefer_final_locals
  261. Object? postBody;
  262. final queryParams = <QueryParam>[];
  263. final headerParams = <String, String>{};
  264. final formParams = <String, String>{};
  265. const contentTypes = <String>[];
  266. return apiClient.invokeAPI(
  267. path,
  268. 'GET',
  269. queryParams,
  270. postBody,
  271. headerParams,
  272. formParams,
  273. contentTypes.isEmpty ? null : contentTypes.first,
  274. );
  275. }
  276. ///
  277. ///
  278. /// Get all AssetEntity belong to the user
  279. Future<List<AssetResponseDto>?> getAllAssets() async {
  280. final response = await getAllAssetsWithHttpInfo();
  281. if (response.statusCode >= HttpStatus.badRequest) {
  282. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  283. }
  284. // When a remote server returns no body with a status of 204, we shall not decode it.
  285. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  286. // FormatException when trying to decode an empty string.
  287. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  288. final responseBody = await _decodeBodyBytes(response);
  289. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  290. .cast<AssetResponseDto>()
  291. .toList();
  292. }
  293. return null;
  294. }
  295. ///
  296. ///
  297. /// Get a single asset's information
  298. ///
  299. /// Note: This method returns the HTTP [Response].
  300. ///
  301. /// Parameters:
  302. ///
  303. /// * [String] assetId (required):
  304. Future<Response> getAssetByIdWithHttpInfo(String assetId,) async {
  305. // ignore: prefer_const_declarations
  306. final path = r'/asset/assetById/{assetId}'
  307. .replaceAll('{assetId}', assetId);
  308. // ignore: prefer_final_locals
  309. Object? postBody;
  310. final queryParams = <QueryParam>[];
  311. final headerParams = <String, String>{};
  312. final formParams = <String, String>{};
  313. const contentTypes = <String>[];
  314. return apiClient.invokeAPI(
  315. path,
  316. 'GET',
  317. queryParams,
  318. postBody,
  319. headerParams,
  320. formParams,
  321. contentTypes.isEmpty ? null : contentTypes.first,
  322. );
  323. }
  324. ///
  325. ///
  326. /// Get a single asset's information
  327. ///
  328. /// Parameters:
  329. ///
  330. /// * [String] assetId (required):
  331. Future<AssetResponseDto?> getAssetById(String assetId,) async {
  332. final response = await getAssetByIdWithHttpInfo(assetId,);
  333. if (response.statusCode >= HttpStatus.badRequest) {
  334. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  335. }
  336. // When a remote server returns no body with a status of 204, we shall not decode it.
  337. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  338. // FormatException when trying to decode an empty string.
  339. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  340. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  341. }
  342. return null;
  343. }
  344. /// Performs an HTTP 'POST /asset/time-bucket' operation and returns the [Response].
  345. /// Parameters:
  346. ///
  347. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  348. Future<Response> getAssetByTimeBucketWithHttpInfo(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  349. // ignore: prefer_const_declarations
  350. final path = r'/asset/time-bucket';
  351. // ignore: prefer_final_locals
  352. Object? postBody = getAssetByTimeBucketDto;
  353. final queryParams = <QueryParam>[];
  354. final headerParams = <String, String>{};
  355. final formParams = <String, String>{};
  356. const contentTypes = <String>['application/json'];
  357. return apiClient.invokeAPI(
  358. path,
  359. 'POST',
  360. queryParams,
  361. postBody,
  362. headerParams,
  363. formParams,
  364. contentTypes.isEmpty ? null : contentTypes.first,
  365. );
  366. }
  367. /// Parameters:
  368. ///
  369. /// * [GetAssetByTimeBucketDto] getAssetByTimeBucketDto (required):
  370. Future<List<AssetResponseDto>?> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto,) async {
  371. final response = await getAssetByTimeBucketWithHttpInfo(getAssetByTimeBucketDto,);
  372. if (response.statusCode >= HttpStatus.badRequest) {
  373. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  374. }
  375. // When a remote server returns no body with a status of 204, we shall not decode it.
  376. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  377. // FormatException when trying to decode an empty string.
  378. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  379. final responseBody = await _decodeBodyBytes(response);
  380. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  381. .cast<AssetResponseDto>()
  382. .toList();
  383. }
  384. return null;
  385. }
  386. /// Performs an HTTP 'POST /asset/count-by-time-bucket' operation and returns the [Response].
  387. /// Parameters:
  388. ///
  389. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  390. Future<Response> getAssetCountByTimeBucketWithHttpInfo(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  391. // ignore: prefer_const_declarations
  392. final path = r'/asset/count-by-time-bucket';
  393. // ignore: prefer_final_locals
  394. Object? postBody = getAssetCountByTimeBucketDto;
  395. final queryParams = <QueryParam>[];
  396. final headerParams = <String, String>{};
  397. final formParams = <String, String>{};
  398. const contentTypes = <String>['application/json'];
  399. return apiClient.invokeAPI(
  400. path,
  401. 'POST',
  402. queryParams,
  403. postBody,
  404. headerParams,
  405. formParams,
  406. contentTypes.isEmpty ? null : contentTypes.first,
  407. );
  408. }
  409. /// Parameters:
  410. ///
  411. /// * [GetAssetCountByTimeBucketDto] getAssetCountByTimeBucketDto (required):
  412. Future<AssetCountByTimeBucketResponseDto?> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto,) async {
  413. final response = await getAssetCountByTimeBucketWithHttpInfo(getAssetCountByTimeBucketDto,);
  414. if (response.statusCode >= HttpStatus.badRequest) {
  415. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  416. }
  417. // When a remote server returns no body with a status of 204, we shall not decode it.
  418. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  419. // FormatException when trying to decode an empty string.
  420. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  421. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByTimeBucketResponseDto',) as AssetCountByTimeBucketResponseDto;
  422. }
  423. return null;
  424. }
  425. /// Performs an HTTP 'GET /asset/count-by-user-id' operation and returns the [Response].
  426. Future<Response> getAssetCountByUserIdWithHttpInfo() async {
  427. // ignore: prefer_const_declarations
  428. final path = r'/asset/count-by-user-id';
  429. // ignore: prefer_final_locals
  430. Object? postBody;
  431. final queryParams = <QueryParam>[];
  432. final headerParams = <String, String>{};
  433. final formParams = <String, String>{};
  434. const contentTypes = <String>[];
  435. return apiClient.invokeAPI(
  436. path,
  437. 'GET',
  438. queryParams,
  439. postBody,
  440. headerParams,
  441. formParams,
  442. contentTypes.isEmpty ? null : contentTypes.first,
  443. );
  444. }
  445. Future<AssetCountByUserIdResponseDto?> getAssetCountByUserId() async {
  446. final response = await getAssetCountByUserIdWithHttpInfo();
  447. if (response.statusCode >= HttpStatus.badRequest) {
  448. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  449. }
  450. // When a remote server returns no body with a status of 204, we shall not decode it.
  451. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  452. // FormatException when trying to decode an empty string.
  453. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  454. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetCountByUserIdResponseDto',) as AssetCountByUserIdResponseDto;
  455. }
  456. return null;
  457. }
  458. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  459. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  460. // ignore: prefer_const_declarations
  461. final path = r'/asset/search-terms';
  462. // ignore: prefer_final_locals
  463. Object? postBody;
  464. final queryParams = <QueryParam>[];
  465. final headerParams = <String, String>{};
  466. final formParams = <String, String>{};
  467. const contentTypes = <String>[];
  468. return apiClient.invokeAPI(
  469. path,
  470. 'GET',
  471. queryParams,
  472. postBody,
  473. headerParams,
  474. formParams,
  475. contentTypes.isEmpty ? null : contentTypes.first,
  476. );
  477. }
  478. Future<List<String>?> getAssetSearchTerms() async {
  479. final response = await getAssetSearchTermsWithHttpInfo();
  480. if (response.statusCode >= HttpStatus.badRequest) {
  481. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  482. }
  483. // When a remote server returns no body with a status of 204, we shall not decode it.
  484. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  485. // FormatException when trying to decode an empty string.
  486. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  487. final responseBody = await _decodeBodyBytes(response);
  488. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  489. .cast<String>()
  490. .toList();
  491. }
  492. return null;
  493. }
  494. /// Performs an HTTP 'GET /asset/thumbnail/{assetId}' operation and returns the [Response].
  495. /// Parameters:
  496. ///
  497. /// * [String] assetId (required):
  498. ///
  499. /// * [ThumbnailFormat] format:
  500. Future<Response> getAssetThumbnailWithHttpInfo(String assetId, { ThumbnailFormat? format, }) async {
  501. // ignore: prefer_const_declarations
  502. final path = r'/asset/thumbnail/{assetId}'
  503. .replaceAll('{assetId}', assetId);
  504. // ignore: prefer_final_locals
  505. Object? postBody;
  506. final queryParams = <QueryParam>[];
  507. final headerParams = <String, String>{};
  508. final formParams = <String, String>{};
  509. if (format != null) {
  510. queryParams.addAll(_queryParams('', 'format', format));
  511. }
  512. const contentTypes = <String>[];
  513. return apiClient.invokeAPI(
  514. path,
  515. 'GET',
  516. queryParams,
  517. postBody,
  518. headerParams,
  519. formParams,
  520. contentTypes.isEmpty ? null : contentTypes.first,
  521. );
  522. }
  523. /// Parameters:
  524. ///
  525. /// * [String] assetId (required):
  526. ///
  527. /// * [ThumbnailFormat] format:
  528. Future<Object?> getAssetThumbnail(String assetId, { ThumbnailFormat? format, }) async {
  529. final response = await getAssetThumbnailWithHttpInfo(assetId, format: format, );
  530. if (response.statusCode >= HttpStatus.badRequest) {
  531. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  532. }
  533. // When a remote server returns no body with a status of 204, we shall not decode it.
  534. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  535. // FormatException when trying to decode an empty string.
  536. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  537. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  538. }
  539. return null;
  540. }
  541. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  542. Future<Response> getCuratedLocationsWithHttpInfo() async {
  543. // ignore: prefer_const_declarations
  544. final path = r'/asset/curated-locations';
  545. // ignore: prefer_final_locals
  546. Object? postBody;
  547. final queryParams = <QueryParam>[];
  548. final headerParams = <String, String>{};
  549. final formParams = <String, String>{};
  550. const contentTypes = <String>[];
  551. return apiClient.invokeAPI(
  552. path,
  553. 'GET',
  554. queryParams,
  555. postBody,
  556. headerParams,
  557. formParams,
  558. contentTypes.isEmpty ? null : contentTypes.first,
  559. );
  560. }
  561. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  562. final response = await getCuratedLocationsWithHttpInfo();
  563. if (response.statusCode >= HttpStatus.badRequest) {
  564. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  565. }
  566. // When a remote server returns no body with a status of 204, we shall not decode it.
  567. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  568. // FormatException when trying to decode an empty string.
  569. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  570. final responseBody = await _decodeBodyBytes(response);
  571. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  572. .cast<CuratedLocationsResponseDto>()
  573. .toList();
  574. }
  575. return null;
  576. }
  577. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  578. Future<Response> getCuratedObjectsWithHttpInfo() async {
  579. // ignore: prefer_const_declarations
  580. final path = r'/asset/curated-objects';
  581. // ignore: prefer_final_locals
  582. Object? postBody;
  583. final queryParams = <QueryParam>[];
  584. final headerParams = <String, String>{};
  585. final formParams = <String, String>{};
  586. const contentTypes = <String>[];
  587. return apiClient.invokeAPI(
  588. path,
  589. 'GET',
  590. queryParams,
  591. postBody,
  592. headerParams,
  593. formParams,
  594. contentTypes.isEmpty ? null : contentTypes.first,
  595. );
  596. }
  597. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  598. final response = await getCuratedObjectsWithHttpInfo();
  599. if (response.statusCode >= HttpStatus.badRequest) {
  600. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  601. }
  602. // When a remote server returns no body with a status of 204, we shall not decode it.
  603. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  604. // FormatException when trying to decode an empty string.
  605. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  606. final responseBody = await _decodeBodyBytes(response);
  607. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  608. .cast<CuratedObjectsResponseDto>()
  609. .toList();
  610. }
  611. return null;
  612. }
  613. ///
  614. ///
  615. /// Get all asset of a device that are in the database, ID only.
  616. ///
  617. /// Note: This method returns the HTTP [Response].
  618. ///
  619. /// Parameters:
  620. ///
  621. /// * [String] deviceId (required):
  622. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  623. // ignore: prefer_const_declarations
  624. final path = r'/asset/{deviceId}'
  625. .replaceAll('{deviceId}', deviceId);
  626. // ignore: prefer_final_locals
  627. Object? postBody;
  628. final queryParams = <QueryParam>[];
  629. final headerParams = <String, String>{};
  630. final formParams = <String, String>{};
  631. const contentTypes = <String>[];
  632. return apiClient.invokeAPI(
  633. path,
  634. 'GET',
  635. queryParams,
  636. postBody,
  637. headerParams,
  638. formParams,
  639. contentTypes.isEmpty ? null : contentTypes.first,
  640. );
  641. }
  642. ///
  643. ///
  644. /// Get all asset of a device that are in the database, ID only.
  645. ///
  646. /// Parameters:
  647. ///
  648. /// * [String] deviceId (required):
  649. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  650. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  651. if (response.statusCode >= HttpStatus.badRequest) {
  652. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  653. }
  654. // When a remote server returns no body with a status of 204, we shall not decode it.
  655. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  656. // FormatException when trying to decode an empty string.
  657. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  658. final responseBody = await _decodeBodyBytes(response);
  659. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  660. .cast<String>()
  661. .toList();
  662. }
  663. return null;
  664. }
  665. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  666. /// Parameters:
  667. ///
  668. /// * [SearchAssetDto] searchAssetDto (required):
  669. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  670. // ignore: prefer_const_declarations
  671. final path = r'/asset/search';
  672. // ignore: prefer_final_locals
  673. Object? postBody = searchAssetDto;
  674. final queryParams = <QueryParam>[];
  675. final headerParams = <String, String>{};
  676. final formParams = <String, String>{};
  677. const contentTypes = <String>['application/json'];
  678. return apiClient.invokeAPI(
  679. path,
  680. 'POST',
  681. queryParams,
  682. postBody,
  683. headerParams,
  684. formParams,
  685. contentTypes.isEmpty ? null : contentTypes.first,
  686. );
  687. }
  688. /// Parameters:
  689. ///
  690. /// * [SearchAssetDto] searchAssetDto (required):
  691. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  692. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  693. if (response.statusCode >= HttpStatus.badRequest) {
  694. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  695. }
  696. // When a remote server returns no body with a status of 204, we shall not decode it.
  697. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  698. // FormatException when trying to decode an empty string.
  699. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  700. final responseBody = await _decodeBodyBytes(response);
  701. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  702. .cast<AssetResponseDto>()
  703. .toList();
  704. }
  705. return null;
  706. }
  707. /// Performs an HTTP 'GET /asset/file' operation and returns the [Response].
  708. /// Parameters:
  709. ///
  710. /// * [String] aid (required):
  711. ///
  712. /// * [String] did (required):
  713. ///
  714. /// * [bool] isThumb:
  715. ///
  716. /// * [bool] isWeb:
  717. Future<Response> serveFileWithHttpInfo(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
  718. // ignore: prefer_const_declarations
  719. final path = r'/asset/file';
  720. // ignore: prefer_final_locals
  721. Object? postBody;
  722. final queryParams = <QueryParam>[];
  723. final headerParams = <String, String>{};
  724. final formParams = <String, String>{};
  725. queryParams.addAll(_queryParams('', 'aid', aid));
  726. queryParams.addAll(_queryParams('', 'did', did));
  727. if (isThumb != null) {
  728. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  729. }
  730. if (isWeb != null) {
  731. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  732. }
  733. const contentTypes = <String>[];
  734. return apiClient.invokeAPI(
  735. path,
  736. 'GET',
  737. queryParams,
  738. postBody,
  739. headerParams,
  740. formParams,
  741. contentTypes.isEmpty ? null : contentTypes.first,
  742. );
  743. }
  744. /// Parameters:
  745. ///
  746. /// * [String] aid (required):
  747. ///
  748. /// * [String] did (required):
  749. ///
  750. /// * [bool] isThumb:
  751. ///
  752. /// * [bool] isWeb:
  753. Future<Object?> serveFile(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
  754. final response = await serveFileWithHttpInfo(aid, did, isThumb: isThumb, isWeb: isWeb, );
  755. if (response.statusCode >= HttpStatus.badRequest) {
  756. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  757. }
  758. // When a remote server returns no body with a status of 204, we shall not decode it.
  759. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  760. // FormatException when trying to decode an empty string.
  761. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  762. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  763. }
  764. return null;
  765. }
  766. ///
  767. ///
  768. /// Update an asset
  769. ///
  770. /// Note: This method returns the HTTP [Response].
  771. ///
  772. /// Parameters:
  773. ///
  774. /// * [String] assetId (required):
  775. ///
  776. /// * [UpdateAssetDto] updateAssetDto (required):
  777. Future<Response> updateAssetByIdWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
  778. // ignore: prefer_const_declarations
  779. final path = r'/asset/assetById/{assetId}'
  780. .replaceAll('{assetId}', assetId);
  781. // ignore: prefer_final_locals
  782. Object? postBody = updateAssetDto;
  783. final queryParams = <QueryParam>[];
  784. final headerParams = <String, String>{};
  785. final formParams = <String, String>{};
  786. const contentTypes = <String>['application/json'];
  787. return apiClient.invokeAPI(
  788. path,
  789. 'PUT',
  790. queryParams,
  791. postBody,
  792. headerParams,
  793. formParams,
  794. contentTypes.isEmpty ? null : contentTypes.first,
  795. );
  796. }
  797. ///
  798. ///
  799. /// Update an asset
  800. ///
  801. /// Parameters:
  802. ///
  803. /// * [String] assetId (required):
  804. ///
  805. /// * [UpdateAssetDto] updateAssetDto (required):
  806. Future<AssetResponseDto?> updateAssetById(String assetId, UpdateAssetDto updateAssetDto,) async {
  807. final response = await updateAssetByIdWithHttpInfo(assetId, updateAssetDto,);
  808. if (response.statusCode >= HttpStatus.badRequest) {
  809. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  810. }
  811. // When a remote server returns no body with a status of 204, we shall not decode it.
  812. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  813. // FormatException when trying to decode an empty string.
  814. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  815. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  816. }
  817. return null;
  818. }
  819. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  820. /// Parameters:
  821. ///
  822. /// * [MultipartFile] assetData (required):
  823. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData,) async {
  824. // ignore: prefer_const_declarations
  825. final path = r'/asset/upload';
  826. // ignore: prefer_final_locals
  827. Object? postBody;
  828. final queryParams = <QueryParam>[];
  829. final headerParams = <String, String>{};
  830. final formParams = <String, String>{};
  831. const contentTypes = <String>['multipart/form-data'];
  832. bool hasFields = false;
  833. final mp = MultipartRequest('POST', Uri.parse(path));
  834. if (assetData != null) {
  835. hasFields = true;
  836. mp.fields[r'assetData'] = assetData.field;
  837. mp.files.add(assetData);
  838. }
  839. if (hasFields) {
  840. postBody = mp;
  841. }
  842. return apiClient.invokeAPI(
  843. path,
  844. 'POST',
  845. queryParams,
  846. postBody,
  847. headerParams,
  848. formParams,
  849. contentTypes.isEmpty ? null : contentTypes.first,
  850. );
  851. }
  852. /// Parameters:
  853. ///
  854. /// * [MultipartFile] assetData (required):
  855. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData,) async {
  856. final response = await uploadFileWithHttpInfo(assetData,);
  857. if (response.statusCode >= HttpStatus.badRequest) {
  858. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  859. }
  860. // When a remote server returns no body with a status of 204, we shall not decode it.
  861. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  862. // FormatException when trying to decode an empty string.
  863. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  864. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  865. }
  866. return null;
  867. }
  868. }