asset_api.dart 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  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. Future<Response> getMapMarkersWithHttpInfo() async {
  827. // ignore: prefer_const_declarations
  828. final path = r'/asset/map-marker';
  829. // ignore: prefer_final_locals
  830. Object? postBody;
  831. final queryParams = <QueryParam>[];
  832. final headerParams = <String, String>{};
  833. final formParams = <String, String>{};
  834. const contentTypes = <String>[];
  835. return apiClient.invokeAPI(
  836. path,
  837. 'GET',
  838. queryParams,
  839. postBody,
  840. headerParams,
  841. formParams,
  842. contentTypes.isEmpty ? null : contentTypes.first,
  843. );
  844. }
  845. /// Get all assets that have GPS information embedded
  846. Future<List<Object>?> getMapMarkers() async {
  847. final response = await getMapMarkersWithHttpInfo();
  848. if (response.statusCode >= HttpStatus.badRequest) {
  849. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  850. }
  851. // When a remote server returns no body with a status of 204, we shall not decode it.
  852. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  853. // FormatException when trying to decode an empty string.
  854. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  855. final responseBody = await _decodeBodyBytes(response);
  856. return (await apiClient.deserializeAsync(responseBody, 'List<Object>') as List)
  857. .cast<Object>()
  858. .toList();
  859. }
  860. return null;
  861. }
  862. /// Get all asset of a device that are in the database, ID only.
  863. ///
  864. /// Note: This method returns the HTTP [Response].
  865. ///
  866. /// Parameters:
  867. ///
  868. /// * [String] deviceId (required):
  869. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  870. // ignore: prefer_const_declarations
  871. final path = r'/asset/{deviceId}'
  872. .replaceAll('{deviceId}', deviceId);
  873. // ignore: prefer_final_locals
  874. Object? postBody;
  875. final queryParams = <QueryParam>[];
  876. final headerParams = <String, String>{};
  877. final formParams = <String, String>{};
  878. const contentTypes = <String>[];
  879. return apiClient.invokeAPI(
  880. path,
  881. 'GET',
  882. queryParams,
  883. postBody,
  884. headerParams,
  885. formParams,
  886. contentTypes.isEmpty ? null : contentTypes.first,
  887. );
  888. }
  889. /// Get all asset of a device that are in the database, ID only.
  890. ///
  891. /// Parameters:
  892. ///
  893. /// * [String] deviceId (required):
  894. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  895. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  896. if (response.statusCode >= HttpStatus.badRequest) {
  897. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  898. }
  899. // When a remote server returns no body with a status of 204, we shall not decode it.
  900. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  901. // FormatException when trying to decode an empty string.
  902. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  903. final responseBody = await _decodeBodyBytes(response);
  904. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  905. .cast<String>()
  906. .toList();
  907. }
  908. return null;
  909. }
  910. /// Performs an HTTP 'PATCH /asset/shared-link/remove' operation and returns the [Response].
  911. /// Parameters:
  912. ///
  913. /// * [RemoveAssetsDto] removeAssetsDto (required):
  914. ///
  915. /// * [String] key:
  916. Future<Response> removeAssetsFromSharedLinkWithHttpInfo(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
  917. // ignore: prefer_const_declarations
  918. final path = r'/asset/shared-link/remove';
  919. // ignore: prefer_final_locals
  920. Object? postBody = removeAssetsDto;
  921. final queryParams = <QueryParam>[];
  922. final headerParams = <String, String>{};
  923. final formParams = <String, String>{};
  924. if (key != null) {
  925. queryParams.addAll(_queryParams('', 'key', key));
  926. }
  927. const contentTypes = <String>['application/json'];
  928. return apiClient.invokeAPI(
  929. path,
  930. 'PATCH',
  931. queryParams,
  932. postBody,
  933. headerParams,
  934. formParams,
  935. contentTypes.isEmpty ? null : contentTypes.first,
  936. );
  937. }
  938. /// Parameters:
  939. ///
  940. /// * [RemoveAssetsDto] removeAssetsDto (required):
  941. ///
  942. /// * [String] key:
  943. Future<SharedLinkResponseDto?> removeAssetsFromSharedLink(RemoveAssetsDto removeAssetsDto, { String? key, }) async {
  944. final response = await removeAssetsFromSharedLinkWithHttpInfo(removeAssetsDto, key: key, );
  945. if (response.statusCode >= HttpStatus.badRequest) {
  946. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  947. }
  948. // When a remote server returns no body with a status of 204, we shall not decode it.
  949. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  950. // FormatException when trying to decode an empty string.
  951. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  952. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  953. }
  954. return null;
  955. }
  956. /// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
  957. /// Parameters:
  958. ///
  959. /// * [SearchAssetDto] searchAssetDto (required):
  960. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  961. // ignore: prefer_const_declarations
  962. final path = r'/asset/search';
  963. // ignore: prefer_final_locals
  964. Object? postBody = searchAssetDto;
  965. final queryParams = <QueryParam>[];
  966. final headerParams = <String, String>{};
  967. final formParams = <String, String>{};
  968. const contentTypes = <String>['application/json'];
  969. return apiClient.invokeAPI(
  970. path,
  971. 'POST',
  972. queryParams,
  973. postBody,
  974. headerParams,
  975. formParams,
  976. contentTypes.isEmpty ? null : contentTypes.first,
  977. );
  978. }
  979. /// Parameters:
  980. ///
  981. /// * [SearchAssetDto] searchAssetDto (required):
  982. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  983. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  984. if (response.statusCode >= HttpStatus.badRequest) {
  985. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  986. }
  987. // When a remote server returns no body with a status of 204, we shall not decode it.
  988. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  989. // FormatException when trying to decode an empty string.
  990. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  991. final responseBody = await _decodeBodyBytes(response);
  992. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  993. .cast<AssetResponseDto>()
  994. .toList();
  995. }
  996. return null;
  997. }
  998. /// Performs an HTTP 'GET /asset/file/{assetId}' operation and returns the [Response].
  999. /// Parameters:
  1000. ///
  1001. /// * [String] assetId (required):
  1002. ///
  1003. /// * [bool] isThumb:
  1004. ///
  1005. /// * [bool] isWeb:
  1006. ///
  1007. /// * [String] key:
  1008. Future<Response> serveFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, String? key, }) async {
  1009. // ignore: prefer_const_declarations
  1010. final path = r'/asset/file/{assetId}'
  1011. .replaceAll('{assetId}', assetId);
  1012. // ignore: prefer_final_locals
  1013. Object? postBody;
  1014. final queryParams = <QueryParam>[];
  1015. final headerParams = <String, String>{};
  1016. final formParams = <String, String>{};
  1017. if (isThumb != null) {
  1018. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1019. }
  1020. if (isWeb != null) {
  1021. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1022. }
  1023. if (key != null) {
  1024. queryParams.addAll(_queryParams('', 'key', key));
  1025. }
  1026. const contentTypes = <String>[];
  1027. return apiClient.invokeAPI(
  1028. path,
  1029. 'GET',
  1030. queryParams,
  1031. postBody,
  1032. headerParams,
  1033. formParams,
  1034. contentTypes.isEmpty ? null : contentTypes.first,
  1035. );
  1036. }
  1037. /// Parameters:
  1038. ///
  1039. /// * [String] assetId (required):
  1040. ///
  1041. /// * [bool] isThumb:
  1042. ///
  1043. /// * [bool] isWeb:
  1044. ///
  1045. /// * [String] key:
  1046. Future<MultipartFile?> serveFile(String assetId, { bool? isThumb, bool? isWeb, String? key, }) async {
  1047. final response = await serveFileWithHttpInfo(assetId, isThumb: isThumb, isWeb: isWeb, key: key, );
  1048. if (response.statusCode >= HttpStatus.badRequest) {
  1049. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1050. }
  1051. // When a remote server returns no body with a status of 204, we shall not decode it.
  1052. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1053. // FormatException when trying to decode an empty string.
  1054. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1055. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1056. }
  1057. return null;
  1058. }
  1059. /// Update an asset
  1060. ///
  1061. /// Note: This method returns the HTTP [Response].
  1062. ///
  1063. /// Parameters:
  1064. ///
  1065. /// * [String] assetId (required):
  1066. ///
  1067. /// * [UpdateAssetDto] updateAssetDto (required):
  1068. Future<Response> updateAssetWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
  1069. // ignore: prefer_const_declarations
  1070. final path = r'/asset/{assetId}'
  1071. .replaceAll('{assetId}', assetId);
  1072. // ignore: prefer_final_locals
  1073. Object? postBody = updateAssetDto;
  1074. final queryParams = <QueryParam>[];
  1075. final headerParams = <String, String>{};
  1076. final formParams = <String, String>{};
  1077. const contentTypes = <String>['application/json'];
  1078. return apiClient.invokeAPI(
  1079. path,
  1080. 'PUT',
  1081. queryParams,
  1082. postBody,
  1083. headerParams,
  1084. formParams,
  1085. contentTypes.isEmpty ? null : contentTypes.first,
  1086. );
  1087. }
  1088. /// Update an asset
  1089. ///
  1090. /// Parameters:
  1091. ///
  1092. /// * [String] assetId (required):
  1093. ///
  1094. /// * [UpdateAssetDto] updateAssetDto (required):
  1095. Future<AssetResponseDto?> updateAsset(String assetId, UpdateAssetDto updateAssetDto,) async {
  1096. final response = await updateAssetWithHttpInfo(assetId, updateAssetDto,);
  1097. if (response.statusCode >= HttpStatus.badRequest) {
  1098. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1099. }
  1100. // When a remote server returns no body with a status of 204, we shall not decode it.
  1101. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1102. // FormatException when trying to decode an empty string.
  1103. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1104. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1105. }
  1106. return null;
  1107. }
  1108. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1109. /// Parameters:
  1110. ///
  1111. /// * [AssetTypeEnum] assetType (required):
  1112. ///
  1113. /// * [MultipartFile] assetData (required):
  1114. ///
  1115. /// * [String] deviceAssetId (required):
  1116. ///
  1117. /// * [String] deviceId (required):
  1118. ///
  1119. /// * [String] fileCreatedAt (required):
  1120. ///
  1121. /// * [String] fileModifiedAt (required):
  1122. ///
  1123. /// * [bool] isFavorite (required):
  1124. ///
  1125. /// * [String] fileExtension (required):
  1126. ///
  1127. /// * [String] key:
  1128. ///
  1129. /// * [MultipartFile] livePhotoData:
  1130. ///
  1131. /// * [bool] isArchived:
  1132. ///
  1133. /// * [bool] isVisible:
  1134. ///
  1135. /// * [String] duration:
  1136. 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 {
  1137. // ignore: prefer_const_declarations
  1138. final path = r'/asset/upload';
  1139. // ignore: prefer_final_locals
  1140. Object? postBody;
  1141. final queryParams = <QueryParam>[];
  1142. final headerParams = <String, String>{};
  1143. final formParams = <String, String>{};
  1144. if (key != null) {
  1145. queryParams.addAll(_queryParams('', 'key', key));
  1146. }
  1147. const contentTypes = <String>['multipart/form-data'];
  1148. bool hasFields = false;
  1149. final mp = MultipartRequest('POST', Uri.parse(path));
  1150. if (assetType != null) {
  1151. hasFields = true;
  1152. mp.fields[r'assetType'] = parameterToString(assetType);
  1153. }
  1154. if (assetData != null) {
  1155. hasFields = true;
  1156. mp.fields[r'assetData'] = assetData.field;
  1157. mp.files.add(assetData);
  1158. }
  1159. if (livePhotoData != null) {
  1160. hasFields = true;
  1161. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1162. mp.files.add(livePhotoData);
  1163. }
  1164. if (deviceAssetId != null) {
  1165. hasFields = true;
  1166. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1167. }
  1168. if (deviceId != null) {
  1169. hasFields = true;
  1170. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1171. }
  1172. if (fileCreatedAt != null) {
  1173. hasFields = true;
  1174. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1175. }
  1176. if (fileModifiedAt != null) {
  1177. hasFields = true;
  1178. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1179. }
  1180. if (isFavorite != null) {
  1181. hasFields = true;
  1182. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1183. }
  1184. if (isArchived != null) {
  1185. hasFields = true;
  1186. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1187. }
  1188. if (isVisible != null) {
  1189. hasFields = true;
  1190. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1191. }
  1192. if (fileExtension != null) {
  1193. hasFields = true;
  1194. mp.fields[r'fileExtension'] = parameterToString(fileExtension);
  1195. }
  1196. if (duration != null) {
  1197. hasFields = true;
  1198. mp.fields[r'duration'] = parameterToString(duration);
  1199. }
  1200. if (hasFields) {
  1201. postBody = mp;
  1202. }
  1203. return apiClient.invokeAPI(
  1204. path,
  1205. 'POST',
  1206. queryParams,
  1207. postBody,
  1208. headerParams,
  1209. formParams,
  1210. contentTypes.isEmpty ? null : contentTypes.first,
  1211. );
  1212. }
  1213. /// Parameters:
  1214. ///
  1215. /// * [AssetTypeEnum] assetType (required):
  1216. ///
  1217. /// * [MultipartFile] assetData (required):
  1218. ///
  1219. /// * [String] deviceAssetId (required):
  1220. ///
  1221. /// * [String] deviceId (required):
  1222. ///
  1223. /// * [String] fileCreatedAt (required):
  1224. ///
  1225. /// * [String] fileModifiedAt (required):
  1226. ///
  1227. /// * [bool] isFavorite (required):
  1228. ///
  1229. /// * [String] fileExtension (required):
  1230. ///
  1231. /// * [String] key:
  1232. ///
  1233. /// * [MultipartFile] livePhotoData:
  1234. ///
  1235. /// * [bool] isArchived:
  1236. ///
  1237. /// * [bool] isVisible:
  1238. ///
  1239. /// * [String] duration:
  1240. 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 {
  1241. final response = await uploadFileWithHttpInfo(assetType, assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, fileExtension, key: key, livePhotoData: livePhotoData, isArchived: isArchived, isVisible: isVisible, duration: duration, );
  1242. if (response.statusCode >= HttpStatus.badRequest) {
  1243. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1244. }
  1245. // When a remote server returns no body with a status of 204, we shall not decode it.
  1246. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1247. // FormatException when trying to decode an empty string.
  1248. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1249. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1250. }
  1251. return null;
  1252. }
  1253. }