album_api.dart 16 KB

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