asset_api.dart 33 KB

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