asset_api.dart 49 KB

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