asset_api.dart 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183
  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 'POST /asset/search' operation and returns the [Response].
  1223. /// Parameters:
  1224. ///
  1225. /// * [SearchAssetDto] searchAssetDto (required):
  1226. Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
  1227. // ignore: prefer_const_declarations
  1228. final path = r'/asset/search';
  1229. // ignore: prefer_final_locals
  1230. Object? postBody = searchAssetDto;
  1231. final queryParams = <QueryParam>[];
  1232. final headerParams = <String, String>{};
  1233. final formParams = <String, String>{};
  1234. const contentTypes = <String>['application/json'];
  1235. return apiClient.invokeAPI(
  1236. path,
  1237. 'POST',
  1238. queryParams,
  1239. postBody,
  1240. headerParams,
  1241. formParams,
  1242. contentTypes.isEmpty ? null : contentTypes.first,
  1243. );
  1244. }
  1245. /// Parameters:
  1246. ///
  1247. /// * [SearchAssetDto] searchAssetDto (required):
  1248. Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
  1249. final response = await searchAssetWithHttpInfo(searchAssetDto,);
  1250. if (response.statusCode >= HttpStatus.badRequest) {
  1251. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1252. }
  1253. // When a remote server returns no body with a status of 204, we shall not decode it.
  1254. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1255. // FormatException when trying to decode an empty string.
  1256. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1257. final responseBody = await _decodeBodyBytes(response);
  1258. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1259. .cast<AssetResponseDto>()
  1260. .toList();
  1261. }
  1262. return null;
  1263. }
  1264. /// Performs an HTTP 'GET /assets' operation and returns the [Response].
  1265. /// Parameters:
  1266. ///
  1267. /// * [String] id:
  1268. ///
  1269. /// * [String] libraryId:
  1270. ///
  1271. /// * [AssetTypeEnum] type:
  1272. ///
  1273. /// * [AssetOrder] order:
  1274. ///
  1275. /// * [String] deviceAssetId:
  1276. ///
  1277. /// * [String] deviceId:
  1278. ///
  1279. /// * [String] checksum:
  1280. ///
  1281. /// * [bool] isArchived:
  1282. ///
  1283. /// * [bool] isEncoded:
  1284. ///
  1285. /// * [bool] isExternal:
  1286. ///
  1287. /// * [bool] isFavorite:
  1288. ///
  1289. /// * [bool] isMotion:
  1290. ///
  1291. /// * [bool] isOffline:
  1292. ///
  1293. /// * [bool] isReadOnly:
  1294. ///
  1295. /// * [bool] isVisible:
  1296. ///
  1297. /// * [bool] withDeleted:
  1298. ///
  1299. /// * [bool] withStacked:
  1300. ///
  1301. /// * [bool] withExif:
  1302. ///
  1303. /// * [bool] withPeople:
  1304. ///
  1305. /// * [DateTime] createdBefore:
  1306. ///
  1307. /// * [DateTime] createdAfter:
  1308. ///
  1309. /// * [DateTime] updatedBefore:
  1310. ///
  1311. /// * [DateTime] updatedAfter:
  1312. ///
  1313. /// * [DateTime] trashedBefore:
  1314. ///
  1315. /// * [DateTime] trashedAfter:
  1316. ///
  1317. /// * [DateTime] takenBefore:
  1318. ///
  1319. /// * [DateTime] takenAfter:
  1320. ///
  1321. /// * [String] originalFileName:
  1322. ///
  1323. /// * [String] originalPath:
  1324. ///
  1325. /// * [String] resizePath:
  1326. ///
  1327. /// * [String] webpPath:
  1328. ///
  1329. /// * [String] encodedVideoPath:
  1330. ///
  1331. /// * [String] city:
  1332. ///
  1333. /// * [String] state:
  1334. ///
  1335. /// * [String] country:
  1336. ///
  1337. /// * [String] make:
  1338. ///
  1339. /// * [String] model:
  1340. ///
  1341. /// * [String] lensModel:
  1342. ///
  1343. /// * [num] page:
  1344. ///
  1345. /// * [num] size:
  1346. 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 {
  1347. // ignore: prefer_const_declarations
  1348. final path = r'/assets';
  1349. // ignore: prefer_final_locals
  1350. Object? postBody;
  1351. final queryParams = <QueryParam>[];
  1352. final headerParams = <String, String>{};
  1353. final formParams = <String, String>{};
  1354. if (id != null) {
  1355. queryParams.addAll(_queryParams('', 'id', id));
  1356. }
  1357. if (libraryId != null) {
  1358. queryParams.addAll(_queryParams('', 'libraryId', libraryId));
  1359. }
  1360. if (type != null) {
  1361. queryParams.addAll(_queryParams('', 'type', type));
  1362. }
  1363. if (order != null) {
  1364. queryParams.addAll(_queryParams('', 'order', order));
  1365. }
  1366. if (deviceAssetId != null) {
  1367. queryParams.addAll(_queryParams('', 'deviceAssetId', deviceAssetId));
  1368. }
  1369. if (deviceId != null) {
  1370. queryParams.addAll(_queryParams('', 'deviceId', deviceId));
  1371. }
  1372. if (checksum != null) {
  1373. queryParams.addAll(_queryParams('', 'checksum', checksum));
  1374. }
  1375. if (isArchived != null) {
  1376. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  1377. }
  1378. if (isEncoded != null) {
  1379. queryParams.addAll(_queryParams('', 'isEncoded', isEncoded));
  1380. }
  1381. if (isExternal != null) {
  1382. queryParams.addAll(_queryParams('', 'isExternal', isExternal));
  1383. }
  1384. if (isFavorite != null) {
  1385. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  1386. }
  1387. if (isMotion != null) {
  1388. queryParams.addAll(_queryParams('', 'isMotion', isMotion));
  1389. }
  1390. if (isOffline != null) {
  1391. queryParams.addAll(_queryParams('', 'isOffline', isOffline));
  1392. }
  1393. if (isReadOnly != null) {
  1394. queryParams.addAll(_queryParams('', 'isReadOnly', isReadOnly));
  1395. }
  1396. if (isVisible != null) {
  1397. queryParams.addAll(_queryParams('', 'isVisible', isVisible));
  1398. }
  1399. if (withDeleted != null) {
  1400. queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
  1401. }
  1402. if (withStacked != null) {
  1403. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  1404. }
  1405. if (withExif != null) {
  1406. queryParams.addAll(_queryParams('', 'withExif', withExif));
  1407. }
  1408. if (withPeople != null) {
  1409. queryParams.addAll(_queryParams('', 'withPeople', withPeople));
  1410. }
  1411. if (createdBefore != null) {
  1412. queryParams.addAll(_queryParams('', 'createdBefore', createdBefore));
  1413. }
  1414. if (createdAfter != null) {
  1415. queryParams.addAll(_queryParams('', 'createdAfter', createdAfter));
  1416. }
  1417. if (updatedBefore != null) {
  1418. queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
  1419. }
  1420. if (updatedAfter != null) {
  1421. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  1422. }
  1423. if (trashedBefore != null) {
  1424. queryParams.addAll(_queryParams('', 'trashedBefore', trashedBefore));
  1425. }
  1426. if (trashedAfter != null) {
  1427. queryParams.addAll(_queryParams('', 'trashedAfter', trashedAfter));
  1428. }
  1429. if (takenBefore != null) {
  1430. queryParams.addAll(_queryParams('', 'takenBefore', takenBefore));
  1431. }
  1432. if (takenAfter != null) {
  1433. queryParams.addAll(_queryParams('', 'takenAfter', takenAfter));
  1434. }
  1435. if (originalFileName != null) {
  1436. queryParams.addAll(_queryParams('', 'originalFileName', originalFileName));
  1437. }
  1438. if (originalPath != null) {
  1439. queryParams.addAll(_queryParams('', 'originalPath', originalPath));
  1440. }
  1441. if (resizePath != null) {
  1442. queryParams.addAll(_queryParams('', 'resizePath', resizePath));
  1443. }
  1444. if (webpPath != null) {
  1445. queryParams.addAll(_queryParams('', 'webpPath', webpPath));
  1446. }
  1447. if (encodedVideoPath != null) {
  1448. queryParams.addAll(_queryParams('', 'encodedVideoPath', encodedVideoPath));
  1449. }
  1450. if (city != null) {
  1451. queryParams.addAll(_queryParams('', 'city', city));
  1452. }
  1453. if (state != null) {
  1454. queryParams.addAll(_queryParams('', 'state', state));
  1455. }
  1456. if (country != null) {
  1457. queryParams.addAll(_queryParams('', 'country', country));
  1458. }
  1459. if (make != null) {
  1460. queryParams.addAll(_queryParams('', 'make', make));
  1461. }
  1462. if (model != null) {
  1463. queryParams.addAll(_queryParams('', 'model', model));
  1464. }
  1465. if (lensModel != null) {
  1466. queryParams.addAll(_queryParams('', 'lensModel', lensModel));
  1467. }
  1468. if (page != null) {
  1469. queryParams.addAll(_queryParams('', 'page', page));
  1470. }
  1471. if (size != null) {
  1472. queryParams.addAll(_queryParams('', 'size', size));
  1473. }
  1474. const contentTypes = <String>[];
  1475. return apiClient.invokeAPI(
  1476. path,
  1477. 'GET',
  1478. queryParams,
  1479. postBody,
  1480. headerParams,
  1481. formParams,
  1482. contentTypes.isEmpty ? null : contentTypes.first,
  1483. );
  1484. }
  1485. /// Parameters:
  1486. ///
  1487. /// * [String] id:
  1488. ///
  1489. /// * [String] libraryId:
  1490. ///
  1491. /// * [AssetTypeEnum] type:
  1492. ///
  1493. /// * [AssetOrder] order:
  1494. ///
  1495. /// * [String] deviceAssetId:
  1496. ///
  1497. /// * [String] deviceId:
  1498. ///
  1499. /// * [String] checksum:
  1500. ///
  1501. /// * [bool] isArchived:
  1502. ///
  1503. /// * [bool] isEncoded:
  1504. ///
  1505. /// * [bool] isExternal:
  1506. ///
  1507. /// * [bool] isFavorite:
  1508. ///
  1509. /// * [bool] isMotion:
  1510. ///
  1511. /// * [bool] isOffline:
  1512. ///
  1513. /// * [bool] isReadOnly:
  1514. ///
  1515. /// * [bool] isVisible:
  1516. ///
  1517. /// * [bool] withDeleted:
  1518. ///
  1519. /// * [bool] withStacked:
  1520. ///
  1521. /// * [bool] withExif:
  1522. ///
  1523. /// * [bool] withPeople:
  1524. ///
  1525. /// * [DateTime] createdBefore:
  1526. ///
  1527. /// * [DateTime] createdAfter:
  1528. ///
  1529. /// * [DateTime] updatedBefore:
  1530. ///
  1531. /// * [DateTime] updatedAfter:
  1532. ///
  1533. /// * [DateTime] trashedBefore:
  1534. ///
  1535. /// * [DateTime] trashedAfter:
  1536. ///
  1537. /// * [DateTime] takenBefore:
  1538. ///
  1539. /// * [DateTime] takenAfter:
  1540. ///
  1541. /// * [String] originalFileName:
  1542. ///
  1543. /// * [String] originalPath:
  1544. ///
  1545. /// * [String] resizePath:
  1546. ///
  1547. /// * [String] webpPath:
  1548. ///
  1549. /// * [String] encodedVideoPath:
  1550. ///
  1551. /// * [String] city:
  1552. ///
  1553. /// * [String] state:
  1554. ///
  1555. /// * [String] country:
  1556. ///
  1557. /// * [String] make:
  1558. ///
  1559. /// * [String] model:
  1560. ///
  1561. /// * [String] lensModel:
  1562. ///
  1563. /// * [num] page:
  1564. ///
  1565. /// * [num] size:
  1566. 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 {
  1567. 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, );
  1568. if (response.statusCode >= HttpStatus.badRequest) {
  1569. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1570. }
  1571. // When a remote server returns no body with a status of 204, we shall not decode it.
  1572. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1573. // FormatException when trying to decode an empty string.
  1574. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1575. final responseBody = await _decodeBodyBytes(response);
  1576. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1577. .cast<AssetResponseDto>()
  1578. .toList();
  1579. }
  1580. return null;
  1581. }
  1582. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1583. /// Parameters:
  1584. ///
  1585. /// * [String] id (required):
  1586. ///
  1587. /// * [bool] isThumb:
  1588. ///
  1589. /// * [bool] isWeb:
  1590. ///
  1591. /// * [String] key:
  1592. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1593. // ignore: prefer_const_declarations
  1594. final path = r'/asset/file/{id}'
  1595. .replaceAll('{id}', id);
  1596. // ignore: prefer_final_locals
  1597. Object? postBody;
  1598. final queryParams = <QueryParam>[];
  1599. final headerParams = <String, String>{};
  1600. final formParams = <String, String>{};
  1601. if (isThumb != null) {
  1602. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1603. }
  1604. if (isWeb != null) {
  1605. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1606. }
  1607. if (key != null) {
  1608. queryParams.addAll(_queryParams('', 'key', key));
  1609. }
  1610. const contentTypes = <String>[];
  1611. return apiClient.invokeAPI(
  1612. path,
  1613. 'GET',
  1614. queryParams,
  1615. postBody,
  1616. headerParams,
  1617. formParams,
  1618. contentTypes.isEmpty ? null : contentTypes.first,
  1619. );
  1620. }
  1621. /// Parameters:
  1622. ///
  1623. /// * [String] id (required):
  1624. ///
  1625. /// * [bool] isThumb:
  1626. ///
  1627. /// * [bool] isWeb:
  1628. ///
  1629. /// * [String] key:
  1630. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1631. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1632. if (response.statusCode >= HttpStatus.badRequest) {
  1633. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1634. }
  1635. // When a remote server returns no body with a status of 204, we shall not decode it.
  1636. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1637. // FormatException when trying to decode an empty string.
  1638. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1639. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1640. }
  1641. return null;
  1642. }
  1643. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1644. /// Parameters:
  1645. ///
  1646. /// * [String] id (required):
  1647. ///
  1648. /// * [UpdateAssetDto] updateAssetDto (required):
  1649. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1650. // ignore: prefer_const_declarations
  1651. final path = r'/asset/{id}'
  1652. .replaceAll('{id}', id);
  1653. // ignore: prefer_final_locals
  1654. Object? postBody = updateAssetDto;
  1655. final queryParams = <QueryParam>[];
  1656. final headerParams = <String, String>{};
  1657. final formParams = <String, String>{};
  1658. const contentTypes = <String>['application/json'];
  1659. return apiClient.invokeAPI(
  1660. path,
  1661. 'PUT',
  1662. queryParams,
  1663. postBody,
  1664. headerParams,
  1665. formParams,
  1666. contentTypes.isEmpty ? null : contentTypes.first,
  1667. );
  1668. }
  1669. /// Parameters:
  1670. ///
  1671. /// * [String] id (required):
  1672. ///
  1673. /// * [UpdateAssetDto] updateAssetDto (required):
  1674. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1675. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1676. if (response.statusCode >= HttpStatus.badRequest) {
  1677. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1678. }
  1679. // When a remote server returns no body with a status of 204, we shall not decode it.
  1680. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1681. // FormatException when trying to decode an empty string.
  1682. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1683. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1684. }
  1685. return null;
  1686. }
  1687. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1688. /// Parameters:
  1689. ///
  1690. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1691. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1692. // ignore: prefer_const_declarations
  1693. final path = r'/asset';
  1694. // ignore: prefer_final_locals
  1695. Object? postBody = assetBulkUpdateDto;
  1696. final queryParams = <QueryParam>[];
  1697. final headerParams = <String, String>{};
  1698. final formParams = <String, String>{};
  1699. const contentTypes = <String>['application/json'];
  1700. return apiClient.invokeAPI(
  1701. path,
  1702. 'PUT',
  1703. queryParams,
  1704. postBody,
  1705. headerParams,
  1706. formParams,
  1707. contentTypes.isEmpty ? null : contentTypes.first,
  1708. );
  1709. }
  1710. /// Parameters:
  1711. ///
  1712. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1713. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1714. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1715. if (response.statusCode >= HttpStatus.badRequest) {
  1716. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1717. }
  1718. }
  1719. /// Performs an HTTP 'PUT /asset/stack/parent' operation and returns the [Response].
  1720. /// Parameters:
  1721. ///
  1722. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1723. Future<Response> updateStackParentWithHttpInfo(UpdateStackParentDto updateStackParentDto,) async {
  1724. // ignore: prefer_const_declarations
  1725. final path = r'/asset/stack/parent';
  1726. // ignore: prefer_final_locals
  1727. Object? postBody = updateStackParentDto;
  1728. final queryParams = <QueryParam>[];
  1729. final headerParams = <String, String>{};
  1730. final formParams = <String, String>{};
  1731. const contentTypes = <String>['application/json'];
  1732. return apiClient.invokeAPI(
  1733. path,
  1734. 'PUT',
  1735. queryParams,
  1736. postBody,
  1737. headerParams,
  1738. formParams,
  1739. contentTypes.isEmpty ? null : contentTypes.first,
  1740. );
  1741. }
  1742. /// Parameters:
  1743. ///
  1744. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1745. Future<void> updateStackParent(UpdateStackParentDto updateStackParentDto,) async {
  1746. final response = await updateStackParentWithHttpInfo(updateStackParentDto,);
  1747. if (response.statusCode >= HttpStatus.badRequest) {
  1748. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1749. }
  1750. }
  1751. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1752. /// Parameters:
  1753. ///
  1754. /// * [MultipartFile] assetData (required):
  1755. ///
  1756. /// * [String] deviceAssetId (required):
  1757. ///
  1758. /// * [String] deviceId (required):
  1759. ///
  1760. /// * [DateTime] fileCreatedAt (required):
  1761. ///
  1762. /// * [DateTime] fileModifiedAt (required):
  1763. ///
  1764. /// * [String] key:
  1765. ///
  1766. /// * [String] duration:
  1767. ///
  1768. /// * [bool] isArchived:
  1769. ///
  1770. /// * [bool] isExternal:
  1771. ///
  1772. /// * [bool] isFavorite:
  1773. ///
  1774. /// * [bool] isOffline:
  1775. ///
  1776. /// * [bool] isReadOnly:
  1777. ///
  1778. /// * [bool] isVisible:
  1779. ///
  1780. /// * [String] libraryId:
  1781. ///
  1782. /// * [MultipartFile] livePhotoData:
  1783. ///
  1784. /// * [MultipartFile] sidecarData:
  1785. 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 {
  1786. // ignore: prefer_const_declarations
  1787. final path = r'/asset/upload';
  1788. // ignore: prefer_final_locals
  1789. Object? postBody;
  1790. final queryParams = <QueryParam>[];
  1791. final headerParams = <String, String>{};
  1792. final formParams = <String, String>{};
  1793. if (key != null) {
  1794. queryParams.addAll(_queryParams('', 'key', key));
  1795. }
  1796. const contentTypes = <String>['multipart/form-data'];
  1797. bool hasFields = false;
  1798. final mp = MultipartRequest('POST', Uri.parse(path));
  1799. if (assetData != null) {
  1800. hasFields = true;
  1801. mp.fields[r'assetData'] = assetData.field;
  1802. mp.files.add(assetData);
  1803. }
  1804. if (deviceAssetId != null) {
  1805. hasFields = true;
  1806. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1807. }
  1808. if (deviceId != null) {
  1809. hasFields = true;
  1810. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1811. }
  1812. if (duration != null) {
  1813. hasFields = true;
  1814. mp.fields[r'duration'] = parameterToString(duration);
  1815. }
  1816. if (fileCreatedAt != null) {
  1817. hasFields = true;
  1818. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1819. }
  1820. if (fileModifiedAt != null) {
  1821. hasFields = true;
  1822. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1823. }
  1824. if (isArchived != null) {
  1825. hasFields = true;
  1826. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1827. }
  1828. if (isExternal != null) {
  1829. hasFields = true;
  1830. mp.fields[r'isExternal'] = parameterToString(isExternal);
  1831. }
  1832. if (isFavorite != null) {
  1833. hasFields = true;
  1834. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1835. }
  1836. if (isOffline != null) {
  1837. hasFields = true;
  1838. mp.fields[r'isOffline'] = parameterToString(isOffline);
  1839. }
  1840. if (isReadOnly != null) {
  1841. hasFields = true;
  1842. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1843. }
  1844. if (isVisible != null) {
  1845. hasFields = true;
  1846. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1847. }
  1848. if (libraryId != null) {
  1849. hasFields = true;
  1850. mp.fields[r'libraryId'] = parameterToString(libraryId);
  1851. }
  1852. if (livePhotoData != null) {
  1853. hasFields = true;
  1854. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1855. mp.files.add(livePhotoData);
  1856. }
  1857. if (sidecarData != null) {
  1858. hasFields = true;
  1859. mp.fields[r'sidecarData'] = sidecarData.field;
  1860. mp.files.add(sidecarData);
  1861. }
  1862. if (hasFields) {
  1863. postBody = mp;
  1864. }
  1865. return apiClient.invokeAPI(
  1866. path,
  1867. 'POST',
  1868. queryParams,
  1869. postBody,
  1870. headerParams,
  1871. formParams,
  1872. contentTypes.isEmpty ? null : contentTypes.first,
  1873. );
  1874. }
  1875. /// Parameters:
  1876. ///
  1877. /// * [MultipartFile] assetData (required):
  1878. ///
  1879. /// * [String] deviceAssetId (required):
  1880. ///
  1881. /// * [String] deviceId (required):
  1882. ///
  1883. /// * [DateTime] fileCreatedAt (required):
  1884. ///
  1885. /// * [DateTime] fileModifiedAt (required):
  1886. ///
  1887. /// * [String] key:
  1888. ///
  1889. /// * [String] duration:
  1890. ///
  1891. /// * [bool] isArchived:
  1892. ///
  1893. /// * [bool] isExternal:
  1894. ///
  1895. /// * [bool] isFavorite:
  1896. ///
  1897. /// * [bool] isOffline:
  1898. ///
  1899. /// * [bool] isReadOnly:
  1900. ///
  1901. /// * [bool] isVisible:
  1902. ///
  1903. /// * [String] libraryId:
  1904. ///
  1905. /// * [MultipartFile] livePhotoData:
  1906. ///
  1907. /// * [MultipartFile] sidecarData:
  1908. 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 {
  1909. 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, );
  1910. if (response.statusCode >= HttpStatus.badRequest) {
  1911. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1912. }
  1913. // When a remote server returns no body with a status of 204, we shall not decode it.
  1914. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1915. // FormatException when trying to decode an empty string.
  1916. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1917. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1918. }
  1919. return null;
  1920. }
  1921. }