asset_api.dart 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133
  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 a single asset's information
  354. ///
  355. /// Note: This method returns the HTTP [Response].
  356. ///
  357. /// Parameters:
  358. ///
  359. /// * [String] id (required):
  360. ///
  361. /// * [String] key:
  362. Future<Response> getAssetByIdWithHttpInfo(String id, { String? key, }) async {
  363. // ignore: prefer_const_declarations
  364. final path = r'/asset/assetById/{id}'
  365. .replaceAll('{id}', id);
  366. // ignore: prefer_final_locals
  367. Object? postBody;
  368. final queryParams = <QueryParam>[];
  369. final headerParams = <String, String>{};
  370. final formParams = <String, String>{};
  371. if (key != null) {
  372. queryParams.addAll(_queryParams('', 'key', key));
  373. }
  374. const contentTypes = <String>[];
  375. return apiClient.invokeAPI(
  376. path,
  377. 'GET',
  378. queryParams,
  379. postBody,
  380. headerParams,
  381. formParams,
  382. contentTypes.isEmpty ? null : contentTypes.first,
  383. );
  384. }
  385. /// Get a single asset's information
  386. ///
  387. /// Parameters:
  388. ///
  389. /// * [String] id (required):
  390. ///
  391. /// * [String] key:
  392. Future<AssetResponseDto?> getAssetById(String id, { String? key, }) async {
  393. final response = await getAssetByIdWithHttpInfo(id, key: key, );
  394. if (response.statusCode >= HttpStatus.badRequest) {
  395. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  396. }
  397. // When a remote server returns no body with a status of 204, we shall not decode it.
  398. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  399. // FormatException when trying to decode an empty string.
  400. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  401. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  402. }
  403. return null;
  404. }
  405. /// Performs an HTTP 'GET /asset/search-terms' operation and returns the [Response].
  406. Future<Response> getAssetSearchTermsWithHttpInfo() async {
  407. // ignore: prefer_const_declarations
  408. final path = r'/asset/search-terms';
  409. // ignore: prefer_final_locals
  410. Object? postBody;
  411. final queryParams = <QueryParam>[];
  412. final headerParams = <String, String>{};
  413. final formParams = <String, String>{};
  414. const contentTypes = <String>[];
  415. return apiClient.invokeAPI(
  416. path,
  417. 'GET',
  418. queryParams,
  419. postBody,
  420. headerParams,
  421. formParams,
  422. contentTypes.isEmpty ? null : contentTypes.first,
  423. );
  424. }
  425. Future<List<String>?> getAssetSearchTerms() async {
  426. final response = await getAssetSearchTermsWithHttpInfo();
  427. if (response.statusCode >= HttpStatus.badRequest) {
  428. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  429. }
  430. // When a remote server returns no body with a status of 204, we shall not decode it.
  431. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  432. // FormatException when trying to decode an empty string.
  433. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  434. final responseBody = await _decodeBodyBytes(response);
  435. return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
  436. .cast<String>()
  437. .toList();
  438. }
  439. return null;
  440. }
  441. /// Performs an HTTP 'GET /asset/statistics' operation and returns the [Response].
  442. /// Parameters:
  443. ///
  444. /// * [bool] isArchived:
  445. ///
  446. /// * [bool] isFavorite:
  447. ///
  448. /// * [bool] isTrashed:
  449. Future<Response> getAssetStatisticsWithHttpInfo({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
  450. // ignore: prefer_const_declarations
  451. final path = r'/asset/statistics';
  452. // ignore: prefer_final_locals
  453. Object? postBody;
  454. final queryParams = <QueryParam>[];
  455. final headerParams = <String, String>{};
  456. final formParams = <String, String>{};
  457. if (isArchived != null) {
  458. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  459. }
  460. if (isFavorite != null) {
  461. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  462. }
  463. if (isTrashed != null) {
  464. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  465. }
  466. const contentTypes = <String>[];
  467. return apiClient.invokeAPI(
  468. path,
  469. 'GET',
  470. queryParams,
  471. postBody,
  472. headerParams,
  473. formParams,
  474. contentTypes.isEmpty ? null : contentTypes.first,
  475. );
  476. }
  477. /// Parameters:
  478. ///
  479. /// * [bool] isArchived:
  480. ///
  481. /// * [bool] isFavorite:
  482. ///
  483. /// * [bool] isTrashed:
  484. Future<AssetStatsResponseDto?> getAssetStatistics({ bool? isArchived, bool? isFavorite, bool? isTrashed, }) async {
  485. final response = await getAssetStatisticsWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, );
  486. if (response.statusCode >= HttpStatus.badRequest) {
  487. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  488. }
  489. // When a remote server returns no body with a status of 204, we shall not decode it.
  490. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  491. // FormatException when trying to decode an empty string.
  492. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  493. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
  494. }
  495. return null;
  496. }
  497. /// Performs an HTTP 'GET /asset/thumbnail/{id}' operation and returns the [Response].
  498. /// Parameters:
  499. ///
  500. /// * [String] id (required):
  501. ///
  502. /// * [ThumbnailFormat] format:
  503. ///
  504. /// * [String] key:
  505. Future<Response> getAssetThumbnailWithHttpInfo(String id, { ThumbnailFormat? format, String? key, }) async {
  506. // ignore: prefer_const_declarations
  507. final path = r'/asset/thumbnail/{id}'
  508. .replaceAll('{id}', id);
  509. // ignore: prefer_final_locals
  510. Object? postBody;
  511. final queryParams = <QueryParam>[];
  512. final headerParams = <String, String>{};
  513. final formParams = <String, String>{};
  514. if (format != null) {
  515. queryParams.addAll(_queryParams('', 'format', format));
  516. }
  517. if (key != null) {
  518. queryParams.addAll(_queryParams('', 'key', key));
  519. }
  520. const contentTypes = <String>[];
  521. return apiClient.invokeAPI(
  522. path,
  523. 'GET',
  524. queryParams,
  525. postBody,
  526. headerParams,
  527. formParams,
  528. contentTypes.isEmpty ? null : contentTypes.first,
  529. );
  530. }
  531. /// Parameters:
  532. ///
  533. /// * [String] id (required):
  534. ///
  535. /// * [ThumbnailFormat] format:
  536. ///
  537. /// * [String] key:
  538. Future<MultipartFile?> getAssetThumbnail(String id, { ThumbnailFormat? format, String? key, }) async {
  539. final response = await getAssetThumbnailWithHttpInfo(id, format: format, key: key, );
  540. if (response.statusCode >= HttpStatus.badRequest) {
  541. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  542. }
  543. // When a remote server returns no body with a status of 204, we shall not decode it.
  544. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  545. // FormatException when trying to decode an empty string.
  546. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  547. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  548. }
  549. return null;
  550. }
  551. /// Performs an HTTP 'GET /asset/curated-locations' operation and returns the [Response].
  552. Future<Response> getCuratedLocationsWithHttpInfo() async {
  553. // ignore: prefer_const_declarations
  554. final path = r'/asset/curated-locations';
  555. // ignore: prefer_final_locals
  556. Object? postBody;
  557. final queryParams = <QueryParam>[];
  558. final headerParams = <String, String>{};
  559. final formParams = <String, String>{};
  560. const contentTypes = <String>[];
  561. return apiClient.invokeAPI(
  562. path,
  563. 'GET',
  564. queryParams,
  565. postBody,
  566. headerParams,
  567. formParams,
  568. contentTypes.isEmpty ? null : contentTypes.first,
  569. );
  570. }
  571. Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
  572. final response = await getCuratedLocationsWithHttpInfo();
  573. if (response.statusCode >= HttpStatus.badRequest) {
  574. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  575. }
  576. // When a remote server returns no body with a status of 204, we shall not decode it.
  577. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  578. // FormatException when trying to decode an empty string.
  579. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  580. final responseBody = await _decodeBodyBytes(response);
  581. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
  582. .cast<CuratedLocationsResponseDto>()
  583. .toList();
  584. }
  585. return null;
  586. }
  587. /// Performs an HTTP 'GET /asset/curated-objects' operation and returns the [Response].
  588. Future<Response> getCuratedObjectsWithHttpInfo() async {
  589. // ignore: prefer_const_declarations
  590. final path = r'/asset/curated-objects';
  591. // ignore: prefer_final_locals
  592. Object? postBody;
  593. final queryParams = <QueryParam>[];
  594. final headerParams = <String, String>{};
  595. final formParams = <String, String>{};
  596. const contentTypes = <String>[];
  597. return apiClient.invokeAPI(
  598. path,
  599. 'GET',
  600. queryParams,
  601. postBody,
  602. headerParams,
  603. formParams,
  604. contentTypes.isEmpty ? null : contentTypes.first,
  605. );
  606. }
  607. Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
  608. final response = await getCuratedObjectsWithHttpInfo();
  609. if (response.statusCode >= HttpStatus.badRequest) {
  610. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  611. }
  612. // When a remote server returns no body with a status of 204, we shall not decode it.
  613. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  614. // FormatException when trying to decode an empty string.
  615. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  616. final responseBody = await _decodeBodyBytes(response);
  617. return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
  618. .cast<CuratedObjectsResponseDto>()
  619. .toList();
  620. }
  621. return null;
  622. }
  623. /// Performs an HTTP 'POST /asset/download/info' operation and returns the [Response].
  624. /// Parameters:
  625. ///
  626. /// * [DownloadInfoDto] downloadInfoDto (required):
  627. ///
  628. /// * [String] key:
  629. Future<Response> getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  630. // ignore: prefer_const_declarations
  631. final path = r'/asset/download/info';
  632. // ignore: prefer_final_locals
  633. Object? postBody = downloadInfoDto;
  634. final queryParams = <QueryParam>[];
  635. final headerParams = <String, String>{};
  636. final formParams = <String, String>{};
  637. if (key != null) {
  638. queryParams.addAll(_queryParams('', 'key', key));
  639. }
  640. const contentTypes = <String>['application/json'];
  641. return apiClient.invokeAPI(
  642. path,
  643. 'POST',
  644. queryParams,
  645. postBody,
  646. headerParams,
  647. formParams,
  648. contentTypes.isEmpty ? null : contentTypes.first,
  649. );
  650. }
  651. /// Parameters:
  652. ///
  653. /// * [DownloadInfoDto] downloadInfoDto (required):
  654. ///
  655. /// * [String] key:
  656. Future<DownloadResponseDto?> getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, }) async {
  657. final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, );
  658. if (response.statusCode >= HttpStatus.badRequest) {
  659. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  660. }
  661. // When a remote server returns no body with a status of 204, we shall not decode it.
  662. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  663. // FormatException when trying to decode an empty string.
  664. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  665. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DownloadResponseDto',) as DownloadResponseDto;
  666. }
  667. return null;
  668. }
  669. /// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
  670. /// Parameters:
  671. ///
  672. /// * [bool] isArchived:
  673. ///
  674. /// * [bool] isFavorite:
  675. ///
  676. /// * [DateTime] fileCreatedAfter:
  677. ///
  678. /// * [DateTime] fileCreatedBefore:
  679. Future<Response> getMapMarkersWithHttpInfo({ bool? isArchived, bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  680. // ignore: prefer_const_declarations
  681. final path = r'/asset/map-marker';
  682. // ignore: prefer_final_locals
  683. Object? postBody;
  684. final queryParams = <QueryParam>[];
  685. final headerParams = <String, String>{};
  686. final formParams = <String, String>{};
  687. if (isArchived != null) {
  688. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  689. }
  690. if (isFavorite != null) {
  691. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  692. }
  693. if (fileCreatedAfter != null) {
  694. queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter));
  695. }
  696. if (fileCreatedBefore != null) {
  697. queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore));
  698. }
  699. const contentTypes = <String>[];
  700. return apiClient.invokeAPI(
  701. path,
  702. 'GET',
  703. queryParams,
  704. postBody,
  705. headerParams,
  706. formParams,
  707. contentTypes.isEmpty ? null : contentTypes.first,
  708. );
  709. }
  710. /// Parameters:
  711. ///
  712. /// * [bool] isArchived:
  713. ///
  714. /// * [bool] isFavorite:
  715. ///
  716. /// * [DateTime] fileCreatedAfter:
  717. ///
  718. /// * [DateTime] fileCreatedBefore:
  719. Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isArchived, bool? isFavorite, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async {
  720. final response = await getMapMarkersWithHttpInfo( isArchived: isArchived, isFavorite: isFavorite, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, );
  721. if (response.statusCode >= HttpStatus.badRequest) {
  722. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  723. }
  724. // When a remote server returns no body with a status of 204, we shall not decode it.
  725. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  726. // FormatException when trying to decode an empty string.
  727. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  728. final responseBody = await _decodeBodyBytes(response);
  729. return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
  730. .cast<MapMarkerResponseDto>()
  731. .toList();
  732. }
  733. return null;
  734. }
  735. /// Performs an HTTP 'GET /asset/memory-lane' operation and returns the [Response].
  736. /// Parameters:
  737. ///
  738. /// * [int] day (required):
  739. ///
  740. /// * [int] month (required):
  741. Future<Response> getMemoryLaneWithHttpInfo(int day, int month,) async {
  742. // ignore: prefer_const_declarations
  743. final path = r'/asset/memory-lane';
  744. // ignore: prefer_final_locals
  745. Object? postBody;
  746. final queryParams = <QueryParam>[];
  747. final headerParams = <String, String>{};
  748. final formParams = <String, String>{};
  749. queryParams.addAll(_queryParams('', 'day', day));
  750. queryParams.addAll(_queryParams('', 'month', month));
  751. const contentTypes = <String>[];
  752. return apiClient.invokeAPI(
  753. path,
  754. 'GET',
  755. queryParams,
  756. postBody,
  757. headerParams,
  758. formParams,
  759. contentTypes.isEmpty ? null : contentTypes.first,
  760. );
  761. }
  762. /// Parameters:
  763. ///
  764. /// * [int] day (required):
  765. ///
  766. /// * [int] month (required):
  767. Future<List<MemoryLaneResponseDto>?> getMemoryLane(int day, int month,) async {
  768. final response = await getMemoryLaneWithHttpInfo(day, month,);
  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<MemoryLaneResponseDto>') as List)
  778. .cast<MemoryLaneResponseDto>()
  779. .toList();
  780. }
  781. return null;
  782. }
  783. /// Performs an HTTP 'GET /asset/random' operation and returns the [Response].
  784. /// Parameters:
  785. ///
  786. /// * [num] count:
  787. Future<Response> getRandomWithHttpInfo({ num? count, }) async {
  788. // ignore: prefer_const_declarations
  789. final path = r'/asset/random';
  790. // ignore: prefer_final_locals
  791. Object? postBody;
  792. final queryParams = <QueryParam>[];
  793. final headerParams = <String, String>{};
  794. final formParams = <String, String>{};
  795. if (count != null) {
  796. queryParams.addAll(_queryParams('', 'count', count));
  797. }
  798. const contentTypes = <String>[];
  799. return apiClient.invokeAPI(
  800. path,
  801. 'GET',
  802. queryParams,
  803. postBody,
  804. headerParams,
  805. formParams,
  806. contentTypes.isEmpty ? null : contentTypes.first,
  807. );
  808. }
  809. /// Parameters:
  810. ///
  811. /// * [num] count:
  812. Future<List<AssetResponseDto>?> getRandom({ num? count, }) async {
  813. final response = await getRandomWithHttpInfo( count: count, );
  814. if (response.statusCode >= HttpStatus.badRequest) {
  815. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  816. }
  817. // When a remote server returns no body with a status of 204, we shall not decode it.
  818. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  819. // FormatException when trying to decode an empty string.
  820. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  821. final responseBody = await _decodeBodyBytes(response);
  822. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  823. .cast<AssetResponseDto>()
  824. .toList();
  825. }
  826. return null;
  827. }
  828. /// Performs an HTTP 'GET /asset/time-bucket' operation and returns the [Response].
  829. /// Parameters:
  830. ///
  831. /// * [TimeBucketSize] size (required):
  832. ///
  833. /// * [String] timeBucket (required):
  834. ///
  835. /// * [String] userId:
  836. ///
  837. /// * [String] albumId:
  838. ///
  839. /// * [String] personId:
  840. ///
  841. /// * [bool] isArchived:
  842. ///
  843. /// * [bool] isFavorite:
  844. ///
  845. /// * [bool] isTrashed:
  846. ///
  847. /// * [bool] withStacked:
  848. ///
  849. /// * [bool] withPartners:
  850. ///
  851. /// * [String] key:
  852. 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 {
  853. // ignore: prefer_const_declarations
  854. final path = r'/asset/time-bucket';
  855. // ignore: prefer_final_locals
  856. Object? postBody;
  857. final queryParams = <QueryParam>[];
  858. final headerParams = <String, String>{};
  859. final formParams = <String, String>{};
  860. queryParams.addAll(_queryParams('', 'size', size));
  861. if (userId != null) {
  862. queryParams.addAll(_queryParams('', 'userId', userId));
  863. }
  864. if (albumId != null) {
  865. queryParams.addAll(_queryParams('', 'albumId', albumId));
  866. }
  867. if (personId != null) {
  868. queryParams.addAll(_queryParams('', 'personId', personId));
  869. }
  870. if (isArchived != null) {
  871. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  872. }
  873. if (isFavorite != null) {
  874. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  875. }
  876. if (isTrashed != null) {
  877. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  878. }
  879. if (withStacked != null) {
  880. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  881. }
  882. if (withPartners != null) {
  883. queryParams.addAll(_queryParams('', 'withPartners', withPartners));
  884. }
  885. queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
  886. if (key != null) {
  887. queryParams.addAll(_queryParams('', 'key', key));
  888. }
  889. const contentTypes = <String>[];
  890. return apiClient.invokeAPI(
  891. path,
  892. 'GET',
  893. queryParams,
  894. postBody,
  895. headerParams,
  896. formParams,
  897. contentTypes.isEmpty ? null : contentTypes.first,
  898. );
  899. }
  900. /// Parameters:
  901. ///
  902. /// * [TimeBucketSize] size (required):
  903. ///
  904. /// * [String] timeBucket (required):
  905. ///
  906. /// * [String] userId:
  907. ///
  908. /// * [String] albumId:
  909. ///
  910. /// * [String] personId:
  911. ///
  912. /// * [bool] isArchived:
  913. ///
  914. /// * [bool] isFavorite:
  915. ///
  916. /// * [bool] isTrashed:
  917. ///
  918. /// * [bool] withStacked:
  919. ///
  920. /// * [bool] withPartners:
  921. ///
  922. /// * [String] key:
  923. 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 {
  924. final response = await getTimeBucketWithHttpInfo(size, timeBucket, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, withStacked: withStacked, withPartners: withPartners, key: key, );
  925. if (response.statusCode >= HttpStatus.badRequest) {
  926. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  927. }
  928. // When a remote server returns no body with a status of 204, we shall not decode it.
  929. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  930. // FormatException when trying to decode an empty string.
  931. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  932. final responseBody = await _decodeBodyBytes(response);
  933. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  934. .cast<AssetResponseDto>()
  935. .toList();
  936. }
  937. return null;
  938. }
  939. /// Performs an HTTP 'GET /asset/time-buckets' operation and returns the [Response].
  940. /// Parameters:
  941. ///
  942. /// * [TimeBucketSize] size (required):
  943. ///
  944. /// * [String] userId:
  945. ///
  946. /// * [String] albumId:
  947. ///
  948. /// * [String] personId:
  949. ///
  950. /// * [bool] isArchived:
  951. ///
  952. /// * [bool] isFavorite:
  953. ///
  954. /// * [bool] isTrashed:
  955. ///
  956. /// * [bool] withStacked:
  957. ///
  958. /// * [bool] withPartners:
  959. ///
  960. /// * [String] key:
  961. Future<Response> getTimeBucketsWithHttpInfo(TimeBucketSize size, { String? userId, String? albumId, String? personId, bool? isArchived, bool? isFavorite, bool? isTrashed, bool? withStacked, bool? withPartners, String? key, }) async {
  962. // ignore: prefer_const_declarations
  963. final path = r'/asset/time-buckets';
  964. // ignore: prefer_final_locals
  965. Object? postBody;
  966. final queryParams = <QueryParam>[];
  967. final headerParams = <String, String>{};
  968. final formParams = <String, String>{};
  969. queryParams.addAll(_queryParams('', 'size', size));
  970. if (userId != null) {
  971. queryParams.addAll(_queryParams('', 'userId', userId));
  972. }
  973. if (albumId != null) {
  974. queryParams.addAll(_queryParams('', 'albumId', albumId));
  975. }
  976. if (personId != null) {
  977. queryParams.addAll(_queryParams('', 'personId', personId));
  978. }
  979. if (isArchived != null) {
  980. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  981. }
  982. if (isFavorite != null) {
  983. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  984. }
  985. if (isTrashed != null) {
  986. queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
  987. }
  988. if (withStacked != null) {
  989. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  990. }
  991. if (withPartners != null) {
  992. queryParams.addAll(_queryParams('', 'withPartners', withPartners));
  993. }
  994. if (key != null) {
  995. queryParams.addAll(_queryParams('', 'key', key));
  996. }
  997. const contentTypes = <String>[];
  998. return apiClient.invokeAPI(
  999. path,
  1000. 'GET',
  1001. queryParams,
  1002. postBody,
  1003. headerParams,
  1004. formParams,
  1005. contentTypes.isEmpty ? null : contentTypes.first,
  1006. );
  1007. }
  1008. /// Parameters:
  1009. ///
  1010. /// * [TimeBucketSize] size (required):
  1011. ///
  1012. /// * [String] userId:
  1013. ///
  1014. /// * [String] albumId:
  1015. ///
  1016. /// * [String] personId:
  1017. ///
  1018. /// * [bool] isArchived:
  1019. ///
  1020. /// * [bool] isFavorite:
  1021. ///
  1022. /// * [bool] isTrashed:
  1023. ///
  1024. /// * [bool] withStacked:
  1025. ///
  1026. /// * [bool] withPartners:
  1027. ///
  1028. /// * [String] key:
  1029. 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 {
  1030. final response = await getTimeBucketsWithHttpInfo(size, userId: userId, albumId: albumId, personId: personId, isArchived: isArchived, isFavorite: isFavorite, isTrashed: isTrashed, withStacked: withStacked, withPartners: withPartners, key: key, );
  1031. if (response.statusCode >= HttpStatus.badRequest) {
  1032. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1033. }
  1034. // When a remote server returns no body with a status of 204, we shall not decode it.
  1035. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1036. // FormatException when trying to decode an empty string.
  1037. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1038. final responseBody = await _decodeBodyBytes(response);
  1039. return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketResponseDto>') as List)
  1040. .cast<TimeBucketResponseDto>()
  1041. .toList();
  1042. }
  1043. return null;
  1044. }
  1045. /// Get all asset of a device that are in the database, ID only.
  1046. ///
  1047. /// Note: This method returns the HTTP [Response].
  1048. ///
  1049. /// Parameters:
  1050. ///
  1051. /// * [String] deviceId (required):
  1052. Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
  1053. // ignore: prefer_const_declarations
  1054. final path = r'/asset/{deviceId}'
  1055. .replaceAll('{deviceId}', deviceId);
  1056. // ignore: prefer_final_locals
  1057. Object? postBody;
  1058. final queryParams = <QueryParam>[];
  1059. final headerParams = <String, String>{};
  1060. final formParams = <String, String>{};
  1061. const contentTypes = <String>[];
  1062. return apiClient.invokeAPI(
  1063. path,
  1064. 'GET',
  1065. queryParams,
  1066. postBody,
  1067. headerParams,
  1068. formParams,
  1069. contentTypes.isEmpty ? null : contentTypes.first,
  1070. );
  1071. }
  1072. /// Get all asset of a device that are in the database, ID only.
  1073. ///
  1074. /// Parameters:
  1075. ///
  1076. /// * [String] deviceId (required):
  1077. Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
  1078. final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
  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<String>') as List)
  1088. .cast<String>()
  1089. .toList();
  1090. }
  1091. return null;
  1092. }
  1093. /// Performs an HTTP 'POST /asset/import' operation and returns the [Response].
  1094. /// Parameters:
  1095. ///
  1096. /// * [ImportAssetDto] importAssetDto (required):
  1097. Future<Response> importFileWithHttpInfo(ImportAssetDto importAssetDto,) async {
  1098. // ignore: prefer_const_declarations
  1099. final path = r'/asset/import';
  1100. // ignore: prefer_final_locals
  1101. Object? postBody = importAssetDto;
  1102. final queryParams = <QueryParam>[];
  1103. final headerParams = <String, String>{};
  1104. final formParams = <String, String>{};
  1105. const contentTypes = <String>['application/json'];
  1106. return apiClient.invokeAPI(
  1107. path,
  1108. 'POST',
  1109. queryParams,
  1110. postBody,
  1111. headerParams,
  1112. formParams,
  1113. contentTypes.isEmpty ? null : contentTypes.first,
  1114. );
  1115. }
  1116. /// Parameters:
  1117. ///
  1118. /// * [ImportAssetDto] importAssetDto (required):
  1119. Future<AssetFileUploadResponseDto?> importFile(ImportAssetDto importAssetDto,) async {
  1120. final response = await importFileWithHttpInfo(importAssetDto,);
  1121. if (response.statusCode >= HttpStatus.badRequest) {
  1122. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1123. }
  1124. // When a remote server returns no body with a status of 204, we shall not decode it.
  1125. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1126. // FormatException when trying to decode an empty string.
  1127. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1128. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1129. }
  1130. return null;
  1131. }
  1132. /// Performs an HTTP 'POST /asset/restore' operation and returns the [Response].
  1133. /// Parameters:
  1134. ///
  1135. /// * [BulkIdsDto] bulkIdsDto (required):
  1136. Future<Response> restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
  1137. // ignore: prefer_const_declarations
  1138. final path = r'/asset/restore';
  1139. // ignore: prefer_final_locals
  1140. Object? postBody = bulkIdsDto;
  1141. final queryParams = <QueryParam>[];
  1142. final headerParams = <String, String>{};
  1143. final formParams = <String, String>{};
  1144. const contentTypes = <String>['application/json'];
  1145. return apiClient.invokeAPI(
  1146. path,
  1147. 'POST',
  1148. queryParams,
  1149. postBody,
  1150. headerParams,
  1151. formParams,
  1152. contentTypes.isEmpty ? null : contentTypes.first,
  1153. );
  1154. }
  1155. /// Parameters:
  1156. ///
  1157. /// * [BulkIdsDto] bulkIdsDto (required):
  1158. Future<void> restoreAssets(BulkIdsDto bulkIdsDto,) async {
  1159. final response = await restoreAssetsWithHttpInfo(bulkIdsDto,);
  1160. if (response.statusCode >= HttpStatus.badRequest) {
  1161. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1162. }
  1163. }
  1164. /// Performs an HTTP 'POST /asset/trash/restore' operation and returns the [Response].
  1165. Future<Response> restoreTrashWithHttpInfo() async {
  1166. // ignore: prefer_const_declarations
  1167. final path = r'/asset/trash/restore';
  1168. // ignore: prefer_final_locals
  1169. Object? postBody;
  1170. final queryParams = <QueryParam>[];
  1171. final headerParams = <String, String>{};
  1172. final formParams = <String, String>{};
  1173. const contentTypes = <String>[];
  1174. return apiClient.invokeAPI(
  1175. path,
  1176. 'POST',
  1177. queryParams,
  1178. postBody,
  1179. headerParams,
  1180. formParams,
  1181. contentTypes.isEmpty ? null : contentTypes.first,
  1182. );
  1183. }
  1184. Future<void> restoreTrash() async {
  1185. final response = await restoreTrashWithHttpInfo();
  1186. if (response.statusCode >= HttpStatus.badRequest) {
  1187. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1188. }
  1189. }
  1190. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1191. /// Parameters:
  1192. ///
  1193. /// * [AssetJobsDto] assetJobsDto (required):
  1194. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1195. // ignore: prefer_const_declarations
  1196. final path = r'/asset/jobs';
  1197. // ignore: prefer_final_locals
  1198. Object? postBody = assetJobsDto;
  1199. final queryParams = <QueryParam>[];
  1200. final headerParams = <String, String>{};
  1201. final formParams = <String, String>{};
  1202. const contentTypes = <String>['application/json'];
  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. /// * [AssetJobsDto] assetJobsDto (required):
  1216. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1217. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1218. if (response.statusCode >= HttpStatus.badRequest) {
  1219. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1220. }
  1221. }
  1222. /// Performs an HTTP 'GET /assets' operation and returns the [Response].
  1223. /// Parameters:
  1224. ///
  1225. /// * [String] id:
  1226. ///
  1227. /// * [String] libraryId:
  1228. ///
  1229. /// * [AssetTypeEnum] type:
  1230. ///
  1231. /// * [AssetOrder] order:
  1232. ///
  1233. /// * [String] deviceAssetId:
  1234. ///
  1235. /// * [String] deviceId:
  1236. ///
  1237. /// * [String] checksum:
  1238. ///
  1239. /// * [bool] isArchived:
  1240. ///
  1241. /// * [bool] isEncoded:
  1242. ///
  1243. /// * [bool] isExternal:
  1244. ///
  1245. /// * [bool] isFavorite:
  1246. ///
  1247. /// * [bool] isMotion:
  1248. ///
  1249. /// * [bool] isOffline:
  1250. ///
  1251. /// * [bool] isReadOnly:
  1252. ///
  1253. /// * [bool] isVisible:
  1254. ///
  1255. /// * [bool] withDeleted:
  1256. ///
  1257. /// * [bool] withStacked:
  1258. ///
  1259. /// * [bool] withExif:
  1260. ///
  1261. /// * [bool] withPeople:
  1262. ///
  1263. /// * [DateTime] createdBefore:
  1264. ///
  1265. /// * [DateTime] createdAfter:
  1266. ///
  1267. /// * [DateTime] updatedBefore:
  1268. ///
  1269. /// * [DateTime] updatedAfter:
  1270. ///
  1271. /// * [DateTime] trashedBefore:
  1272. ///
  1273. /// * [DateTime] trashedAfter:
  1274. ///
  1275. /// * [DateTime] takenBefore:
  1276. ///
  1277. /// * [DateTime] takenAfter:
  1278. ///
  1279. /// * [String] originalFileName:
  1280. ///
  1281. /// * [String] originalPath:
  1282. ///
  1283. /// * [String] resizePath:
  1284. ///
  1285. /// * [String] webpPath:
  1286. ///
  1287. /// * [String] encodedVideoPath:
  1288. ///
  1289. /// * [String] city:
  1290. ///
  1291. /// * [String] state:
  1292. ///
  1293. /// * [String] country:
  1294. ///
  1295. /// * [String] make:
  1296. ///
  1297. /// * [String] model:
  1298. ///
  1299. /// * [String] lensModel:
  1300. ///
  1301. /// * [num] page:
  1302. ///
  1303. /// * [num] size:
  1304. 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 {
  1305. // ignore: prefer_const_declarations
  1306. final path = r'/assets';
  1307. // ignore: prefer_final_locals
  1308. Object? postBody;
  1309. final queryParams = <QueryParam>[];
  1310. final headerParams = <String, String>{};
  1311. final formParams = <String, String>{};
  1312. if (id != null) {
  1313. queryParams.addAll(_queryParams('', 'id', id));
  1314. }
  1315. if (libraryId != null) {
  1316. queryParams.addAll(_queryParams('', 'libraryId', libraryId));
  1317. }
  1318. if (type != null) {
  1319. queryParams.addAll(_queryParams('', 'type', type));
  1320. }
  1321. if (order != null) {
  1322. queryParams.addAll(_queryParams('', 'order', order));
  1323. }
  1324. if (deviceAssetId != null) {
  1325. queryParams.addAll(_queryParams('', 'deviceAssetId', deviceAssetId));
  1326. }
  1327. if (deviceId != null) {
  1328. queryParams.addAll(_queryParams('', 'deviceId', deviceId));
  1329. }
  1330. if (checksum != null) {
  1331. queryParams.addAll(_queryParams('', 'checksum', checksum));
  1332. }
  1333. if (isArchived != null) {
  1334. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  1335. }
  1336. if (isEncoded != null) {
  1337. queryParams.addAll(_queryParams('', 'isEncoded', isEncoded));
  1338. }
  1339. if (isExternal != null) {
  1340. queryParams.addAll(_queryParams('', 'isExternal', isExternal));
  1341. }
  1342. if (isFavorite != null) {
  1343. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  1344. }
  1345. if (isMotion != null) {
  1346. queryParams.addAll(_queryParams('', 'isMotion', isMotion));
  1347. }
  1348. if (isOffline != null) {
  1349. queryParams.addAll(_queryParams('', 'isOffline', isOffline));
  1350. }
  1351. if (isReadOnly != null) {
  1352. queryParams.addAll(_queryParams('', 'isReadOnly', isReadOnly));
  1353. }
  1354. if (isVisible != null) {
  1355. queryParams.addAll(_queryParams('', 'isVisible', isVisible));
  1356. }
  1357. if (withDeleted != null) {
  1358. queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
  1359. }
  1360. if (withStacked != null) {
  1361. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  1362. }
  1363. if (withExif != null) {
  1364. queryParams.addAll(_queryParams('', 'withExif', withExif));
  1365. }
  1366. if (withPeople != null) {
  1367. queryParams.addAll(_queryParams('', 'withPeople', withPeople));
  1368. }
  1369. if (createdBefore != null) {
  1370. queryParams.addAll(_queryParams('', 'createdBefore', createdBefore));
  1371. }
  1372. if (createdAfter != null) {
  1373. queryParams.addAll(_queryParams('', 'createdAfter', createdAfter));
  1374. }
  1375. if (updatedBefore != null) {
  1376. queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
  1377. }
  1378. if (updatedAfter != null) {
  1379. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  1380. }
  1381. if (trashedBefore != null) {
  1382. queryParams.addAll(_queryParams('', 'trashedBefore', trashedBefore));
  1383. }
  1384. if (trashedAfter != null) {
  1385. queryParams.addAll(_queryParams('', 'trashedAfter', trashedAfter));
  1386. }
  1387. if (takenBefore != null) {
  1388. queryParams.addAll(_queryParams('', 'takenBefore', takenBefore));
  1389. }
  1390. if (takenAfter != null) {
  1391. queryParams.addAll(_queryParams('', 'takenAfter', takenAfter));
  1392. }
  1393. if (originalFileName != null) {
  1394. queryParams.addAll(_queryParams('', 'originalFileName', originalFileName));
  1395. }
  1396. if (originalPath != null) {
  1397. queryParams.addAll(_queryParams('', 'originalPath', originalPath));
  1398. }
  1399. if (resizePath != null) {
  1400. queryParams.addAll(_queryParams('', 'resizePath', resizePath));
  1401. }
  1402. if (webpPath != null) {
  1403. queryParams.addAll(_queryParams('', 'webpPath', webpPath));
  1404. }
  1405. if (encodedVideoPath != null) {
  1406. queryParams.addAll(_queryParams('', 'encodedVideoPath', encodedVideoPath));
  1407. }
  1408. if (city != null) {
  1409. queryParams.addAll(_queryParams('', 'city', city));
  1410. }
  1411. if (state != null) {
  1412. queryParams.addAll(_queryParams('', 'state', state));
  1413. }
  1414. if (country != null) {
  1415. queryParams.addAll(_queryParams('', 'country', country));
  1416. }
  1417. if (make != null) {
  1418. queryParams.addAll(_queryParams('', 'make', make));
  1419. }
  1420. if (model != null) {
  1421. queryParams.addAll(_queryParams('', 'model', model));
  1422. }
  1423. if (lensModel != null) {
  1424. queryParams.addAll(_queryParams('', 'lensModel', lensModel));
  1425. }
  1426. if (page != null) {
  1427. queryParams.addAll(_queryParams('', 'page', page));
  1428. }
  1429. if (size != null) {
  1430. queryParams.addAll(_queryParams('', 'size', size));
  1431. }
  1432. const contentTypes = <String>[];
  1433. return apiClient.invokeAPI(
  1434. path,
  1435. 'GET',
  1436. queryParams,
  1437. postBody,
  1438. headerParams,
  1439. formParams,
  1440. contentTypes.isEmpty ? null : contentTypes.first,
  1441. );
  1442. }
  1443. /// Parameters:
  1444. ///
  1445. /// * [String] id:
  1446. ///
  1447. /// * [String] libraryId:
  1448. ///
  1449. /// * [AssetTypeEnum] type:
  1450. ///
  1451. /// * [AssetOrder] order:
  1452. ///
  1453. /// * [String] deviceAssetId:
  1454. ///
  1455. /// * [String] deviceId:
  1456. ///
  1457. /// * [String] checksum:
  1458. ///
  1459. /// * [bool] isArchived:
  1460. ///
  1461. /// * [bool] isEncoded:
  1462. ///
  1463. /// * [bool] isExternal:
  1464. ///
  1465. /// * [bool] isFavorite:
  1466. ///
  1467. /// * [bool] isMotion:
  1468. ///
  1469. /// * [bool] isOffline:
  1470. ///
  1471. /// * [bool] isReadOnly:
  1472. ///
  1473. /// * [bool] isVisible:
  1474. ///
  1475. /// * [bool] withDeleted:
  1476. ///
  1477. /// * [bool] withStacked:
  1478. ///
  1479. /// * [bool] withExif:
  1480. ///
  1481. /// * [bool] withPeople:
  1482. ///
  1483. /// * [DateTime] createdBefore:
  1484. ///
  1485. /// * [DateTime] createdAfter:
  1486. ///
  1487. /// * [DateTime] updatedBefore:
  1488. ///
  1489. /// * [DateTime] updatedAfter:
  1490. ///
  1491. /// * [DateTime] trashedBefore:
  1492. ///
  1493. /// * [DateTime] trashedAfter:
  1494. ///
  1495. /// * [DateTime] takenBefore:
  1496. ///
  1497. /// * [DateTime] takenAfter:
  1498. ///
  1499. /// * [String] originalFileName:
  1500. ///
  1501. /// * [String] originalPath:
  1502. ///
  1503. /// * [String] resizePath:
  1504. ///
  1505. /// * [String] webpPath:
  1506. ///
  1507. /// * [String] encodedVideoPath:
  1508. ///
  1509. /// * [String] city:
  1510. ///
  1511. /// * [String] state:
  1512. ///
  1513. /// * [String] country:
  1514. ///
  1515. /// * [String] make:
  1516. ///
  1517. /// * [String] model:
  1518. ///
  1519. /// * [String] lensModel:
  1520. ///
  1521. /// * [num] page:
  1522. ///
  1523. /// * [num] size:
  1524. 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 {
  1525. 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, );
  1526. if (response.statusCode >= HttpStatus.badRequest) {
  1527. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1528. }
  1529. // When a remote server returns no body with a status of 204, we shall not decode it.
  1530. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1531. // FormatException when trying to decode an empty string.
  1532. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1533. final responseBody = await _decodeBodyBytes(response);
  1534. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1535. .cast<AssetResponseDto>()
  1536. .toList();
  1537. }
  1538. return null;
  1539. }
  1540. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1541. /// Parameters:
  1542. ///
  1543. /// * [String] id (required):
  1544. ///
  1545. /// * [bool] isThumb:
  1546. ///
  1547. /// * [bool] isWeb:
  1548. ///
  1549. /// * [String] key:
  1550. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1551. // ignore: prefer_const_declarations
  1552. final path = r'/asset/file/{id}'
  1553. .replaceAll('{id}', id);
  1554. // ignore: prefer_final_locals
  1555. Object? postBody;
  1556. final queryParams = <QueryParam>[];
  1557. final headerParams = <String, String>{};
  1558. final formParams = <String, String>{};
  1559. if (isThumb != null) {
  1560. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1561. }
  1562. if (isWeb != null) {
  1563. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1564. }
  1565. if (key != null) {
  1566. queryParams.addAll(_queryParams('', 'key', key));
  1567. }
  1568. const contentTypes = <String>[];
  1569. return apiClient.invokeAPI(
  1570. path,
  1571. 'GET',
  1572. queryParams,
  1573. postBody,
  1574. headerParams,
  1575. formParams,
  1576. contentTypes.isEmpty ? null : contentTypes.first,
  1577. );
  1578. }
  1579. /// Parameters:
  1580. ///
  1581. /// * [String] id (required):
  1582. ///
  1583. /// * [bool] isThumb:
  1584. ///
  1585. /// * [bool] isWeb:
  1586. ///
  1587. /// * [String] key:
  1588. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1589. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1590. if (response.statusCode >= HttpStatus.badRequest) {
  1591. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1592. }
  1593. // When a remote server returns no body with a status of 204, we shall not decode it.
  1594. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1595. // FormatException when trying to decode an empty string.
  1596. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1597. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1598. }
  1599. return null;
  1600. }
  1601. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1602. /// Parameters:
  1603. ///
  1604. /// * [String] id (required):
  1605. ///
  1606. /// * [UpdateAssetDto] updateAssetDto (required):
  1607. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1608. // ignore: prefer_const_declarations
  1609. final path = r'/asset/{id}'
  1610. .replaceAll('{id}', id);
  1611. // ignore: prefer_final_locals
  1612. Object? postBody = updateAssetDto;
  1613. final queryParams = <QueryParam>[];
  1614. final headerParams = <String, String>{};
  1615. final formParams = <String, String>{};
  1616. const contentTypes = <String>['application/json'];
  1617. return apiClient.invokeAPI(
  1618. path,
  1619. 'PUT',
  1620. queryParams,
  1621. postBody,
  1622. headerParams,
  1623. formParams,
  1624. contentTypes.isEmpty ? null : contentTypes.first,
  1625. );
  1626. }
  1627. /// Parameters:
  1628. ///
  1629. /// * [String] id (required):
  1630. ///
  1631. /// * [UpdateAssetDto] updateAssetDto (required):
  1632. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1633. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1634. if (response.statusCode >= HttpStatus.badRequest) {
  1635. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1636. }
  1637. // When a remote server returns no body with a status of 204, we shall not decode it.
  1638. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1639. // FormatException when trying to decode an empty string.
  1640. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1641. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1642. }
  1643. return null;
  1644. }
  1645. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1646. /// Parameters:
  1647. ///
  1648. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1649. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1650. // ignore: prefer_const_declarations
  1651. final path = r'/asset';
  1652. // ignore: prefer_final_locals
  1653. Object? postBody = assetBulkUpdateDto;
  1654. final queryParams = <QueryParam>[];
  1655. final headerParams = <String, String>{};
  1656. final formParams = <String, String>{};
  1657. const contentTypes = <String>['application/json'];
  1658. return apiClient.invokeAPI(
  1659. path,
  1660. 'PUT',
  1661. queryParams,
  1662. postBody,
  1663. headerParams,
  1664. formParams,
  1665. contentTypes.isEmpty ? null : contentTypes.first,
  1666. );
  1667. }
  1668. /// Parameters:
  1669. ///
  1670. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1671. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1672. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1673. if (response.statusCode >= HttpStatus.badRequest) {
  1674. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1675. }
  1676. }
  1677. /// Performs an HTTP 'PUT /asset/stack/parent' operation and returns the [Response].
  1678. /// Parameters:
  1679. ///
  1680. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1681. Future<Response> updateStackParentWithHttpInfo(UpdateStackParentDto updateStackParentDto,) async {
  1682. // ignore: prefer_const_declarations
  1683. final path = r'/asset/stack/parent';
  1684. // ignore: prefer_final_locals
  1685. Object? postBody = updateStackParentDto;
  1686. final queryParams = <QueryParam>[];
  1687. final headerParams = <String, String>{};
  1688. final formParams = <String, String>{};
  1689. const contentTypes = <String>['application/json'];
  1690. return apiClient.invokeAPI(
  1691. path,
  1692. 'PUT',
  1693. queryParams,
  1694. postBody,
  1695. headerParams,
  1696. formParams,
  1697. contentTypes.isEmpty ? null : contentTypes.first,
  1698. );
  1699. }
  1700. /// Parameters:
  1701. ///
  1702. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1703. Future<void> updateStackParent(UpdateStackParentDto updateStackParentDto,) async {
  1704. final response = await updateStackParentWithHttpInfo(updateStackParentDto,);
  1705. if (response.statusCode >= HttpStatus.badRequest) {
  1706. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1707. }
  1708. }
  1709. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1710. /// Parameters:
  1711. ///
  1712. /// * [MultipartFile] assetData (required):
  1713. ///
  1714. /// * [String] deviceAssetId (required):
  1715. ///
  1716. /// * [String] deviceId (required):
  1717. ///
  1718. /// * [DateTime] fileCreatedAt (required):
  1719. ///
  1720. /// * [DateTime] fileModifiedAt (required):
  1721. ///
  1722. /// * [String] key:
  1723. ///
  1724. /// * [String] duration:
  1725. ///
  1726. /// * [bool] isArchived:
  1727. ///
  1728. /// * [bool] isExternal:
  1729. ///
  1730. /// * [bool] isFavorite:
  1731. ///
  1732. /// * [bool] isOffline:
  1733. ///
  1734. /// * [bool] isReadOnly:
  1735. ///
  1736. /// * [bool] isVisible:
  1737. ///
  1738. /// * [String] libraryId:
  1739. ///
  1740. /// * [MultipartFile] livePhotoData:
  1741. ///
  1742. /// * [MultipartFile] sidecarData:
  1743. 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 {
  1744. // ignore: prefer_const_declarations
  1745. final path = r'/asset/upload';
  1746. // ignore: prefer_final_locals
  1747. Object? postBody;
  1748. final queryParams = <QueryParam>[];
  1749. final headerParams = <String, String>{};
  1750. final formParams = <String, String>{};
  1751. if (key != null) {
  1752. queryParams.addAll(_queryParams('', 'key', key));
  1753. }
  1754. const contentTypes = <String>['multipart/form-data'];
  1755. bool hasFields = false;
  1756. final mp = MultipartRequest('POST', Uri.parse(path));
  1757. if (assetData != null) {
  1758. hasFields = true;
  1759. mp.fields[r'assetData'] = assetData.field;
  1760. mp.files.add(assetData);
  1761. }
  1762. if (deviceAssetId != null) {
  1763. hasFields = true;
  1764. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1765. }
  1766. if (deviceId != null) {
  1767. hasFields = true;
  1768. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1769. }
  1770. if (duration != null) {
  1771. hasFields = true;
  1772. mp.fields[r'duration'] = parameterToString(duration);
  1773. }
  1774. if (fileCreatedAt != null) {
  1775. hasFields = true;
  1776. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1777. }
  1778. if (fileModifiedAt != null) {
  1779. hasFields = true;
  1780. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1781. }
  1782. if (isArchived != null) {
  1783. hasFields = true;
  1784. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1785. }
  1786. if (isExternal != null) {
  1787. hasFields = true;
  1788. mp.fields[r'isExternal'] = parameterToString(isExternal);
  1789. }
  1790. if (isFavorite != null) {
  1791. hasFields = true;
  1792. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1793. }
  1794. if (isOffline != null) {
  1795. hasFields = true;
  1796. mp.fields[r'isOffline'] = parameterToString(isOffline);
  1797. }
  1798. if (isReadOnly != null) {
  1799. hasFields = true;
  1800. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1801. }
  1802. if (isVisible != null) {
  1803. hasFields = true;
  1804. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1805. }
  1806. if (libraryId != null) {
  1807. hasFields = true;
  1808. mp.fields[r'libraryId'] = parameterToString(libraryId);
  1809. }
  1810. if (livePhotoData != null) {
  1811. hasFields = true;
  1812. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1813. mp.files.add(livePhotoData);
  1814. }
  1815. if (sidecarData != null) {
  1816. hasFields = true;
  1817. mp.fields[r'sidecarData'] = sidecarData.field;
  1818. mp.files.add(sidecarData);
  1819. }
  1820. if (hasFields) {
  1821. postBody = mp;
  1822. }
  1823. return apiClient.invokeAPI(
  1824. path,
  1825. 'POST',
  1826. queryParams,
  1827. postBody,
  1828. headerParams,
  1829. formParams,
  1830. contentTypes.isEmpty ? null : contentTypes.first,
  1831. );
  1832. }
  1833. /// Parameters:
  1834. ///
  1835. /// * [MultipartFile] assetData (required):
  1836. ///
  1837. /// * [String] deviceAssetId (required):
  1838. ///
  1839. /// * [String] deviceId (required):
  1840. ///
  1841. /// * [DateTime] fileCreatedAt (required):
  1842. ///
  1843. /// * [DateTime] fileModifiedAt (required):
  1844. ///
  1845. /// * [String] key:
  1846. ///
  1847. /// * [String] duration:
  1848. ///
  1849. /// * [bool] isArchived:
  1850. ///
  1851. /// * [bool] isExternal:
  1852. ///
  1853. /// * [bool] isFavorite:
  1854. ///
  1855. /// * [bool] isOffline:
  1856. ///
  1857. /// * [bool] isReadOnly:
  1858. ///
  1859. /// * [bool] isVisible:
  1860. ///
  1861. /// * [String] libraryId:
  1862. ///
  1863. /// * [MultipartFile] livePhotoData:
  1864. ///
  1865. /// * [MultipartFile] sidecarData:
  1866. 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 {
  1867. 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, );
  1868. if (response.statusCode >= HttpStatus.badRequest) {
  1869. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1870. }
  1871. // When a remote server returns no body with a status of 204, we shall not decode it.
  1872. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1873. // FormatException when trying to decode an empty string.
  1874. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1875. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1876. }
  1877. return null;
  1878. }
  1879. }