asset_api.dart 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086
  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/restore' operation and returns the [Response].
  1094. /// Parameters:
  1095. ///
  1096. /// * [BulkIdsDto] bulkIdsDto (required):
  1097. Future<Response> restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
  1098. // ignore: prefer_const_declarations
  1099. final path = r'/asset/restore';
  1100. // ignore: prefer_final_locals
  1101. Object? postBody = bulkIdsDto;
  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. /// * [BulkIdsDto] bulkIdsDto (required):
  1119. Future<void> restoreAssets(BulkIdsDto bulkIdsDto,) async {
  1120. final response = await restoreAssetsWithHttpInfo(bulkIdsDto,);
  1121. if (response.statusCode >= HttpStatus.badRequest) {
  1122. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1123. }
  1124. }
  1125. /// Performs an HTTP 'POST /asset/trash/restore' operation and returns the [Response].
  1126. Future<Response> restoreTrashWithHttpInfo() async {
  1127. // ignore: prefer_const_declarations
  1128. final path = r'/asset/trash/restore';
  1129. // ignore: prefer_final_locals
  1130. Object? postBody;
  1131. final queryParams = <QueryParam>[];
  1132. final headerParams = <String, String>{};
  1133. final formParams = <String, String>{};
  1134. const contentTypes = <String>[];
  1135. return apiClient.invokeAPI(
  1136. path,
  1137. 'POST',
  1138. queryParams,
  1139. postBody,
  1140. headerParams,
  1141. formParams,
  1142. contentTypes.isEmpty ? null : contentTypes.first,
  1143. );
  1144. }
  1145. Future<void> restoreTrash() async {
  1146. final response = await restoreTrashWithHttpInfo();
  1147. if (response.statusCode >= HttpStatus.badRequest) {
  1148. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1149. }
  1150. }
  1151. /// Performs an HTTP 'POST /asset/jobs' operation and returns the [Response].
  1152. /// Parameters:
  1153. ///
  1154. /// * [AssetJobsDto] assetJobsDto (required):
  1155. Future<Response> runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async {
  1156. // ignore: prefer_const_declarations
  1157. final path = r'/asset/jobs';
  1158. // ignore: prefer_final_locals
  1159. Object? postBody = assetJobsDto;
  1160. final queryParams = <QueryParam>[];
  1161. final headerParams = <String, String>{};
  1162. final formParams = <String, String>{};
  1163. const contentTypes = <String>['application/json'];
  1164. return apiClient.invokeAPI(
  1165. path,
  1166. 'POST',
  1167. queryParams,
  1168. postBody,
  1169. headerParams,
  1170. formParams,
  1171. contentTypes.isEmpty ? null : contentTypes.first,
  1172. );
  1173. }
  1174. /// Parameters:
  1175. ///
  1176. /// * [AssetJobsDto] assetJobsDto (required):
  1177. Future<void> runAssetJobs(AssetJobsDto assetJobsDto,) async {
  1178. final response = await runAssetJobsWithHttpInfo(assetJobsDto,);
  1179. if (response.statusCode >= HttpStatus.badRequest) {
  1180. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1181. }
  1182. }
  1183. /// Performs an HTTP 'GET /assets' operation and returns the [Response].
  1184. /// Parameters:
  1185. ///
  1186. /// * [String] id:
  1187. ///
  1188. /// * [String] libraryId:
  1189. ///
  1190. /// * [AssetTypeEnum] type:
  1191. ///
  1192. /// * [AssetOrder] order:
  1193. ///
  1194. /// * [String] deviceAssetId:
  1195. ///
  1196. /// * [String] deviceId:
  1197. ///
  1198. /// * [String] checksum:
  1199. ///
  1200. /// * [bool] isArchived:
  1201. ///
  1202. /// * [bool] isEncoded:
  1203. ///
  1204. /// * [bool] isExternal:
  1205. ///
  1206. /// * [bool] isFavorite:
  1207. ///
  1208. /// * [bool] isMotion:
  1209. ///
  1210. /// * [bool] isOffline:
  1211. ///
  1212. /// * [bool] isReadOnly:
  1213. ///
  1214. /// * [bool] isVisible:
  1215. ///
  1216. /// * [bool] withDeleted:
  1217. ///
  1218. /// * [bool] withStacked:
  1219. ///
  1220. /// * [bool] withExif:
  1221. ///
  1222. /// * [bool] withPeople:
  1223. ///
  1224. /// * [DateTime] createdBefore:
  1225. ///
  1226. /// * [DateTime] createdAfter:
  1227. ///
  1228. /// * [DateTime] updatedBefore:
  1229. ///
  1230. /// * [DateTime] updatedAfter:
  1231. ///
  1232. /// * [DateTime] trashedBefore:
  1233. ///
  1234. /// * [DateTime] trashedAfter:
  1235. ///
  1236. /// * [DateTime] takenBefore:
  1237. ///
  1238. /// * [DateTime] takenAfter:
  1239. ///
  1240. /// * [String] originalFileName:
  1241. ///
  1242. /// * [String] originalPath:
  1243. ///
  1244. /// * [String] resizePath:
  1245. ///
  1246. /// * [String] webpPath:
  1247. ///
  1248. /// * [String] encodedVideoPath:
  1249. ///
  1250. /// * [String] city:
  1251. ///
  1252. /// * [String] state:
  1253. ///
  1254. /// * [String] country:
  1255. ///
  1256. /// * [String] make:
  1257. ///
  1258. /// * [String] model:
  1259. ///
  1260. /// * [String] lensModel:
  1261. ///
  1262. /// * [num] page:
  1263. ///
  1264. /// * [num] size:
  1265. 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 {
  1266. // ignore: prefer_const_declarations
  1267. final path = r'/assets';
  1268. // ignore: prefer_final_locals
  1269. Object? postBody;
  1270. final queryParams = <QueryParam>[];
  1271. final headerParams = <String, String>{};
  1272. final formParams = <String, String>{};
  1273. if (id != null) {
  1274. queryParams.addAll(_queryParams('', 'id', id));
  1275. }
  1276. if (libraryId != null) {
  1277. queryParams.addAll(_queryParams('', 'libraryId', libraryId));
  1278. }
  1279. if (type != null) {
  1280. queryParams.addAll(_queryParams('', 'type', type));
  1281. }
  1282. if (order != null) {
  1283. queryParams.addAll(_queryParams('', 'order', order));
  1284. }
  1285. if (deviceAssetId != null) {
  1286. queryParams.addAll(_queryParams('', 'deviceAssetId', deviceAssetId));
  1287. }
  1288. if (deviceId != null) {
  1289. queryParams.addAll(_queryParams('', 'deviceId', deviceId));
  1290. }
  1291. if (checksum != null) {
  1292. queryParams.addAll(_queryParams('', 'checksum', checksum));
  1293. }
  1294. if (isArchived != null) {
  1295. queryParams.addAll(_queryParams('', 'isArchived', isArchived));
  1296. }
  1297. if (isEncoded != null) {
  1298. queryParams.addAll(_queryParams('', 'isEncoded', isEncoded));
  1299. }
  1300. if (isExternal != null) {
  1301. queryParams.addAll(_queryParams('', 'isExternal', isExternal));
  1302. }
  1303. if (isFavorite != null) {
  1304. queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
  1305. }
  1306. if (isMotion != null) {
  1307. queryParams.addAll(_queryParams('', 'isMotion', isMotion));
  1308. }
  1309. if (isOffline != null) {
  1310. queryParams.addAll(_queryParams('', 'isOffline', isOffline));
  1311. }
  1312. if (isReadOnly != null) {
  1313. queryParams.addAll(_queryParams('', 'isReadOnly', isReadOnly));
  1314. }
  1315. if (isVisible != null) {
  1316. queryParams.addAll(_queryParams('', 'isVisible', isVisible));
  1317. }
  1318. if (withDeleted != null) {
  1319. queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
  1320. }
  1321. if (withStacked != null) {
  1322. queryParams.addAll(_queryParams('', 'withStacked', withStacked));
  1323. }
  1324. if (withExif != null) {
  1325. queryParams.addAll(_queryParams('', 'withExif', withExif));
  1326. }
  1327. if (withPeople != null) {
  1328. queryParams.addAll(_queryParams('', 'withPeople', withPeople));
  1329. }
  1330. if (createdBefore != null) {
  1331. queryParams.addAll(_queryParams('', 'createdBefore', createdBefore));
  1332. }
  1333. if (createdAfter != null) {
  1334. queryParams.addAll(_queryParams('', 'createdAfter', createdAfter));
  1335. }
  1336. if (updatedBefore != null) {
  1337. queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore));
  1338. }
  1339. if (updatedAfter != null) {
  1340. queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter));
  1341. }
  1342. if (trashedBefore != null) {
  1343. queryParams.addAll(_queryParams('', 'trashedBefore', trashedBefore));
  1344. }
  1345. if (trashedAfter != null) {
  1346. queryParams.addAll(_queryParams('', 'trashedAfter', trashedAfter));
  1347. }
  1348. if (takenBefore != null) {
  1349. queryParams.addAll(_queryParams('', 'takenBefore', takenBefore));
  1350. }
  1351. if (takenAfter != null) {
  1352. queryParams.addAll(_queryParams('', 'takenAfter', takenAfter));
  1353. }
  1354. if (originalFileName != null) {
  1355. queryParams.addAll(_queryParams('', 'originalFileName', originalFileName));
  1356. }
  1357. if (originalPath != null) {
  1358. queryParams.addAll(_queryParams('', 'originalPath', originalPath));
  1359. }
  1360. if (resizePath != null) {
  1361. queryParams.addAll(_queryParams('', 'resizePath', resizePath));
  1362. }
  1363. if (webpPath != null) {
  1364. queryParams.addAll(_queryParams('', 'webpPath', webpPath));
  1365. }
  1366. if (encodedVideoPath != null) {
  1367. queryParams.addAll(_queryParams('', 'encodedVideoPath', encodedVideoPath));
  1368. }
  1369. if (city != null) {
  1370. queryParams.addAll(_queryParams('', 'city', city));
  1371. }
  1372. if (state != null) {
  1373. queryParams.addAll(_queryParams('', 'state', state));
  1374. }
  1375. if (country != null) {
  1376. queryParams.addAll(_queryParams('', 'country', country));
  1377. }
  1378. if (make != null) {
  1379. queryParams.addAll(_queryParams('', 'make', make));
  1380. }
  1381. if (model != null) {
  1382. queryParams.addAll(_queryParams('', 'model', model));
  1383. }
  1384. if (lensModel != null) {
  1385. queryParams.addAll(_queryParams('', 'lensModel', lensModel));
  1386. }
  1387. if (page != null) {
  1388. queryParams.addAll(_queryParams('', 'page', page));
  1389. }
  1390. if (size != null) {
  1391. queryParams.addAll(_queryParams('', 'size', size));
  1392. }
  1393. const contentTypes = <String>[];
  1394. return apiClient.invokeAPI(
  1395. path,
  1396. 'GET',
  1397. queryParams,
  1398. postBody,
  1399. headerParams,
  1400. formParams,
  1401. contentTypes.isEmpty ? null : contentTypes.first,
  1402. );
  1403. }
  1404. /// Parameters:
  1405. ///
  1406. /// * [String] id:
  1407. ///
  1408. /// * [String] libraryId:
  1409. ///
  1410. /// * [AssetTypeEnum] type:
  1411. ///
  1412. /// * [AssetOrder] order:
  1413. ///
  1414. /// * [String] deviceAssetId:
  1415. ///
  1416. /// * [String] deviceId:
  1417. ///
  1418. /// * [String] checksum:
  1419. ///
  1420. /// * [bool] isArchived:
  1421. ///
  1422. /// * [bool] isEncoded:
  1423. ///
  1424. /// * [bool] isExternal:
  1425. ///
  1426. /// * [bool] isFavorite:
  1427. ///
  1428. /// * [bool] isMotion:
  1429. ///
  1430. /// * [bool] isOffline:
  1431. ///
  1432. /// * [bool] isReadOnly:
  1433. ///
  1434. /// * [bool] isVisible:
  1435. ///
  1436. /// * [bool] withDeleted:
  1437. ///
  1438. /// * [bool] withStacked:
  1439. ///
  1440. /// * [bool] withExif:
  1441. ///
  1442. /// * [bool] withPeople:
  1443. ///
  1444. /// * [DateTime] createdBefore:
  1445. ///
  1446. /// * [DateTime] createdAfter:
  1447. ///
  1448. /// * [DateTime] updatedBefore:
  1449. ///
  1450. /// * [DateTime] updatedAfter:
  1451. ///
  1452. /// * [DateTime] trashedBefore:
  1453. ///
  1454. /// * [DateTime] trashedAfter:
  1455. ///
  1456. /// * [DateTime] takenBefore:
  1457. ///
  1458. /// * [DateTime] takenAfter:
  1459. ///
  1460. /// * [String] originalFileName:
  1461. ///
  1462. /// * [String] originalPath:
  1463. ///
  1464. /// * [String] resizePath:
  1465. ///
  1466. /// * [String] webpPath:
  1467. ///
  1468. /// * [String] encodedVideoPath:
  1469. ///
  1470. /// * [String] city:
  1471. ///
  1472. /// * [String] state:
  1473. ///
  1474. /// * [String] country:
  1475. ///
  1476. /// * [String] make:
  1477. ///
  1478. /// * [String] model:
  1479. ///
  1480. /// * [String] lensModel:
  1481. ///
  1482. /// * [num] page:
  1483. ///
  1484. /// * [num] size:
  1485. 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 {
  1486. 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, );
  1487. if (response.statusCode >= HttpStatus.badRequest) {
  1488. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1489. }
  1490. // When a remote server returns no body with a status of 204, we shall not decode it.
  1491. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1492. // FormatException when trying to decode an empty string.
  1493. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1494. final responseBody = await _decodeBodyBytes(response);
  1495. return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
  1496. .cast<AssetResponseDto>()
  1497. .toList();
  1498. }
  1499. return null;
  1500. }
  1501. /// Performs an HTTP 'GET /asset/file/{id}' operation and returns the [Response].
  1502. /// Parameters:
  1503. ///
  1504. /// * [String] id (required):
  1505. ///
  1506. /// * [bool] isThumb:
  1507. ///
  1508. /// * [bool] isWeb:
  1509. ///
  1510. /// * [String] key:
  1511. Future<Response> serveFileWithHttpInfo(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1512. // ignore: prefer_const_declarations
  1513. final path = r'/asset/file/{id}'
  1514. .replaceAll('{id}', id);
  1515. // ignore: prefer_final_locals
  1516. Object? postBody;
  1517. final queryParams = <QueryParam>[];
  1518. final headerParams = <String, String>{};
  1519. final formParams = <String, String>{};
  1520. if (isThumb != null) {
  1521. queryParams.addAll(_queryParams('', 'isThumb', isThumb));
  1522. }
  1523. if (isWeb != null) {
  1524. queryParams.addAll(_queryParams('', 'isWeb', isWeb));
  1525. }
  1526. if (key != null) {
  1527. queryParams.addAll(_queryParams('', 'key', key));
  1528. }
  1529. const contentTypes = <String>[];
  1530. return apiClient.invokeAPI(
  1531. path,
  1532. 'GET',
  1533. queryParams,
  1534. postBody,
  1535. headerParams,
  1536. formParams,
  1537. contentTypes.isEmpty ? null : contentTypes.first,
  1538. );
  1539. }
  1540. /// Parameters:
  1541. ///
  1542. /// * [String] id (required):
  1543. ///
  1544. /// * [bool] isThumb:
  1545. ///
  1546. /// * [bool] isWeb:
  1547. ///
  1548. /// * [String] key:
  1549. Future<MultipartFile?> serveFile(String id, { bool? isThumb, bool? isWeb, String? key, }) async {
  1550. final response = await serveFileWithHttpInfo(id, isThumb: isThumb, isWeb: isWeb, key: key, );
  1551. if (response.statusCode >= HttpStatus.badRequest) {
  1552. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1553. }
  1554. // When a remote server returns no body with a status of 204, we shall not decode it.
  1555. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1556. // FormatException when trying to decode an empty string.
  1557. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1558. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  1559. }
  1560. return null;
  1561. }
  1562. /// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
  1563. /// Parameters:
  1564. ///
  1565. /// * [String] id (required):
  1566. ///
  1567. /// * [UpdateAssetDto] updateAssetDto (required):
  1568. Future<Response> updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async {
  1569. // ignore: prefer_const_declarations
  1570. final path = r'/asset/{id}'
  1571. .replaceAll('{id}', id);
  1572. // ignore: prefer_final_locals
  1573. Object? postBody = updateAssetDto;
  1574. final queryParams = <QueryParam>[];
  1575. final headerParams = <String, String>{};
  1576. final formParams = <String, String>{};
  1577. const contentTypes = <String>['application/json'];
  1578. return apiClient.invokeAPI(
  1579. path,
  1580. 'PUT',
  1581. queryParams,
  1582. postBody,
  1583. headerParams,
  1584. formParams,
  1585. contentTypes.isEmpty ? null : contentTypes.first,
  1586. );
  1587. }
  1588. /// Parameters:
  1589. ///
  1590. /// * [String] id (required):
  1591. ///
  1592. /// * [UpdateAssetDto] updateAssetDto (required):
  1593. Future<AssetResponseDto?> updateAsset(String id, UpdateAssetDto updateAssetDto,) async {
  1594. final response = await updateAssetWithHttpInfo(id, updateAssetDto,);
  1595. if (response.statusCode >= HttpStatus.badRequest) {
  1596. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1597. }
  1598. // When a remote server returns no body with a status of 204, we shall not decode it.
  1599. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1600. // FormatException when trying to decode an empty string.
  1601. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1602. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
  1603. }
  1604. return null;
  1605. }
  1606. /// Performs an HTTP 'PUT /asset' operation and returns the [Response].
  1607. /// Parameters:
  1608. ///
  1609. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1610. Future<Response> updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1611. // ignore: prefer_const_declarations
  1612. final path = r'/asset';
  1613. // ignore: prefer_final_locals
  1614. Object? postBody = assetBulkUpdateDto;
  1615. final queryParams = <QueryParam>[];
  1616. final headerParams = <String, String>{};
  1617. final formParams = <String, String>{};
  1618. const contentTypes = <String>['application/json'];
  1619. return apiClient.invokeAPI(
  1620. path,
  1621. 'PUT',
  1622. queryParams,
  1623. postBody,
  1624. headerParams,
  1625. formParams,
  1626. contentTypes.isEmpty ? null : contentTypes.first,
  1627. );
  1628. }
  1629. /// Parameters:
  1630. ///
  1631. /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
  1632. Future<void> updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async {
  1633. final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,);
  1634. if (response.statusCode >= HttpStatus.badRequest) {
  1635. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1636. }
  1637. }
  1638. /// Performs an HTTP 'PUT /asset/stack/parent' operation and returns the [Response].
  1639. /// Parameters:
  1640. ///
  1641. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1642. Future<Response> updateStackParentWithHttpInfo(UpdateStackParentDto updateStackParentDto,) async {
  1643. // ignore: prefer_const_declarations
  1644. final path = r'/asset/stack/parent';
  1645. // ignore: prefer_final_locals
  1646. Object? postBody = updateStackParentDto;
  1647. final queryParams = <QueryParam>[];
  1648. final headerParams = <String, String>{};
  1649. final formParams = <String, String>{};
  1650. const contentTypes = <String>['application/json'];
  1651. return apiClient.invokeAPI(
  1652. path,
  1653. 'PUT',
  1654. queryParams,
  1655. postBody,
  1656. headerParams,
  1657. formParams,
  1658. contentTypes.isEmpty ? null : contentTypes.first,
  1659. );
  1660. }
  1661. /// Parameters:
  1662. ///
  1663. /// * [UpdateStackParentDto] updateStackParentDto (required):
  1664. Future<void> updateStackParent(UpdateStackParentDto updateStackParentDto,) async {
  1665. final response = await updateStackParentWithHttpInfo(updateStackParentDto,);
  1666. if (response.statusCode >= HttpStatus.badRequest) {
  1667. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1668. }
  1669. }
  1670. /// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
  1671. /// Parameters:
  1672. ///
  1673. /// * [MultipartFile] assetData (required):
  1674. ///
  1675. /// * [String] deviceAssetId (required):
  1676. ///
  1677. /// * [String] deviceId (required):
  1678. ///
  1679. /// * [DateTime] fileCreatedAt (required):
  1680. ///
  1681. /// * [DateTime] fileModifiedAt (required):
  1682. ///
  1683. /// * [String] key:
  1684. ///
  1685. /// * [String] duration:
  1686. ///
  1687. /// * [bool] isArchived:
  1688. ///
  1689. /// * [bool] isExternal:
  1690. ///
  1691. /// * [bool] isFavorite:
  1692. ///
  1693. /// * [bool] isOffline:
  1694. ///
  1695. /// * [bool] isReadOnly:
  1696. ///
  1697. /// * [bool] isVisible:
  1698. ///
  1699. /// * [String] libraryId:
  1700. ///
  1701. /// * [MultipartFile] livePhotoData:
  1702. ///
  1703. /// * [MultipartFile] sidecarData:
  1704. 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 {
  1705. // ignore: prefer_const_declarations
  1706. final path = r'/asset/upload';
  1707. // ignore: prefer_final_locals
  1708. Object? postBody;
  1709. final queryParams = <QueryParam>[];
  1710. final headerParams = <String, String>{};
  1711. final formParams = <String, String>{};
  1712. if (key != null) {
  1713. queryParams.addAll(_queryParams('', 'key', key));
  1714. }
  1715. const contentTypes = <String>['multipart/form-data'];
  1716. bool hasFields = false;
  1717. final mp = MultipartRequest('POST', Uri.parse(path));
  1718. if (assetData != null) {
  1719. hasFields = true;
  1720. mp.fields[r'assetData'] = assetData.field;
  1721. mp.files.add(assetData);
  1722. }
  1723. if (deviceAssetId != null) {
  1724. hasFields = true;
  1725. mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId);
  1726. }
  1727. if (deviceId != null) {
  1728. hasFields = true;
  1729. mp.fields[r'deviceId'] = parameterToString(deviceId);
  1730. }
  1731. if (duration != null) {
  1732. hasFields = true;
  1733. mp.fields[r'duration'] = parameterToString(duration);
  1734. }
  1735. if (fileCreatedAt != null) {
  1736. hasFields = true;
  1737. mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt);
  1738. }
  1739. if (fileModifiedAt != null) {
  1740. hasFields = true;
  1741. mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt);
  1742. }
  1743. if (isArchived != null) {
  1744. hasFields = true;
  1745. mp.fields[r'isArchived'] = parameterToString(isArchived);
  1746. }
  1747. if (isExternal != null) {
  1748. hasFields = true;
  1749. mp.fields[r'isExternal'] = parameterToString(isExternal);
  1750. }
  1751. if (isFavorite != null) {
  1752. hasFields = true;
  1753. mp.fields[r'isFavorite'] = parameterToString(isFavorite);
  1754. }
  1755. if (isOffline != null) {
  1756. hasFields = true;
  1757. mp.fields[r'isOffline'] = parameterToString(isOffline);
  1758. }
  1759. if (isReadOnly != null) {
  1760. hasFields = true;
  1761. mp.fields[r'isReadOnly'] = parameterToString(isReadOnly);
  1762. }
  1763. if (isVisible != null) {
  1764. hasFields = true;
  1765. mp.fields[r'isVisible'] = parameterToString(isVisible);
  1766. }
  1767. if (libraryId != null) {
  1768. hasFields = true;
  1769. mp.fields[r'libraryId'] = parameterToString(libraryId);
  1770. }
  1771. if (livePhotoData != null) {
  1772. hasFields = true;
  1773. mp.fields[r'livePhotoData'] = livePhotoData.field;
  1774. mp.files.add(livePhotoData);
  1775. }
  1776. if (sidecarData != null) {
  1777. hasFields = true;
  1778. mp.fields[r'sidecarData'] = sidecarData.field;
  1779. mp.files.add(sidecarData);
  1780. }
  1781. if (hasFields) {
  1782. postBody = mp;
  1783. }
  1784. return apiClient.invokeAPI(
  1785. path,
  1786. 'POST',
  1787. queryParams,
  1788. postBody,
  1789. headerParams,
  1790. formParams,
  1791. contentTypes.isEmpty ? null : contentTypes.first,
  1792. );
  1793. }
  1794. /// Parameters:
  1795. ///
  1796. /// * [MultipartFile] assetData (required):
  1797. ///
  1798. /// * [String] deviceAssetId (required):
  1799. ///
  1800. /// * [String] deviceId (required):
  1801. ///
  1802. /// * [DateTime] fileCreatedAt (required):
  1803. ///
  1804. /// * [DateTime] fileModifiedAt (required):
  1805. ///
  1806. /// * [String] key:
  1807. ///
  1808. /// * [String] duration:
  1809. ///
  1810. /// * [bool] isArchived:
  1811. ///
  1812. /// * [bool] isExternal:
  1813. ///
  1814. /// * [bool] isFavorite:
  1815. ///
  1816. /// * [bool] isOffline:
  1817. ///
  1818. /// * [bool] isReadOnly:
  1819. ///
  1820. /// * [bool] isVisible:
  1821. ///
  1822. /// * [String] libraryId:
  1823. ///
  1824. /// * [MultipartFile] livePhotoData:
  1825. ///
  1826. /// * [MultipartFile] sidecarData:
  1827. 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 {
  1828. 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, );
  1829. if (response.statusCode >= HttpStatus.badRequest) {
  1830. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  1831. }
  1832. // When a remote server returns no body with a status of 204, we shall not decode it.
  1833. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  1834. // FormatException when trying to decode an empty string.
  1835. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  1836. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
  1837. }
  1838. return null;
  1839. }
  1840. }