album_api.dart 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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 AlbumApi {
  11. AlbumApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'PUT /album/{albumId}/assets' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [String] albumId (required):
  17. ///
  18. /// * [AddAssetsDto] addAssetsDto (required):
  19. Future<Response> addAssetsToAlbumWithHttpInfo(String albumId, AddAssetsDto addAssetsDto,) async {
  20. // ignore: prefer_const_declarations
  21. final path = r'/album/{albumId}/assets'
  22. .replaceAll('{albumId}', albumId);
  23. // ignore: prefer_final_locals
  24. Object? postBody = addAssetsDto;
  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. 'PUT',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. /// Parameters:
  40. ///
  41. /// * [String] albumId (required):
  42. ///
  43. /// * [AddAssetsDto] addAssetsDto (required):
  44. Future<AddAssetsResponseDto?> addAssetsToAlbum(String albumId, AddAssetsDto addAssetsDto,) async {
  45. final response = await addAssetsToAlbumWithHttpInfo(albumId, addAssetsDto,);
  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), 'AddAssetsResponseDto',) as AddAssetsResponseDto;
  54. }
  55. return null;
  56. }
  57. /// Performs an HTTP 'PUT /album/{albumId}/users' operation and returns the [Response].
  58. /// Parameters:
  59. ///
  60. /// * [String] albumId (required):
  61. ///
  62. /// * [AddUsersDto] addUsersDto (required):
  63. Future<Response> addUsersToAlbumWithHttpInfo(String albumId, AddUsersDto addUsersDto,) async {
  64. // ignore: prefer_const_declarations
  65. final path = r'/album/{albumId}/users'
  66. .replaceAll('{albumId}', albumId);
  67. // ignore: prefer_final_locals
  68. Object? postBody = addUsersDto;
  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. 'PUT',
  76. queryParams,
  77. postBody,
  78. headerParams,
  79. formParams,
  80. contentTypes.isEmpty ? null : contentTypes.first,
  81. );
  82. }
  83. /// Parameters:
  84. ///
  85. /// * [String] albumId (required):
  86. ///
  87. /// * [AddUsersDto] addUsersDto (required):
  88. Future<AlbumResponseDto?> addUsersToAlbum(String albumId, AddUsersDto addUsersDto,) async {
  89. final response = await addUsersToAlbumWithHttpInfo(albumId, addUsersDto,);
  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), 'AlbumResponseDto',) as AlbumResponseDto;
  98. }
  99. return null;
  100. }
  101. /// Performs an HTTP 'POST /album' operation and returns the [Response].
  102. /// Parameters:
  103. ///
  104. /// * [CreateAlbumDto] createAlbumDto (required):
  105. Future<Response> createAlbumWithHttpInfo(CreateAlbumDto createAlbumDto,) async {
  106. // ignore: prefer_const_declarations
  107. final path = r'/album';
  108. // ignore: prefer_final_locals
  109. Object? postBody = createAlbumDto;
  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. 'POST',
  117. queryParams,
  118. postBody,
  119. headerParams,
  120. formParams,
  121. contentTypes.isEmpty ? null : contentTypes.first,
  122. );
  123. }
  124. /// Parameters:
  125. ///
  126. /// * [CreateAlbumDto] createAlbumDto (required):
  127. Future<AlbumResponseDto?> createAlbum(CreateAlbumDto createAlbumDto,) async {
  128. final response = await createAlbumWithHttpInfo(createAlbumDto,);
  129. if (response.statusCode >= HttpStatus.badRequest) {
  130. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  131. }
  132. // When a remote server returns no body with a status of 204, we shall not decode it.
  133. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  134. // FormatException when trying to decode an empty string.
  135. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  136. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  137. }
  138. return null;
  139. }
  140. /// Performs an HTTP 'DELETE /album/{albumId}' operation and returns the [Response].
  141. /// Parameters:
  142. ///
  143. /// * [String] albumId (required):
  144. Future<Response> deleteAlbumWithHttpInfo(String albumId,) async {
  145. // ignore: prefer_const_declarations
  146. final path = r'/album/{albumId}'
  147. .replaceAll('{albumId}', albumId);
  148. // ignore: prefer_final_locals
  149. Object? postBody;
  150. final queryParams = <QueryParam>[];
  151. final headerParams = <String, String>{};
  152. final formParams = <String, String>{};
  153. const contentTypes = <String>[];
  154. return apiClient.invokeAPI(
  155. path,
  156. 'DELETE',
  157. queryParams,
  158. postBody,
  159. headerParams,
  160. formParams,
  161. contentTypes.isEmpty ? null : contentTypes.first,
  162. );
  163. }
  164. /// Parameters:
  165. ///
  166. /// * [String] albumId (required):
  167. Future<void> deleteAlbum(String albumId,) async {
  168. final response = await deleteAlbumWithHttpInfo(albumId,);
  169. if (response.statusCode >= HttpStatus.badRequest) {
  170. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  171. }
  172. }
  173. /// Performs an HTTP 'GET /album/{albumId}/download' operation and returns the [Response].
  174. /// Parameters:
  175. ///
  176. /// * [String] albumId (required):
  177. ///
  178. /// * [num] skip:
  179. Future<Response> downloadArchiveWithHttpInfo(String albumId, { num? skip, }) async {
  180. // ignore: prefer_const_declarations
  181. final path = r'/album/{albumId}/download'
  182. .replaceAll('{albumId}', albumId);
  183. // ignore: prefer_final_locals
  184. Object? postBody;
  185. final queryParams = <QueryParam>[];
  186. final headerParams = <String, String>{};
  187. final formParams = <String, String>{};
  188. if (skip != null) {
  189. queryParams.addAll(_queryParams('', 'skip', skip));
  190. }
  191. const contentTypes = <String>[];
  192. return apiClient.invokeAPI(
  193. path,
  194. 'GET',
  195. queryParams,
  196. postBody,
  197. headerParams,
  198. formParams,
  199. contentTypes.isEmpty ? null : contentTypes.first,
  200. );
  201. }
  202. /// Parameters:
  203. ///
  204. /// * [String] albumId (required):
  205. ///
  206. /// * [num] skip:
  207. Future<Object?> downloadArchive(String albumId, { num? skip, }) async {
  208. final response = await downloadArchiveWithHttpInfo(albumId, skip: skip, );
  209. if (response.statusCode >= HttpStatus.badRequest) {
  210. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  211. }
  212. // When a remote server returns no body with a status of 204, we shall not decode it.
  213. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  214. // FormatException when trying to decode an empty string.
  215. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  216. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
  217. }
  218. return null;
  219. }
  220. /// Performs an HTTP 'GET /album/count-by-user-id' operation and returns the [Response].
  221. Future<Response> getAlbumCountByUserIdWithHttpInfo() async {
  222. // ignore: prefer_const_declarations
  223. final path = r'/album/count-by-user-id';
  224. // ignore: prefer_final_locals
  225. Object? postBody;
  226. final queryParams = <QueryParam>[];
  227. final headerParams = <String, String>{};
  228. final formParams = <String, String>{};
  229. const contentTypes = <String>[];
  230. return apiClient.invokeAPI(
  231. path,
  232. 'GET',
  233. queryParams,
  234. postBody,
  235. headerParams,
  236. formParams,
  237. contentTypes.isEmpty ? null : contentTypes.first,
  238. );
  239. }
  240. Future<AlbumCountResponseDto?> getAlbumCountByUserId() async {
  241. final response = await getAlbumCountByUserIdWithHttpInfo();
  242. if (response.statusCode >= HttpStatus.badRequest) {
  243. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  244. }
  245. // When a remote server returns no body with a status of 204, we shall not decode it.
  246. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  247. // FormatException when trying to decode an empty string.
  248. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  249. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumCountResponseDto',) as AlbumCountResponseDto;
  250. }
  251. return null;
  252. }
  253. /// Performs an HTTP 'GET /album/{albumId}' operation and returns the [Response].
  254. /// Parameters:
  255. ///
  256. /// * [String] albumId (required):
  257. Future<Response> getAlbumInfoWithHttpInfo(String albumId,) async {
  258. // ignore: prefer_const_declarations
  259. final path = r'/album/{albumId}'
  260. .replaceAll('{albumId}', albumId);
  261. // ignore: prefer_final_locals
  262. Object? postBody;
  263. final queryParams = <QueryParam>[];
  264. final headerParams = <String, String>{};
  265. final formParams = <String, String>{};
  266. const contentTypes = <String>[];
  267. return apiClient.invokeAPI(
  268. path,
  269. 'GET',
  270. queryParams,
  271. postBody,
  272. headerParams,
  273. formParams,
  274. contentTypes.isEmpty ? null : contentTypes.first,
  275. );
  276. }
  277. /// Parameters:
  278. ///
  279. /// * [String] albumId (required):
  280. Future<AlbumResponseDto?> getAlbumInfo(String albumId,) async {
  281. final response = await getAlbumInfoWithHttpInfo(albumId,);
  282. if (response.statusCode >= HttpStatus.badRequest) {
  283. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  284. }
  285. // When a remote server returns no body with a status of 204, we shall not decode it.
  286. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  287. // FormatException when trying to decode an empty string.
  288. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  289. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  290. }
  291. return null;
  292. }
  293. /// Performs an HTTP 'GET /album' operation and returns the [Response].
  294. /// Parameters:
  295. ///
  296. /// * [bool] shared:
  297. ///
  298. /// * [String] assetId:
  299. /// Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
  300. Future<Response> getAllAlbumsWithHttpInfo({ bool? shared, String? assetId, }) async {
  301. // ignore: prefer_const_declarations
  302. final path = r'/album';
  303. // ignore: prefer_final_locals
  304. Object? postBody;
  305. final queryParams = <QueryParam>[];
  306. final headerParams = <String, String>{};
  307. final formParams = <String, String>{};
  308. if (shared != null) {
  309. queryParams.addAll(_queryParams('', 'shared', shared));
  310. }
  311. if (assetId != null) {
  312. queryParams.addAll(_queryParams('', 'assetId', assetId));
  313. }
  314. const contentTypes = <String>[];
  315. return apiClient.invokeAPI(
  316. path,
  317. 'GET',
  318. queryParams,
  319. postBody,
  320. headerParams,
  321. formParams,
  322. contentTypes.isEmpty ? null : contentTypes.first,
  323. );
  324. }
  325. /// Parameters:
  326. ///
  327. /// * [bool] shared:
  328. ///
  329. /// * [String] assetId:
  330. /// Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
  331. Future<List<AlbumResponseDto>?> getAllAlbums({ bool? shared, String? assetId, }) async {
  332. final response = await getAllAlbumsWithHttpInfo( shared: shared, assetId: assetId, );
  333. if (response.statusCode >= HttpStatus.badRequest) {
  334. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  335. }
  336. // When a remote server returns no body with a status of 204, we shall not decode it.
  337. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  338. // FormatException when trying to decode an empty string.
  339. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  340. final responseBody = await _decodeBodyBytes(response);
  341. return (await apiClient.deserializeAsync(responseBody, 'List<AlbumResponseDto>') as List)
  342. .cast<AlbumResponseDto>()
  343. .toList();
  344. }
  345. return null;
  346. }
  347. /// Performs an HTTP 'DELETE /album/{albumId}/assets' operation and returns the [Response].
  348. /// Parameters:
  349. ///
  350. /// * [String] albumId (required):
  351. ///
  352. /// * [RemoveAssetsDto] removeAssetsDto (required):
  353. Future<Response> removeAssetFromAlbumWithHttpInfo(String albumId, RemoveAssetsDto removeAssetsDto,) async {
  354. // ignore: prefer_const_declarations
  355. final path = r'/album/{albumId}/assets'
  356. .replaceAll('{albumId}', albumId);
  357. // ignore: prefer_final_locals
  358. Object? postBody = removeAssetsDto;
  359. final queryParams = <QueryParam>[];
  360. final headerParams = <String, String>{};
  361. final formParams = <String, String>{};
  362. const contentTypes = <String>['application/json'];
  363. return apiClient.invokeAPI(
  364. path,
  365. 'DELETE',
  366. queryParams,
  367. postBody,
  368. headerParams,
  369. formParams,
  370. contentTypes.isEmpty ? null : contentTypes.first,
  371. );
  372. }
  373. /// Parameters:
  374. ///
  375. /// * [String] albumId (required):
  376. ///
  377. /// * [RemoveAssetsDto] removeAssetsDto (required):
  378. Future<AlbumResponseDto?> removeAssetFromAlbum(String albumId, RemoveAssetsDto removeAssetsDto,) async {
  379. final response = await removeAssetFromAlbumWithHttpInfo(albumId, removeAssetsDto,);
  380. if (response.statusCode >= HttpStatus.badRequest) {
  381. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  382. }
  383. // When a remote server returns no body with a status of 204, we shall not decode it.
  384. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  385. // FormatException when trying to decode an empty string.
  386. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  387. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  388. }
  389. return null;
  390. }
  391. /// Performs an HTTP 'DELETE /album/{albumId}/user/{userId}' operation and returns the [Response].
  392. /// Parameters:
  393. ///
  394. /// * [String] albumId (required):
  395. ///
  396. /// * [String] userId (required):
  397. Future<Response> removeUserFromAlbumWithHttpInfo(String albumId, String userId,) async {
  398. // ignore: prefer_const_declarations
  399. final path = r'/album/{albumId}/user/{userId}'
  400. .replaceAll('{albumId}', albumId)
  401. .replaceAll('{userId}', userId);
  402. // ignore: prefer_final_locals
  403. Object? postBody;
  404. final queryParams = <QueryParam>[];
  405. final headerParams = <String, String>{};
  406. final formParams = <String, String>{};
  407. const contentTypes = <String>[];
  408. return apiClient.invokeAPI(
  409. path,
  410. 'DELETE',
  411. queryParams,
  412. postBody,
  413. headerParams,
  414. formParams,
  415. contentTypes.isEmpty ? null : contentTypes.first,
  416. );
  417. }
  418. /// Parameters:
  419. ///
  420. /// * [String] albumId (required):
  421. ///
  422. /// * [String] userId (required):
  423. Future<void> removeUserFromAlbum(String albumId, String userId,) async {
  424. final response = await removeUserFromAlbumWithHttpInfo(albumId, userId,);
  425. if (response.statusCode >= HttpStatus.badRequest) {
  426. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  427. }
  428. }
  429. /// Performs an HTTP 'PATCH /album/{albumId}' operation and returns the [Response].
  430. /// Parameters:
  431. ///
  432. /// * [String] albumId (required):
  433. ///
  434. /// * [UpdateAlbumDto] updateAlbumDto (required):
  435. Future<Response> updateAlbumInfoWithHttpInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
  436. // ignore: prefer_const_declarations
  437. final path = r'/album/{albumId}'
  438. .replaceAll('{albumId}', albumId);
  439. // ignore: prefer_final_locals
  440. Object? postBody = updateAlbumDto;
  441. final queryParams = <QueryParam>[];
  442. final headerParams = <String, String>{};
  443. final formParams = <String, String>{};
  444. const contentTypes = <String>['application/json'];
  445. return apiClient.invokeAPI(
  446. path,
  447. 'PATCH',
  448. queryParams,
  449. postBody,
  450. headerParams,
  451. formParams,
  452. contentTypes.isEmpty ? null : contentTypes.first,
  453. );
  454. }
  455. /// Parameters:
  456. ///
  457. /// * [String] albumId (required):
  458. ///
  459. /// * [UpdateAlbumDto] updateAlbumDto (required):
  460. Future<AlbumResponseDto?> updateAlbumInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
  461. final response = await updateAlbumInfoWithHttpInfo(albumId, updateAlbumDto,);
  462. if (response.statusCode >= HttpStatus.badRequest) {
  463. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  464. }
  465. // When a remote server returns no body with a status of 204, we shall not decode it.
  466. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  467. // FormatException when trying to decode an empty string.
  468. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  469. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  470. }
  471. return null;
  472. }
  473. }