asset_api.dart 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142
  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. /// Checks if assets exist by checksums
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
  20. Future<Response> checkBulkUploadWithHttpInfo(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
  21. // ignore: prefer_const_declarations
  22. final path = r'/asset/bulk-upload-check';
  23. // ignore: prefer_final_locals
  24. Object? postBody = assetBulkUploadCheckDto;
  25. final queryParams = <QueryParam>[];
  26. final headerParams = <String, String>{};
  27. final formParams = <String, String>{};
  28. const contentTypes = <String>['application/json'];
  29. return apiClient.invokeAPI(
  30. path,
  31. 'POST',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. /// Checks if assets exist by checksums
  40. ///
  41. /// Parameters:
  42. ///
  43. /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
  44. Future<AssetBulkUploadCheckResponseDto?> checkBulkUpload(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async {
  45. final response = await checkBulkUploadWithHttpInfo(assetBulkUploadCheckDto,);
  46. if (response.statusCode >= HttpStatus.badRequest) {
  47. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  48. }
  49. // When a remote server returns no body with a status of 204, we shall not decode it.
  50. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  51. // FormatException when trying to decode an empty string.
  52. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  53. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetBulkUploadCheckResponseDto',) as AssetBulkUploadCheckResponseDto;
  54. }
  55. return null;
  56. }
  57. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  58. ///
  59. /// Note: This method returns the HTTP [Response].
  60. ///
  61. /// Parameters:
  62. ///
  63. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  64. Future<Response> checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  65. // ignore: prefer_const_declarations
  66. final path = r'/asset/exist';
  67. // ignore: prefer_final_locals
  68. Object? postBody = checkExistingAssetsDto;
  69. final queryParams = <QueryParam>[];
  70. final headerParams = <String, String>{};
  71. final formParams = <String, String>{};
  72. const contentTypes = <String>['application/json'];
  73. return apiClient.invokeAPI(
  74. path,
  75. 'POST',
  76. queryParams,
  77. postBody,
  78. headerParams,
  79. formParams,
  80. contentTypes.isEmpty ? null : contentTypes.first,
  81. );
  82. }
  83. /// Checks if multiple assets exist on the server and returns all existing - used by background backup
  84. ///
  85. /// Parameters:
  86. ///
  87. /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required):
  88. Future<CheckExistingAssetsResponseDto?> checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async {
  89. final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,);
  90. if (response.statusCode >= HttpStatus.badRequest) {
  91. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  92. }
  93. // When a remote server returns no body with a status of 204, we shall not decode it.
  94. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  95. // FormatException when trying to decode an empty string.
  96. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  97. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto;
  98. }
  99. return null;
  100. }
  101. /// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
  102. /// Parameters:
  103. ///
  104. /// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
  105. Future<Response> deleteAssetsWithHttpInfo(AssetBulkDeleteDto assetBulkDeleteDto,) async {
  106. // ignore: prefer_const_declarations
  107. final path = r'/asset';
  108. // ignore: prefer_final_locals
  109. Object? postBody = assetBulkDeleteDto;
  110. final queryParams = <QueryParam>[];
  111. final headerParams = <String, String>{};
  112. final formParams = <String, String>{};
  113. const contentTypes = <String>['application/json'];
  114. return apiClient.invokeAPI(
  115. path,
  116. 'DELETE',
  117. queryParams,
  118. postBody,
  119. headerParams,
  120. formParams,
  121. contentTypes.isEmpty ? null : contentTypes.first,
  122. );
  123. }
  124. /// Parameters:
  125. ///
  126. /// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
  127. Future<void> deleteAssets(AssetBulkDeleteDto assetBulkDeleteDto,) async {
  128. final response = await deleteAssetsWithHttpInfo(assetBulkDeleteDto,);
  129. if (response.statusCode >= HttpStatus.badRequest) {
  130. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  131. }
  132. }
  133. /// Performs an HTTP 'POST /asset/download/archive' operation and returns the [Response].
  134. /// Parameters:
  135. ///
  136. /// * [AssetIdsDto] assetIdsDto (required):
  137. ///
  138. /// * [String] key:
  139. Future<Response> downloadArchiveWithHttpInfo(AssetIdsDto assetIdsDto, { String? key, }) async {
  140. // ignore: prefer_const_declarations
  141. final path = r'/asset/download/archive';
  142. // ignore: prefer_final_locals
  143. Object? postBody = assetIdsDto;
  144. final queryParams = <QueryParam>[];
  145. final headerParams = <String, String>{};
  146. final formParams = <String, String>{};
  147. if (key != null) {
  148. queryParams.addAll(_queryParams('', 'key', key));
  149. }
  150. const contentTypes = <String>['application/json'];
  151. return apiClient.invokeAPI(
  152. path,
  153. 'POST',
  154. queryParams,
  155. postBody,
  156. headerParams,
  157. formParams,
  158. contentTypes.isEmpty ? null : contentTypes.first,
  159. );
  160. }
  161. /// Parameters:
  162. ///
  163. /// * [AssetIdsDto] assetIdsDto (required):
  164. ///
  165. /// * [String] key:
  166. Future<MultipartFile?> downloadArchive(AssetIdsDto assetIdsDto, { String? key, }) async {
  167. final response = await downloadArchiveWithHttpInfo(assetIdsDto, key: key, );
  168. if (response.statusCode >= HttpStatus.badRequest) {
  169. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  170. }
  171. // When a remote server returns no body with a status of 204, we shall not decode it.
  172. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  173. // FormatException when trying to decode an empty string.
  174. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  175. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  176. }
  177. return null;
  178. }
  179. /// Performs an HTTP 'POST /asset/download/{id}' operation and returns the [Response].
  180. /// Parameters:
  181. ///
  182. /// * [String] id (required):
  183. ///
  184. /// * [String] key:
  185. Future<Response> downloadFileWithHttpInfo(String id, { String? key, }) async {
  186. // ignore: prefer_const_declarations
  187. final path = r'/asset/download/{id}'
  188. .replaceAll('{id}', id);
  189. // ignore: prefer_final_locals
  190. Object? postBody;
  191. final queryParams = <QueryParam>[];
  192. final headerParams = <String, String>{};
  193. final formParams = <String, String>{};
  194. if (key != null) {
  195. queryParams.addAll(_queryParams('', 'key', key));
  196. }
  197. const contentTypes = <String>[];
  198. return apiClient.invokeAPI(
  199. path,
  200. 'POST',
  201. queryParams,
  202. postBody,
  203. headerParams,
  204. formParams,
  205. contentTypes.isEmpty ? null : contentTypes.first,
  206. );
  207. }
  208. /// Parameters:
  209. ///
  210. /// * [String] id (required):
  211. ///
  212. /// * [String] key:
  213. Future<MultipartFile?> downloadFile(String id, { String? key, }) async {
  214. final response = await downloadFileWithHttpInfo(id, key: key, );
  215. if (response.statusCode >= HttpStatus.badRequest) {
  216. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  217. }
  218. // When a remote server returns no body with a status of 204, we shall not decode it.
  219. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  220. // FormatException when trying to decode an empty string.
  221. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  222. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  223. }
  224. return null;
  225. }
  226. /// Performs an HTTP 'POST /asset/trash/empty' operation and returns the [Response].
  227. Future<Response> emptyTrashWithHttpInfo() async {
  228. // ignore: prefer_const_declarations
  229. final path = r'/asset/trash/empty';
  230. // ignore: prefer_final_locals
  231. Object? postBody;
  232. final queryParams = <QueryParam>[];
  233. final headerParams = <String, String>{};
  234. final formParams = <String, String>{};
  235. const contentTypes = <String>[];
  236. return apiClient.invokeAPI(
  237. path,
  238. 'POST',
  239. queryParams,
  240. postBody,
  241. headerParams,
  242. formParams,
  243. contentTypes.isEmpty ? null : contentTypes.first,
  244. );
  245. }
  246. Future<void> emptyTrash() async {
  247. final response = await emptyTrashWithHttpInfo();
  248. if (response.statusCode >= HttpStatus.badRequest) {
  249. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  250. }
  251. }
  252. /// Get all AssetEntity belong to the user
  253. ///
  254. /// Note: This method returns the HTTP [Response].
  255. ///
  256. /// Parameters:
  257. ///
  258. /// * [int] skip:
  259. ///
  260. /// * [int] take:
  261. ///
  262. /// * [String] userId:
  263. ///
  264. /// * [bool] isFavorite:
  265. ///
  266. /// * [bool] isArchived:
  267. ///
  268. /// * [DateTime] updatedAfter:
  269. ///
  270. /// * [DateTime] updatedBefore:
  271. ///
  272. /// * [String] ifNoneMatch:
  273. /// ETag of data already cached on the client
  274. Future<Response> getAllAssetsWithHttpInfo({ int? skip, int? take, String? userId, bool? isFavorite, bool? isArchived, DateTime? updatedAfter, DateTime? updatedBefore, String? ifNoneMatch, }) async {
  275. // ignore: prefer_const_declarations
  276. final path = r'/asset';
  277. // ignore: prefer_final_locals
  278. Object? postBody;
  279. final queryParams = <QueryParam>[];
  280. final headerParams = <String, String>{};
  281. final formParams = <String, String>{};
  282. if (skip != null) {
  283. queryParams.addAll(_queryParams('', 'skip', skip));
  284. }
  285. if (take != null) {
  286. queryParams.addAll(_queryParams('', 'take', take));
  287. }
  288. if (userId != null) {
  289. queryParams.addAll(_queryParams('', 'userId', userId));
  290. }
  291. if (isFavorite != null) {
  292. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  293. }
  294. if (isArchived != null) {
  295. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  296. }
  297. if (updatedAfter != null) {
  298. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  299. }
  300. if (updatedBefore != null) {
  301. queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
  302. }
  303. if (ifNoneMatch != null) {
  304. headerParams[r'if-none-match'] = parameterToString(ifNoneMatch);
  305. }
  306. const contentTypes = <String>[];
  307. return apiClient.invokeAPI(
  308. path,
  309. 'GET',
  310. queryParams,
  311. postBody,
  312. headerParams,
  313. formParams,
  314. contentTypes.isEmpty ? null : contentTypes.first,
  315. );
  316. }
  317. /// Get all AssetEntity belong to the user
  318. ///
  319. /// Parameters:
  320. ///
  321. /// * [int] skip:
  322. ///
  323. /// * [int] take:
  324. ///
  325. /// * [String] userId:
  326. ///
  327. /// * [bool] isFavorite:
  328. ///
  329. /// * [bool] isArchived:
  330. ///
  331. /// * [DateTime] updatedAfter:
  332. ///
  333. /// * [DateTime] updatedBefore:
  334. ///
  335. /// * [String] ifNoneMatch:
  336. /// ETag of data already cached on the client
  337. Future<List<AssetResponseDto>?> getAllAssets({ int? skip, int? take, String? userId, bool? isFavorite, bool? isArchived, DateTime? updatedAfter, DateTime? updatedBefore, String? ifNoneMatch, }) async {
  338. final response = await getAllAssetsWithHttpInfo( skip: skip, take: take, userId: userId, isFavorite: isFavorite, isArchived: isArchived, updatedAfter: updatedAfter, updatedBefore: updatedBefore, ifNoneMatch: ifNoneMatch, );
  339. if (response.statusCode >= HttpStatus.badRequest) {
  340. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  341. }
  342. // When a remote server returns no body with a status of 204, we shall not decode it.
  343. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  344. // FormatException when trying to decode an empty string.
  345. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  346. final responseBody = await _decodeBodyBytes(response);
  347. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  348. .cast<AssetResponseDto>()
  349. .toList();
  350. }
  351. return null;
  352. }
  353. /// Get all asset of a device that are in the database, ID only.
  354. ///
  355. /// Note: This method returns the HTTP [Response].
  356. ///
  357. /// Parameters:
  358. ///
  359. /// * [String] deviceId (required):
  360. Future<Response> getAllUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  361. // ignore: prefer_const_declarations
  362. final path = r'/asset/device/{deviceId}'
  363. .replaceAll('{deviceId}', deviceId);
  364. // ignore: prefer_final_locals
  365. Object? postBody;
  366. final queryParams = <QueryParam>[];
  367. final headerParams = <String, String>{};
  368. final formParams = <String, String>{};
  369. const contentTypes = <String>[];
  370. return apiClient.invokeAPI(
  371. path,
  372. 'GET',
  373. queryParams,
  374. postBody,
  375. headerParams,
  376. formParams,
  377. contentTypes.isEmpty ? null : contentTypes.first,
  378. );
  379. }
  380. /// Get all asset of a device that are in the database, ID only.
  381. ///
  382. /// Parameters:
  383. ///
  384. /// * [String] deviceId (required):
  385. Future<List<String>?> getAllUserAssetsByDeviceId(String deviceId,) async {
  386. final response = await getAllUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  387. if (response.statusCode >= HttpStatus.badRequest) {
  388. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  389. }
  390. // When a remote server returns no body with a status of 204, we shall not decode it.
  391. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  392. // FormatException when trying to decode an empty string.
  393. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  394. final responseBody = await _decodeBodyBytes(response);
  395. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  396. .cast<String>()
  397. .toList();
  398. }
  399. return null;
  400. }
  401. /// Get a single asset's information
  402. ///
  403. /// Note: This method returns the HTTP [Response].
  404. ///
  405. /// Parameters:
  406. ///
  407. /// * [String] id (required):
  408. ///
  409. /// * [String] key:
  410. Future<Response> getAssetByIdWithHttpInfo(String id, { String? key, }) async {
  411. // ignore: prefer_const_declarations
  412. final path = r'/asset/assetById/{id}'
  413. .replaceAll('{id}', id);
  414. // ignore: prefer_final_locals
  415. Object? postBody;
  416. final queryParams = <QueryParam>[];
  417. final headerParams = <String, String>{};
  418. final formParams = <String, String>{};
  419. if (key != null) {
  420. queryParams.addAll(_queryParams('', 'key', key));
  421. }
  422. const contentTypes = <String>[];
  423. return apiClient.invokeAPI(
  424. path,
  425. 'GET',
  426. queryParams,
  427. postBody,
  428. headerParams,
  429. formParams,
  430. contentTypes.isEmpty ? null : contentTypes.first,
  431. );
  432. }
  433. /// Get a single asset's information
  434. ///
  435. /// Parameters:
  436. ///
  437. /// * [String] id (required):
  438. ///
  439. /// * [String] key:
  440. Future<AssetResponseDto?> getAssetById(String id, { String? key, }) async {
  441. final response = await getAssetByIdWithHttpInfo(id, key: key, );
  442. if (response.statusCode >= HttpStatus.badRequest) {
  443. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  444. }
  445. // When a remote server returns no body with a status of 204, we shall not decode it.
  446. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  447. // FormatException when trying to decode an empty string.
  448. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  449. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  450. }
  451. return null;
  452. }
  453. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  454. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  455. // ignore: prefer_const_declarations
  456. final path = r'/asset/search-terms';
  457. // ignore: prefer_final_locals
  458. Object? postBody;
  459. final queryParams = <QueryParam>[];
  460. final headerParams = <String, String>{};
  461. final formParams = <String, String>{};
  462. const contentTypes = <String>[];
  463. return apiClient.invokeAPI(
  464. path,
  465. 'GET',
  466. queryParams,
  467. postBody,
  468. headerParams,
  469. formParams,
  470. contentTypes.isEmpty ? null : contentTypes.first,
  471. );
  472. }
  473. Future<List<String>?> getAssetSearchTerms() async {
  474. final response = await getAssetSearchTermsWithHttpInfo();
  475. if (response.statusCode >= HttpStatus.badRequest) {
  476. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  477. }
  478. // When a remote server returns no body with a status of 204, we shall not decode it.
  479. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  480. // FormatException when trying to decode an empty string.
  481. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  482. final responseBody = await _decodeBodyBytes(response);
  483. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  484. .cast<String>()
  485. .toList();
  486. }
  487. return null;
  488. }
  489. /// Performs an HTTP 'GET /asset/statistics' operation and returns the [Response].
  490. /// Parameters:
  491. ///
  492. /// * [bool] isArchived:
  493. ///
  494. /// * [bool] isFavorite:
  495. ///
  496. /// * [bool] isTrashed:
  497. Future<Response> getAssetStatisticsWithHttpInfo({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
  498. // ignore: prefer_const_declarations
  499. final path = r'/asset/statistics';
  500. // ignore: prefer_final_locals
  501. Object? postBody;
  502. final queryParams = <QueryParam>[];
  503. final headerParams = <String, String>{};
  504. final formParams = <String, String>{};
  505. if (isArchived != null) {
  506. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  507. }
  508. if (isFavorite != null) {
  509. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  510. }
  511. if (isTrashed != null) {
  512. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  513. }
  514. const contentTypes = <String>[];
  515. return apiClient.invokeAPI(
  516. path,
  517. 'GET',
  518. queryParams,
  519. postBody,
  520. headerParams,
  521. formParams,
  522. contentTypes.isEmpty ? null : contentTypes.first,
  523. );
  524. }
  525. /// Parameters:
  526. ///
  527. /// * [bool] isArchived:
  528. ///
  529. /// * [bool] isFavorite:
  530. ///
  531. /// * [bool] isTrashed:
  532. Future<AssetStatsResponseDto?> getAssetStatistics({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
  533. final response = await getAssetStatisticsWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, );
  534. if (response.statusCode >= HttpStatus.badRequest) {
  535. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  536. }
  537. // When a remote server returns no body with a status of 204, we shall not decode it.
  538. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  539. // FormatException when trying to decode an empty string.
  540. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  541. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
  542. }
  543. return null;
  544. }
  545. /// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
  546. /// Parameters:
  547. ///
  548. /// * [String] id (required):
  549. ///
  550. /// * [ThumbnailFormat] format:
  551. ///
  552. /// * [String] key:
  553. Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
  554. // ignore: prefer_const_declarations
  555. final path = r'/asset/thumbnail/{id}'
  556. .replaceAll('{id}', id);
  557. // ignore: prefer_final_locals
  558. Object? postBody;
  559. final queryParams = <QueryParam>[];
  560. final headerParams = <String, String>{};
  561. final formParams = <String, String>{};
  562. if (format != null) {
  563. queryParams.addAll(_queryParams('', 'format', format));
  564. }
  565. if (key != null) {
  566. queryParams.addAll(_queryParams('', 'key', key));
  567. }
  568. const contentTypes = <String>[];
  569. return apiClient.invokeAPI(
  570. path,
  571. 'GET',
  572. queryParams,
  573. postBody,
  574. headerParams,
  575. formParams,
  576. contentTypes.isEmpty ? null : contentTypes.first,
  577. );
  578. }
  579. /// Parameters:
  580. ///
  581. /// * [String] id (required):
  582. ///
  583. /// * [ThumbnailFormat] format:
  584. ///
  585. /// * [String] key:
  586. Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
  587. final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
  588. if (response.statusCode >= HttpStatus.badRequest) {
  589. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  590. }
  591. // When a remote server returns no body with a status of 204, we shall not decode it.
  592. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  593. // FormatException when trying to decode an empty string.
  594. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  595. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  596. }
  597. return null;
  598. }
  599. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  600. Future<Response> getCuratedLocationsWithHttpInfo() async {
  601. // ignore: prefer_const_declarations
  602. final path = r'/asset/curated-locations';
  603. // ignore: prefer_final_locals
  604. Object? postBody;
  605. final queryParams = <QueryParam>[];
  606. final headerParams = <String, String>{};
  607. final formParams = <String, String>{};
  608. const contentTypes = <String>[];
  609. return apiClient.invokeAPI(
  610. path,
  611. 'GET',
  612. queryParams,
  613. postBody,
  614. headerParams,
  615. formParams,
  616. contentTypes.isEmpty ? null : contentTypes.first,
  617. );
  618. }
  619. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  620. final response = await getCuratedLocationsWithHttpInfo();
  621. if (response.statusCode >= HttpStatus.badRequest) {
  622. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  623. }
  624. // When a remote server returns no body with a status of 204, we shall not decode it.
  625. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  626. // FormatException when trying to decode an empty string.
  627. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  628. final responseBody = await _decodeBodyBytes(response);
  629. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  630. .cast<CuratedLocationsResponseDto>()
  631. .toList();
  632. }
  633. return null;
  634. }
  635. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  636. Future<Response> getCuratedObjectsWithHttpInfo() async {
  637. // ignore: prefer_const_declarations
  638. final path = r'/asset/curated-objects';
  639. // ignore: prefer_final_locals
  640. Object? postBody;
  641. final queryParams = <QueryParam>[];
  642. final headerParams = <String, String>{};
  643. final formParams = <String, String>{};
  644. const contentTypes = <String>[];
  645. return apiClient.invokeAPI(
  646. path,
  647. 'GET',
  648. queryParams,
  649. postBody,
  650. headerParams,
  651. formParams,
  652. contentTypes.isEmpty ? null : contentTypes.first,
  653. );
  654. }
  655. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  656. final response = await getCuratedObjectsWithHttpInfo();
  657. if (response.statusCode >= HttpStatus.badRequest) {
  658. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  659. }
  660. // When a remote server returns no body with a status of 204, we shall not decode it.
  661. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  662. // FormatException when trying to decode an empty string.
  663. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  664. final responseBody = await _decodeBodyBytes(response);
  665. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  666. .cast<CuratedObjectsResponseDto>()
  667. .toList();
  668. }
  669. return null;
  670. }
  671. /// Performs an HTTP 'POST /asset/download/info' operation and returns the [Response].
  672. /// Parameters:
  673. ///
  674. /// * [DownloadInfoDto] downloadInfoDto (required):
  675. ///
  676. /// * [String] key:
  677. Future<Response> getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  678. // ignore: prefer_const_declarations
  679. final path = r'/asset/download/info';
  680. // ignore: prefer_final_locals
  681. Object? postBody = downloadInfoDto;
  682. final queryParams = <QueryParam>[];
  683. final headerParams = <String, String>{};
  684. final formParams = <String, String>{};
  685. if (key != null) {
  686. queryParams.addAll(_queryParams('', 'key', key));
  687. }
  688. const contentTypes = <String>['application/json'];
  689. return apiClient.invokeAPI(
  690. path,
  691. 'POST',
  692. queryParams,
  693. postBody,
  694. headerParams,
  695. formParams,
  696. contentTypes.isEmpty ? null : contentTypes.first,
  697. );
  698. }
  699. /// Parameters:
  700. ///
  701. /// * [DownloadInfoDto] downloadInfoDto (required):
  702. ///
  703. /// * [String] key:
  704. Future<DownloadResponseDto?> getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  705. final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, );
  706. if (response.statusCode >= HttpStatus.badRequest) {
  707. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  708. }
  709. // When a remote server returns no body with a status of 204, we shall not decode it.
  710. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  711. // FormatException when trying to decode an empty string.
  712. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  713. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DownloadResponseDto',) as DownloadResponseDto;
  714. }
  715. return null;
  716. }
  717. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  718. /// Parameters:
  719. ///
  720. /// * [bool] isArchived:
  721. ///
  722. /// * [bool] isFavorite:
  723. ///
  724. /// * [DateTime] fileCreatedAfter:
  725. ///
  726. /// * [DateTime] fileCreatedBefore:
  727. Future<Response> getMapMarkersWithHttpInfo({ bool? isArchived, bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  728. // ignore: prefer_const_declarations
  729. final path = r'/asset/map-marker';
  730. // ignore: prefer_final_locals
  731. Object? postBody;
  732. final queryParams = <QueryParam>[];
  733. final headerParams = <String, String>{};
  734. final formParams = <String, String>{};
  735. if (isArchived != null) {
  736. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  737. }
  738. if (isFavorite != null) {
  739. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  740. }
  741. if (fileCreatedAfter != null) {
  742. queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
  743. }
  744. if (fileCreatedBefore != null) {
  745. queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
  746. }
  747. const contentTypes = <String>[];
  748. return apiClient.invokeAPI(
  749. path,
  750. 'GET',
  751. queryParams,
  752. postBody,
  753. headerParams,
  754. formParams,
  755. contentTypes.isEmpty ? null : contentTypes.first,
  756. );
  757. }
  758. /// Parameters:
  759. ///
  760. /// * [bool] isArchived:
  761. ///
  762. /// * [bool] isFavorite:
  763. ///
  764. /// * [DateTime] fileCreatedAfter:
  765. ///
  766. /// * [DateTime] fileCreatedBefore:
  767. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isArchived, bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  768. final response = await getMapMarkersWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, );
  769. if (response.statusCode >= HttpStatus.badRequest) {
  770. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  771. }
  772. // When a remote server returns no body with a status of 204, we shall not decode it.
  773. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  774. // FormatException when trying to decode an empty string.
  775. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  776. final responseBody = await _decodeBodyBytes(response);
  777. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  778. .cast<MapMarkerResponseDto>()
  779. .toList();
  780. }
  781. return null;
  782. }
  783. /// Performs an HTTP 'GET /asset/memory-lane' operation and returns the [Response].
  784. /// Parameters:
  785. ///
  786. /// * [int] day (required):
  787. ///
  788. /// * [int] month (required):
  789. Future<Response> getMemoryLaneWithHttpInfo(int day, int month,) async {
  790. // ignore: prefer_const_declarations
  791. final path = r'/asset/memory-lane';
  792. // ignore: prefer_final_locals
  793. Object? postBody;
  794. final queryParams = <QueryParam>[];
  795. final headerParams = <String, String>{};
  796. final formParams = <String, String>{};
  797. queryParams.addAll(_queryParams('', 'day', day));
  798. queryParams.addAll(_queryParams('', 'month', month));
  799. const contentTypes = <String>[];
  800. return apiClient.invokeAPI(
  801. path,
  802. 'GET',
  803. queryParams,
  804. postBody,
  805. headerParams,
  806. formParams,
  807. contentTypes.isEmpty ? null : contentTypes.first,
  808. );
  809. }
  810. /// Parameters:
  811. ///
  812. /// * [int] day (required):
  813. ///
  814. /// * [int] month (required):
  815. Future<List<MemoryLaneResponseDto>?> getMemoryLane(int day, int month,) async {
  816. final response = await getMemoryLaneWithHttpInfo(day, month,);
  817. if (response.statusCode >= HttpStatus.badRequest) {
  818. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  819. }
  820. // When a remote server returns no body with a status of 204, we shall not decode it.
  821. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  822. // FormatException when trying to decode an empty string.
  823. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  824. final responseBody = await _decodeBodyBytes(response);
  825. return (await apiClient.deserializeAsync(responseBody, 'List<MemoryLaneResponseDto>') as List)
  826. .cast<MemoryLaneResponseDto>()
  827. .toList();
  828. }
  829. return null;
  830. }
  831. /// Performs an HTTP 'GET /asset/random' operation and returns the [Response].
  832. /// Parameters:
  833. ///
  834. /// * [num] count:
  835. Future<Response> getRandomWithHttpInfo({ num? count, }) async {
  836. // ignore: prefer_const_declarations
  837. final path = r'/asset/random';
  838. // ignore: prefer_final_locals
  839. Object? postBody;
  840. final queryParams = <QueryParam>[];
  841. final headerParams = <String, String>{};
  842. final formParams = <String, String>{};
  843. if (count != null) {
  844. queryParams.addAll(_queryParams('', 'count', count));
  845. }
  846. const contentTypes = <String>[];
  847. return apiClient.invokeAPI(
  848. path,
  849. 'GET',
  850. queryParams,
  851. postBody,
  852. headerParams,
  853. formParams,
  854. contentTypes.isEmpty ? null : contentTypes.first,
  855. );
  856. }
  857. /// Parameters:
  858. ///
  859. /// * [num] count:
  860. Future<List<AssetResponseDto>?> getRandom({ num? count, }) async {
  861. final response = await getRandomWithHttpInfo( count: count, );
  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<AssetResponseDto>') as List)
  871. .cast<AssetResponseDto>()
  872. .toList();
  873. }
  874. return null;
  875. }
  876. /// Performs an HTTP 'GET /asset/time-bucket' operation and returns the [Response].
  877. /// Parameters:
  878. ///
  879. /// * [TimeBucketSize] size (required):
  880. ///
  881. /// * [String] timeBucket (required):
  882. ///
  883. /// * [String] userId:
  884. ///
  885. /// * [String] albumId:
  886. ///
  887. /// * [String] personId:
  888. ///
  889. /// * [bool] isArchived:
  890. ///
  891. /// * [bool] isFavorite:
  892. ///
  893. /// * [bool] isTrashed:
  894. ///
  895. /// * [bool] withStacked:
  896. ///
  897. /// * [bool] withPartners:
  898. ///
  899. /// * [String] key:
  900. Future<Response> getTimeBucketWithHttpInfo(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, bool? withStacked, bool? withPartners, String? key, }) async {
  901. // ignore: prefer_const_declarations
  902. final path = r'/asset/time-bucket';
  903. // ignore: prefer_final_locals
  904. Object? postBody;
  905. final queryParams = <QueryParam>[];
  906. final headerParams = <String, String>{};
  907. final formParams = <String, String>{};
  908. queryParams.addAll(_queryParams('', 'size', size));
  909. if (userId != null) {
  910. queryParams.addAll(_queryParams('', 'userId', userId));
  911. }
  912. if (albumId != null) {
  913. queryParams.addAll(_queryParams('', 'albumId', albumId));
  914. }
  915. if (personId != null) {
  916. queryParams.addAll(_queryParams('', 'personId', personId));
  917. }
  918. if (isArchived != null) {
  919. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  920. }
  921. if (isFavorite != null) {
  922. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  923. }
  924. if (isTrashed != null) {
  925. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  926. }
  927. if (withStacked != null) {
  928. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  929. }
  930. if (withPartners != null) {
  931. queryParams.addAll(_queryParams('', 'withPartners', withPartners));
  932. }
  933. queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
  934. if (key != null) {
  935. queryParams.addAll(_queryParams('', 'key', key));
  936. }
  937. const contentTypes = <String>[];
  938. return apiClient.invokeAPI(
  939. path,
  940. 'GET',
  941. queryParams,
  942. postBody,
  943. headerParams,
  944. formParams,
  945. contentTypes.isEmpty ? null : contentTypes.first,
  946. );
  947. }
  948. /// Parameters:
  949. ///
  950. /// * [TimeBucketSize] size (required):
  951. ///
  952. /// * [String] timeBucket (required):
  953. ///
  954. /// * [String] userId:
  955. ///
  956. /// * [String] albumId:
  957. ///
  958. /// * [String] personId:
  959. ///
  960. /// * [bool] isArchived:
  961. ///
  962. /// * [bool] isFavorite:
  963. ///
  964. /// * [bool] isTrashed:
  965. ///
  966. /// * [bool] withStacked:
  967. ///
  968. /// * [bool] withPartners:
  969. ///
  970. /// * [String] key:
  971. Future<List<AssetResponseDto>?> getTimeBucket(TimeBucketSize size, String timeBucket, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, bool? withStacked, bool? withPartners, String? key, }) async {
  972. final response = await getTimeBucketWithHttpInfo(size, timeBucket, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, withStacked: withStacked, withPartners: withPartners, key: key, );
  973. if (response.statusCode >= HttpStatus.badRequest) {
  974. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  975. }
  976. // When a remote server returns no body with a status of 204, we shall not decode it.
  977. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  978. // FormatException when trying to decode an empty string.
  979. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  980. final responseBody = await _decodeBodyBytes(response);
  981. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  982. .cast<AssetResponseDto>()
  983. .toList();
  984. }
  985. return null;
  986. }
  987. /// Performs an HTTP 'GET /asset/time-buckets' operation and returns the [Response].
  988. /// Parameters:
  989. ///
  990. /// * [TimeBucketSize] size (required):
  991. ///
  992. /// * [String] userId:
  993. ///
  994. /// * [String] albumId:
  995. ///
  996. /// * [String] personId:
  997. ///
  998. /// * [bool] isArchived:
  999. ///
  1000. /// * [bool] isFavorite:
  1001. ///
  1002. /// * [bool] isTrashed:
  1003. ///
  1004. /// * [bool] withStacked:
  1005. ///
  1006. /// * [bool] withPartners:
  1007. ///
  1008. /// * [String] key:
  1009. Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, bool? withStacked, bool? withPartners, String? key, }) async {
  1010. // ignore: prefer_const_declarations
  1011. final path = r'/asset/time-buckets';
  1012. // ignore: prefer_final_locals
  1013. Object? postBody;
  1014. final queryParams = <QueryParam>[];
  1015. final headerParams = <String, String>{};
  1016. final formParams = <String, String>{};
  1017. queryParams.addAll(_queryParams('', 'size', size));
  1018. if (userId != null) {
  1019. queryParams.addAll(_queryParams('', 'userId', userId));
  1020. }
  1021. if (albumId != null) {
  1022. queryParams.addAll(_queryParams('', 'albumId', albumId));
  1023. }
  1024. if (personId != null) {
  1025. queryParams.addAll(_queryParams('', 'personId', personId));
  1026. }
  1027. if (isArchived != null) {
  1028. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  1029. }
  1030. if (isFavorite != null) {
  1031. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  1032. }
  1033. if (isTrashed != null) {
  1034. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  1035. }
  1036. if (withStacked != null) {
  1037. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  1038. }
  1039. if (withPartners != null) {
  1040. queryParams.addAll(_queryParams('', 'withPartners', withPartners));
  1041. }
  1042. if (key != null) {
  1043. queryParams.addAll(_queryParams('', 'key', key));
  1044. }
  1045. const contentTypes = <String>[];
  1046. return apiClient.invokeAPI(
  1047. path,
  1048. 'GET',
  1049. queryParams,
  1050. postBody,
  1051. headerParams,
  1052. formParams,
  1053. contentTypes.isEmpty ? null : contentTypes.first,
  1054. );
  1055. }
  1056. /// Parameters:
  1057. ///
  1058. /// * [TimeBucketSize] size (required):
  1059. ///
  1060. /// * [String] userId:
  1061. ///
  1062. /// * [String] albumId:
  1063. ///
  1064. /// * [String] personId:
  1065. ///
  1066. /// * [bool] isArchived:
  1067. ///
  1068. /// * [bool] isFavorite:
  1069. ///
  1070. /// * [bool] isTrashed:
  1071. ///
  1072. /// * [bool] withStacked:
  1073. ///
  1074. /// * [bool] withPartners:
  1075. ///
  1076. /// * [String] key:
  1077. Future<List<TimeBucketResponseDto>?> getTimeBuckets(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, bool? withStacked, bool? withPartners, String? key, }) async {
  1078. final response = await getTimeBucketsWithHttpInfo(size, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, withStacked: withStacked, withPartners: withPartners, key: key, );
  1079. if (response.statusCode >= HttpStatus.badRequest) {
  1080. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1081. }
  1082. // When a remote server returns no body with a status of 204, we shall not decode it.
  1083. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1084. // FormatException when trying to decode an empty string.
  1085. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1086. final responseBody = await _decodeBodyBytes(response);
  1087. return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketResponseDto>') as List)
  1088. .cast<TimeBucketResponseDto>()
  1089. .toList();
  1090. }
  1091. return null;
  1092. }
  1093. /// Use /asset/device/:deviceId instead - Remove in 1.92 release
  1094. ///
  1095. /// Note: This method returns the HTTP [Response].
  1096. ///
  1097. /// Parameters:
  1098. ///
  1099. /// * [String] deviceId (required):
  1100. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  1101. // ignore: prefer_const_declarations
  1102. final path = r'/asset/{deviceId}'
  1103. .replaceAll('{deviceId}', deviceId);
  1104. // ignore: prefer_final_locals
  1105. Object? postBody;
  1106. final queryParams = <QueryParam>[];
  1107. final headerParams = <String, String>{};
  1108. final formParams = <String, String>{};
  1109. const contentTypes = <String>[];
  1110. return apiClient.invokeAPI(
  1111. path,
  1112. 'GET',
  1113. queryParams,
  1114. postBody,
  1115. headerParams,
  1116. formParams,
  1117. contentTypes.isEmpty ? null : contentTypes.first,
  1118. );
  1119. }
  1120. /// Use /asset/device/:deviceId instead - Remove in 1.92 release
  1121. ///
  1122. /// Parameters:
  1123. ///
  1124. /// * [String] deviceId (required):
  1125. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  1126. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  1127. if (response.statusCode >= HttpStatus.badRequest) {
  1128. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1129. }
  1130. // When a remote server returns no body with a status of 204, we shall not decode it.
  1131. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1132. // FormatException when trying to decode an empty string.
  1133. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1134. final responseBody = await _decodeBodyBytes(response);
  1135. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  1136. .cast<String>()
  1137. .toList();
  1138. }
  1139. return null;
  1140. }
  1141. /// Performs an HTTP 'POST /asset/restore' operation and returns the [Response].
  1142. /// Parameters:
  1143. ///
  1144. /// * [BulkIdsDto] bulkIdsDto (required):
  1145. Future<Response> restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
  1146. // ignore: prefer_const_declarations
  1147. final path = r'/asset/restore';
  1148. // ignore: prefer_final_locals
  1149. Object? postBody = bulkIdsDto;
  1150. final queryParams = <QueryParam>[];
  1151. final headerParams = <String, String>{};
  1152. final formParams = <String, String>{};
  1153. const contentTypes = <String>['application/json'];
  1154. return apiClient.invokeAPI(
  1155. path,
  1156. 'POST',
  1157. queryParams,
  1158. postBody,
  1159. headerParams,
  1160. formParams,
  1161. contentTypes.isEmpty ? null : contentTypes.first,
  1162. );
  1163. }
  1164. /// Parameters:
  1165. ///
  1166. /// * [BulkIdsDto] bulkIdsDto (required):
  1167. Future<void> restoreAssets(BulkIdsDto bulkIdsDto,) async {
  1168. final response = await restoreAssetsWithHttpInfo(bulkIdsDto,);
  1169. if (response.statusCode >= HttpStatus.badRequest) {
  1170. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1171. }
  1172. }
  1173. /// Performs an HTTP 'POST /asset/trash/restore' operation and returns the [Response].
  1174. Future<Response> restoreTrashWithHttpInfo() async {
  1175. // ignore: prefer_const_declarations
  1176. final path = r'/asset/trash/restore';
  1177. // ignore: prefer_final_locals
  1178. Object? postBody;
  1179. final queryParams = <QueryParam>[];
  1180. final headerParams = <String, String>{};
  1181. final formParams = <String, String>{};
  1182. const contentTypes = <String>[];
  1183. return apiClient.invokeAPI(
  1184. path,
  1185. 'POST',
  1186. queryParams,
  1187. postBody,
  1188. headerParams,
  1189. formParams,
  1190. contentTypes.isEmpty ? null : contentTypes.first,
  1191. );
  1192. }
  1193. Future<void> restoreTrash() async {
  1194. final response = await restoreTrashWithHttpInfo();
  1195. if (response.statusCode >= HttpStatus.badRequest) {
  1196. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1197. }
  1198. }
  1199. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1200. /// Parameters:
  1201. ///
  1202. /// * [AssetJobsDto] assetJobsDto (required):
  1203. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1204. // ignore: prefer_const_declarations
  1205. final path = r'/asset/jobs';
  1206. // ignore: prefer_final_locals
  1207. Object? postBody = assetJobsDto;
  1208. final queryParams = <QueryParam>[];
  1209. final headerParams = <String, String>{};
  1210. final formParams = <String, String>{};
  1211. const contentTypes = <String>['application/json'];
  1212. return apiClient.invokeAPI(
  1213. path,
  1214. 'POST',
  1215. queryParams,
  1216. postBody,
  1217. headerParams,
  1218. formParams,
  1219. contentTypes.isEmpty ? null : contentTypes.first,
  1220. );
  1221. }
  1222. /// Parameters:
  1223. ///
  1224. /// * [AssetJobsDto] assetJobsDto (required):
  1225. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1226. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1227. if (response.statusCode >= HttpStatus.badRequest) {
  1228. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1229. }
  1230. }
  1231. /// Performs an HTTP 'GET /assets' operation and returns the [Response].
  1232. /// Parameters:
  1233. ///
  1234. /// * [String] id:
  1235. ///
  1236. /// * [String] libraryId:
  1237. ///
  1238. /// * [AssetTypeEnum] type:
  1239. ///
  1240. /// * [AssetOrder] order:
  1241. ///
  1242. /// * [String] deviceAssetId:
  1243. ///
  1244. /// * [String] deviceId:
  1245. ///
  1246. /// * [String] checksum:
  1247. ///
  1248. /// * [bool] isArchived:
  1249. ///
  1250. /// * [bool] isEncoded:
  1251. ///
  1252. /// * [bool] isExternal:
  1253. ///
  1254. /// * [bool] isFavorite:
  1255. ///
  1256. /// * [bool] isMotion:
  1257. ///
  1258. /// * [bool] isOffline:
  1259. ///
  1260. /// * [bool] isReadOnly:
  1261. ///
  1262. /// * [bool] isVisible:
  1263. ///
  1264. /// * [bool] withDeleted:
  1265. ///
  1266. /// * [bool] withStacked:
  1267. ///
  1268. /// * [bool] withExif:
  1269. ///
  1270. /// * [bool] withPeople:
  1271. ///
  1272. /// * [DateTime] createdBefore:
  1273. ///
  1274. /// * [DateTime] createdAfter:
  1275. ///
  1276. /// * [DateTime] updatedBefore:
  1277. ///
  1278. /// * [DateTime] updatedAfter:
  1279. ///
  1280. /// * [DateTime] trashedBefore:
  1281. ///
  1282. /// * [DateTime] trashedAfter:
  1283. ///
  1284. /// * [DateTime] takenBefore:
  1285. ///
  1286. /// * [DateTime] takenAfter:
  1287. ///
  1288. /// * [String] originalFileName:
  1289. ///
  1290. /// * [String] originalPath:
  1291. ///
  1292. /// * [String] resizePath:
  1293. ///
  1294. /// * [String] webpPath:
  1295. ///
  1296. /// * [String] encodedVideoPath:
  1297. ///
  1298. /// * [String] city:
  1299. ///
  1300. /// * [String] state:
  1301. ///
  1302. /// * [String] country:
  1303. ///
  1304. /// * [String] make:
  1305. ///
  1306. /// * [String] model:
  1307. ///
  1308. /// * [String] lensModel:
  1309. ///
  1310. /// * [num] page:
  1311. ///
  1312. /// * [num] size:
  1313. Future<Response> searchAssetsWithHttpInfo({ String? id, String? libraryId, AssetTypeEnum? type, AssetOrder? order, String? deviceAssetId, String? deviceId, String? checksum, bool? isArchived, bool? isEncoded, bool? isExternal, bool? isFavorite, bool? isMotion, bool? isOffline, bool? isReadOnly, bool? isVisible, bool? withDeleted, bool? withStacked, bool? withExif, bool? withPeople, DateTime? createdBefore, DateTime? createdAfter, DateTime? updatedBefore, DateTime? updatedAfter, DateTime? trashedBefore, DateTime? trashedAfter, DateTime? takenBefore, DateTime? takenAfter, String? originalFileName, String? originalPath, String? resizePath, String? webpPath, String? encodedVideoPath, String? city, String? state, String? country, String? make, String? model, String? lensModel, num? page, num? size, }) async {
  1314. // ignore: prefer_const_declarations
  1315. final path = r'/assets';
  1316. // ignore: prefer_final_locals
  1317. Object? postBody;
  1318. final queryParams = <QueryParam>[];
  1319. final headerParams = <String, String>{};
  1320. final formParams = <String, String>{};
  1321. if (id != null) {
  1322. queryParams.addAll(_queryParams('', 'id', id));
  1323. }
  1324. if (libraryId != null) {
  1325. queryParams.addAll(_queryParams('', 'libraryId', libraryId));
  1326. }
  1327. if (type != null) {
  1328. queryParams.addAll(_queryParams('', 'type', type));
  1329. }
  1330. if (order != null) {
  1331. queryParams.addAll(_queryParams('', 'order', order));
  1332. }
  1333. if (deviceAssetId != null) {
  1334. queryParams.addAll(_queryParams('', 'deviceAssetId', deviceAssetId));
  1335. }
  1336. if (deviceId != null) {
  1337. queryParams.addAll(_queryParams('', 'deviceId', deviceId));
  1338. }
  1339. if (checksum != null) {
  1340. queryParams.addAll(_queryParams('', 'checksum', checksum));
  1341. }
  1342. if (isArchived != null) {
  1343. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  1344. }
  1345. if (isEncoded != null) {
  1346. queryParams.addAll(_queryParams('', 'isEncoded', isEncoded));
  1347. }
  1348. if (isExternal != null) {
  1349. queryParams.addAll(_queryParams('', 'isExternal', isExternal));
  1350. }
  1351. if (isFavorite != null) {
  1352. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  1353. }
  1354. if (isMotion != null) {
  1355. queryParams.addAll(_queryParams('', 'isMotion', isMotion));
  1356. }
  1357. if (isOffline != null) {
  1358. queryParams.addAll(_queryParams('', 'isOffline', isOffline));
  1359. }
  1360. if (isReadOnly != null) {
  1361. queryParams.addAll(_queryParams('', 'isReadOnly', isReadOnly));
  1362. }
  1363. if (isVisible != null) {
  1364. queryParams.addAll(_queryParams('', 'isVisible', isVisible));
  1365. }
  1366. if (withDeleted != null) {
  1367. queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
  1368. }
  1369. if (withStacked != null) {
  1370. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  1371. }
  1372. if (withExif != null) {
  1373. queryParams.addAll(_queryParams('', 'withExif', withExif));
  1374. }
  1375. if (withPeople != null) {
  1376. queryParams.addAll(_queryParams('', 'withPeople', withPeople));
  1377. }
  1378. if (createdBefore != null) {
  1379. queryParams.addAll(_queryParams('', 'createdBefore', createdBefore));
  1380. }
  1381. if (createdAfter != null) {
  1382. queryParams.addAll(_queryParams('', 'createdAfter', createdAfter));
  1383. }
  1384. if (updatedBefore != null) {
  1385. queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
  1386. }
  1387. if (updatedAfter != null) {
  1388. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  1389. }
  1390. if (trashedBefore != null) {
  1391. queryParams.addAll(_queryParams('', 'trashedBefore', trashedBefore));
  1392. }
  1393. if (trashedAfter != null) {
  1394. queryParams.addAll(_queryParams('', 'trashedAfter', trashedAfter));
  1395. }
  1396. if (takenBefore != null) {
  1397. queryParams.addAll(_queryParams('', 'takenBefore', takenBefore));
  1398. }
  1399. if (takenAfter != null) {
  1400. queryParams.addAll(_queryParams('', 'takenAfter', takenAfter));
  1401. }
  1402. if (originalFileName != null) {
  1403. queryParams.addAll(_queryParams('', 'originalFileName', originalFileName));
  1404. }
  1405. if (originalPath != null) {
  1406. queryParams.addAll(_queryParams('', 'originalPath', originalPath));
  1407. }
  1408. if (resizePath != null) {
  1409. queryParams.addAll(_queryParams('', 'resizePath', resizePath));
  1410. }
  1411. if (webpPath != null) {
  1412. queryParams.addAll(_queryParams('', 'webpPath', webpPath));
  1413. }
  1414. if (encodedVideoPath != null) {
  1415. queryParams.addAll(_queryParams('', 'encodedVideoPath', encodedVideoPath));
  1416. }
  1417. if (city != null) {
  1418. queryParams.addAll(_queryParams('', 'city', city));
  1419. }
  1420. if (state != null) {
  1421. queryParams.addAll(_queryParams('', 'state', state));
  1422. }
  1423. if (country != null) {
  1424. queryParams.addAll(_queryParams('', 'country', country));
  1425. }
  1426. if (make != null) {
  1427. queryParams.addAll(_queryParams('', 'make', make));
  1428. }
  1429. if (model != null) {
  1430. queryParams.addAll(_queryParams('', 'model', model));
  1431. }
  1432. if (lensModel != null) {
  1433. queryParams.addAll(_queryParams('', 'lensModel', lensModel));
  1434. }
  1435. if (page != null) {
  1436. queryParams.addAll(_queryParams('', 'page', page));
  1437. }
  1438. if (size != null) {
  1439. queryParams.addAll(_queryParams('', 'size', size));
  1440. }
  1441. const contentTypes = <String>[];
  1442. return apiClient.invokeAPI(
  1443. path,
  1444. 'GET',
  1445. queryParams,
  1446. postBody,
  1447. headerParams,
  1448. formParams,
  1449. contentTypes.isEmpty ? null : contentTypes.first,
  1450. );
  1451. }
  1452. /// Parameters:
  1453. ///
  1454. /// * [String] id:
  1455. ///
  1456. /// * [String] libraryId:
  1457. ///
  1458. /// * [AssetTypeEnum] type:
  1459. ///
  1460. /// * [AssetOrder] order:
  1461. ///
  1462. /// * [String] deviceAssetId:
  1463. ///
  1464. /// * [String] deviceId:
  1465. ///
  1466. /// * [String] checksum:
  1467. ///
  1468. /// * [bool] isArchived:
  1469. ///
  1470. /// * [bool] isEncoded:
  1471. ///
  1472. /// * [bool] isExternal:
  1473. ///
  1474. /// * [bool] isFavorite:
  1475. ///
  1476. /// * [bool] isMotion:
  1477. ///
  1478. /// * [bool] isOffline:
  1479. ///
  1480. /// * [bool] isReadOnly:
  1481. ///
  1482. /// * [bool] isVisible:
  1483. ///
  1484. /// * [bool] withDeleted:
  1485. ///
  1486. /// * [bool] withStacked:
  1487. ///
  1488. /// * [bool] withExif:
  1489. ///
  1490. /// * [bool] withPeople:
  1491. ///
  1492. /// * [DateTime] createdBefore:
  1493. ///
  1494. /// * [DateTime] createdAfter:
  1495. ///
  1496. /// * [DateTime] updatedBefore:
  1497. ///
  1498. /// * [DateTime] updatedAfter:
  1499. ///
  1500. /// * [DateTime] trashedBefore:
  1501. ///
  1502. /// * [DateTime] trashedAfter:
  1503. ///
  1504. /// * [DateTime] takenBefore:
  1505. ///
  1506. /// * [DateTime] takenAfter:
  1507. ///
  1508. /// * [String] originalFileName:
  1509. ///
  1510. /// * [String] originalPath:
  1511. ///
  1512. /// * [String] resizePath:
  1513. ///
  1514. /// * [String] webpPath:
  1515. ///
  1516. /// * [String] encodedVideoPath:
  1517. ///
  1518. /// * [String] city:
  1519. ///
  1520. /// * [String] state:
  1521. ///
  1522. /// * [String] country:
  1523. ///
  1524. /// * [String] make:
  1525. ///
  1526. /// * [String] model:
  1527. ///
  1528. /// * [String] lensModel:
  1529. ///
  1530. /// * [num] page:
  1531. ///
  1532. /// * [num] size:
  1533. Future<List<AssetResponseDto>?> searchAssets({ String? id, String? libraryId, AssetTypeEnum? type, AssetOrder? order, String? deviceAssetId, String? deviceId, String? checksum, bool? isArchived, bool? isEncoded, bool? isExternal, bool? isFavorite, bool? isMotion, bool? isOffline, bool? isReadOnly, bool? isVisible, bool? withDeleted, bool? withStacked, bool? withExif, bool? withPeople, DateTime? createdBefore, DateTime? createdAfter, DateTime? updatedBefore, DateTime? updatedAfter, DateTime? trashedBefore, DateTime? trashedAfter, DateTime? takenBefore, DateTime? takenAfter, String? originalFileName, String? originalPath, String? resizePath, String? webpPath, String? encodedVideoPath, String? city, String? state, String? country, String? make, String? model, String? lensModel, num? page, num? size, }) async {
  1534. final response = await searchAssetsWithHttpInfo( id: id, libraryId: libraryId, type: type, order: order, deviceAssetId: deviceAssetId, deviceId: deviceId, checksum: checksum, isArchived: isArchived, isEncoded: isEncoded, isExternal: isExternal, isFavorite: isFavorite, isMotion: isMotion, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, withDeleted: withDeleted, withStacked: withStacked, withExif: withExif, withPeople: withPeople, createdBefore: createdBefore, createdAfter: createdAfter, updatedBefore: updatedBefore, updatedAfter: updatedAfter, trashedBefore: trashedBefore, trashedAfter: trashedAfter, takenBefore: takenBefore, takenAfter: takenAfter, originalFileName: originalFileName, originalPath: originalPath, resizePath: resizePath, webpPath: webpPath, encodedVideoPath: encodedVideoPath, city: city, state: state, country: country, make: make, model: model, lensModel: lensModel, page: page, size: size, );
  1535. if (response.statusCode >= HttpStatus.badRequest) {
  1536. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1537. }
  1538. // When a remote server returns no body with a status of 204, we shall not decode it.
  1539. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1540. // FormatException when trying to decode an empty string.
  1541. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1542. final responseBody = await _decodeBodyBytes(response);
  1543. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1544. .cast<AssetResponseDto>()
  1545. .toList();
  1546. }
  1547. return null;
  1548. }
  1549. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1550. /// Parameters:
  1551. ///
  1552. /// * [String] id (required):
  1553. ///
  1554. /// * [bool] isThumb:
  1555. ///
  1556. /// * [bool] isWeb:
  1557. ///
  1558. /// * [String] key:
  1559. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1560. // ignore: prefer_const_declarations
  1561. final path = r'/asset/file/{id}'
  1562. .replaceAll('{id}', id);
  1563. // ignore: prefer_final_locals
  1564. Object? postBody;
  1565. final queryParams = <QueryParam>[];
  1566. final headerParams = <String, String>{};
  1567. final formParams = <String, String>{};
  1568. if (isThumb != null) {
  1569. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1570. }
  1571. if (isWeb != null) {
  1572. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1573. }
  1574. if (key != null) {
  1575. queryParams.addAll(_queryParams('', 'key', key));
  1576. }
  1577. const contentTypes = <String>[];
  1578. return apiClient.invokeAPI(
  1579. path,
  1580. 'GET',
  1581. queryParams,
  1582. postBody,
  1583. headerParams,
  1584. formParams,
  1585. contentTypes.isEmpty ? null : contentTypes.first,
  1586. );
  1587. }
  1588. /// Parameters:
  1589. ///
  1590. /// * [String] id (required):
  1591. ///
  1592. /// * [bool] isThumb:
  1593. ///
  1594. /// * [bool] isWeb:
  1595. ///
  1596. /// * [String] key:
  1597. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1598. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1599. if (response.statusCode >= HttpStatus.badRequest) {
  1600. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1601. }
  1602. // When a remote server returns no body with a status of 204, we shall not decode it.
  1603. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1604. // FormatException when trying to decode an empty string.
  1605. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1606. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1607. }
  1608. return null;
  1609. }
  1610. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1611. /// Parameters:
  1612. ///
  1613. /// * [String] id (required):
  1614. ///
  1615. /// * [UpdateAssetDto] updateAssetDto (required):
  1616. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1617. // ignore: prefer_const_declarations
  1618. final path = r'/asset/{id}'
  1619. .replaceAll('{id}', id);
  1620. // ignore: prefer_final_locals
  1621. Object? postBody = updateAssetDto;
  1622. final queryParams = <QueryParam>[];
  1623. final headerParams = <String, String>{};
  1624. final formParams = <String, String>{};
  1625. const contentTypes = <String>['application/json'];
  1626. return apiClient.invokeAPI(
  1627. path,
  1628. 'PUT',
  1629. queryParams,
  1630. postBody,
  1631. headerParams,
  1632. formParams,
  1633. contentTypes.isEmpty ? null : contentTypes.first,
  1634. );
  1635. }
  1636. /// Parameters:
  1637. ///
  1638. /// * [String] id (required):
  1639. ///
  1640. /// * [UpdateAssetDto] updateAssetDto (required):
  1641. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1642. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1643. if (response.statusCode >= HttpStatus.badRequest) {
  1644. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1645. }
  1646. // When a remote server returns no body with a status of 204, we shall not decode it.
  1647. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1648. // FormatException when trying to decode an empty string.
  1649. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1650. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1651. }
  1652. return null;
  1653. }
  1654. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1655. /// Parameters:
  1656. ///
  1657. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1658. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1659. // ignore: prefer_const_declarations
  1660. final path = r'/asset';
  1661. // ignore: prefer_final_locals
  1662. Object? postBody = assetBulkUpdateDto;
  1663. final queryParams = <QueryParam>[];
  1664. final headerParams = <String, String>{};
  1665. final formParams = <String, String>{};
  1666. const contentTypes = <String>['application/json'];
  1667. return apiClient.invokeAPI(
  1668. path,
  1669. 'PUT',
  1670. queryParams,
  1671. postBody,
  1672. headerParams,
  1673. formParams,
  1674. contentTypes.isEmpty ? null : contentTypes.first,
  1675. );
  1676. }
  1677. /// Parameters:
  1678. ///
  1679. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1680. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1681. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1682. if (response.statusCode >= HttpStatus.badRequest) {
  1683. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1684. }
  1685. }
  1686. /// Performs an HTTP 'PUT /asset/stack/parent' operation and returns the [Response].
  1687. /// Parameters:
  1688. ///
  1689. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1690. Future<Response> updateStackParentWithHttpInfo(UpdateStackParentDto updateStackParentDto,) async {
  1691. // ignore: prefer_const_declarations
  1692. final path = r'/asset/stack/parent';
  1693. // ignore: prefer_final_locals
  1694. Object? postBody = updateStackParentDto;
  1695. final queryParams = <QueryParam>[];
  1696. final headerParams = <String, String>{};
  1697. final formParams = <String, String>{};
  1698. const contentTypes = <String>['application/json'];
  1699. return apiClient.invokeAPI(
  1700. path,
  1701. 'PUT',
  1702. queryParams,
  1703. postBody,
  1704. headerParams,
  1705. formParams,
  1706. contentTypes.isEmpty ? null : contentTypes.first,
  1707. );
  1708. }
  1709. /// Parameters:
  1710. ///
  1711. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1712. Future<void> updateStackParent(UpdateStackParentDto updateStackParentDto,) async {
  1713. final response = await updateStackParentWithHttpInfo(updateStackParentDto,);
  1714. if (response.statusCode >= HttpStatus.badRequest) {
  1715. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1716. }
  1717. }
  1718. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1719. /// Parameters:
  1720. ///
  1721. /// * [MultipartFile] assetData (required):
  1722. ///
  1723. /// * [String] deviceAssetId (required):
  1724. ///
  1725. /// * [String] deviceId (required):
  1726. ///
  1727. /// * [DateTime] fileCreatedAt (required):
  1728. ///
  1729. /// * [DateTime] fileModifiedAt (required):
  1730. ///
  1731. /// * [String] key:
  1732. ///
  1733. /// * [String] duration:
  1734. ///
  1735. /// * [bool] isArchived:
  1736. ///
  1737. /// * [bool] isExternal:
  1738. ///
  1739. /// * [bool] isFavorite:
  1740. ///
  1741. /// * [bool] isOffline:
  1742. ///
  1743. /// * [bool] isReadOnly:
  1744. ///
  1745. /// * [bool] isVisible:
  1746. ///
  1747. /// * [String] libraryId:
  1748. ///
  1749. /// * [MultipartFile] livePhotoData:
  1750. ///
  1751. /// * [MultipartFile] sidecarData:
  1752. Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1753. // ignore: prefer_const_declarations
  1754. final path = r'/asset/upload';
  1755. // ignore: prefer_final_locals
  1756. Object? postBody;
  1757. final queryParams = <QueryParam>[];
  1758. final headerParams = <String, String>{};
  1759. final formParams = <String, String>{};
  1760. if (key != null) {
  1761. queryParams.addAll(_queryParams('', 'key', key));
  1762. }
  1763. const contentTypes = <String>['multipart/form-data'];
  1764. bool hasFields = false;
  1765. final mp = MultipartRequest('POST', Uri.parse(path));
  1766. if (assetData != null) {
  1767. hasFields = true;
  1768. mp.fields[r'assetData'] = assetData.field;
  1769. mp.files.add(assetData);
  1770. }
  1771. if (deviceAssetId != null) {
  1772. hasFields = true;
  1773. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1774. }
  1775. if (deviceId != null) {
  1776. hasFields = true;
  1777. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1778. }
  1779. if (duration != null) {
  1780. hasFields = true;
  1781. mp.fields[r'duration'] = parameterToString(duration);
  1782. }
  1783. if (fileCreatedAt != null) {
  1784. hasFields = true;
  1785. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1786. }
  1787. if (fileModifiedAt != null) {
  1788. hasFields = true;
  1789. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1790. }
  1791. if (isArchived != null) {
  1792. hasFields = true;
  1793. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1794. }
  1795. if (isExternal != null) {
  1796. hasFields = true;
  1797. mp.fields[r'isExternal'] = parameterToString(isExternal);
  1798. }
  1799. if (isFavorite != null) {
  1800. hasFields = true;
  1801. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1802. }
  1803. if (isOffline != null) {
  1804. hasFields = true;
  1805. mp.fields[r'isOffline'] = parameterToString(isOffline);
  1806. }
  1807. if (isReadOnly != null) {
  1808. hasFields = true;
  1809. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1810. }
  1811. if (isVisible != null) {
  1812. hasFields = true;
  1813. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1814. }
  1815. if (libraryId != null) {
  1816. hasFields = true;
  1817. mp.fields[r'libraryId'] = parameterToString(libraryId);
  1818. }
  1819. if (livePhotoData != null) {
  1820. hasFields = true;
  1821. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1822. mp.files.add(livePhotoData);
  1823. }
  1824. if (sidecarData != null) {
  1825. hasFields = true;
  1826. mp.fields[r'sidecarData'] = sidecarData.field;
  1827. mp.files.add(sidecarData);
  1828. }
  1829. if (hasFields) {
  1830. postBody = mp;
  1831. }
  1832. return apiClient.invokeAPI(
  1833. path,
  1834. 'POST',
  1835. queryParams,
  1836. postBody,
  1837. headerParams,
  1838. formParams,
  1839. contentTypes.isEmpty ? null : contentTypes.first,
  1840. );
  1841. }
  1842. /// Parameters:
  1843. ///
  1844. /// * [MultipartFile] assetData (required):
  1845. ///
  1846. /// * [String] deviceAssetId (required):
  1847. ///
  1848. /// * [String] deviceId (required):
  1849. ///
  1850. /// * [DateTime] fileCreatedAt (required):
  1851. ///
  1852. /// * [DateTime] fileModifiedAt (required):
  1853. ///
  1854. /// * [String] key:
  1855. ///
  1856. /// * [String] duration:
  1857. ///
  1858. /// * [bool] isArchived:
  1859. ///
  1860. /// * [bool] isExternal:
  1861. ///
  1862. /// * [bool] isFavorite:
  1863. ///
  1864. /// * [bool] isOffline:
  1865. ///
  1866. /// * [bool] isReadOnly:
  1867. ///
  1868. /// * [bool] isVisible:
  1869. ///
  1870. /// * [String] libraryId:
  1871. ///
  1872. /// * [MultipartFile] livePhotoData:
  1873. ///
  1874. /// * [MultipartFile] sidecarData:
  1875. Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
  1876. final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isFavorite: isFavorite, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
  1877. if (response.statusCode >= HttpStatus.badRequest) {
  1878. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1879. }
  1880. // When a remote server returns no body with a status of 204, we shall not decode it.
  1881. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1882. // FormatException when trying to decode an empty string.
  1883. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1884. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1885. }
  1886. return null;
  1887. }
  1888. }