album_api.dart 17 KB

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