asset_api.dart 44 KB

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