album_api.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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<AlbumResponseDto?> 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), 'AlbumResponseDto',) as AlbumResponseDto;
  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}' operation and returns the [Response].
  174. /// Parameters:
  175. ///
  176. /// * [String] albumId (required):
  177. Future<Response> getAlbumInfoWithHttpInfo(String albumId,) async {
  178. // ignore: prefer_const_declarations
  179. final path = r'/album/{albumId}'
  180. .replaceAll('{albumId}', albumId);
  181. // ignore: prefer_final_locals
  182. Object? postBody;
  183. final queryParams = <QueryParam>[];
  184. final headerParams = <String, String>{};
  185. final formParams = <String, String>{};
  186. const contentTypes = <String>[];
  187. return apiClient.invokeAPI(
  188. path,
  189. 'GET',
  190. queryParams,
  191. postBody,
  192. headerParams,
  193. formParams,
  194. contentTypes.isEmpty ? null : contentTypes.first,
  195. );
  196. }
  197. /// Parameters:
  198. ///
  199. /// * [String] albumId (required):
  200. Future<AlbumResponseDto?> getAlbumInfo(String albumId,) async {
  201. final response = await getAlbumInfoWithHttpInfo(albumId,);
  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), 'AlbumResponseDto',) as AlbumResponseDto;
  210. }
  211. return null;
  212. }
  213. /// Performs an HTTP 'GET /album' operation and returns the [Response].
  214. /// Parameters:
  215. ///
  216. /// * [bool] shared:
  217. Future<Response> getAllAlbumsWithHttpInfo({ bool? shared, }) async {
  218. // ignore: prefer_const_declarations
  219. final path = r'/album';
  220. // ignore: prefer_final_locals
  221. Object? postBody;
  222. final queryParams = <QueryParam>[];
  223. final headerParams = <String, String>{};
  224. final formParams = <String, String>{};
  225. if (shared != null) {
  226. queryParams.addAll(_queryParams('', 'shared', shared));
  227. }
  228. const contentTypes = <String>[];
  229. return apiClient.invokeAPI(
  230. path,
  231. 'GET',
  232. queryParams,
  233. postBody,
  234. headerParams,
  235. formParams,
  236. contentTypes.isEmpty ? null : contentTypes.first,
  237. );
  238. }
  239. /// Parameters:
  240. ///
  241. /// * [bool] shared:
  242. Future<List<AlbumResponseDto>?> getAllAlbums({ bool? shared, }) async {
  243. final response = await getAllAlbumsWithHttpInfo( shared: shared, );
  244. if (response.statusCode >= HttpStatus.badRequest) {
  245. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  246. }
  247. // When a remote server returns no body with a status of 204, we shall not decode it.
  248. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  249. // FormatException when trying to decode an empty string.
  250. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  251. final responseBody = await _decodeBodyBytes(response);
  252. return (await apiClient.deserializeAsync(responseBody, 'List<AlbumResponseDto>') as List)
  253. .cast<AlbumResponseDto>()
  254. .toList();
  255. }
  256. return null;
  257. }
  258. /// Performs an HTTP 'DELETE /album/{albumId}/assets' operation and returns the [Response].
  259. /// Parameters:
  260. ///
  261. /// * [String] albumId (required):
  262. ///
  263. /// * [RemoveAssetsDto] removeAssetsDto (required):
  264. Future<Response> removeAssetFromAlbumWithHttpInfo(String albumId, RemoveAssetsDto removeAssetsDto,) async {
  265. // ignore: prefer_const_declarations
  266. final path = r'/album/{albumId}/assets'
  267. .replaceAll('{albumId}', albumId);
  268. // ignore: prefer_final_locals
  269. Object? postBody = removeAssetsDto;
  270. final queryParams = <QueryParam>[];
  271. final headerParams = <String, String>{};
  272. final formParams = <String, String>{};
  273. const contentTypes = <String>['application/json'];
  274. return apiClient.invokeAPI(
  275. path,
  276. 'DELETE',
  277. queryParams,
  278. postBody,
  279. headerParams,
  280. formParams,
  281. contentTypes.isEmpty ? null : contentTypes.first,
  282. );
  283. }
  284. /// Parameters:
  285. ///
  286. /// * [String] albumId (required):
  287. ///
  288. /// * [RemoveAssetsDto] removeAssetsDto (required):
  289. Future<void> removeAssetFromAlbum(String albumId, RemoveAssetsDto removeAssetsDto,) async {
  290. final response = await removeAssetFromAlbumWithHttpInfo(albumId, removeAssetsDto,);
  291. if (response.statusCode >= HttpStatus.badRequest) {
  292. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  293. }
  294. }
  295. /// Performs an HTTP 'DELETE /album/{albumId}/user/{userId}' operation and returns the [Response].
  296. /// Parameters:
  297. ///
  298. /// * [String] albumId (required):
  299. ///
  300. /// * [String] userId (required):
  301. Future<Response> removeUserFromAlbumWithHttpInfo(String albumId, String userId,) async {
  302. // ignore: prefer_const_declarations
  303. final path = r'/album/{albumId}/user/{userId}'
  304. .replaceAll('{albumId}', albumId)
  305. .replaceAll('{userId}', userId);
  306. // ignore: prefer_final_locals
  307. Object? postBody;
  308. final queryParams = <QueryParam>[];
  309. final headerParams = <String, String>{};
  310. final formParams = <String, String>{};
  311. const contentTypes = <String>[];
  312. return apiClient.invokeAPI(
  313. path,
  314. 'DELETE',
  315. queryParams,
  316. postBody,
  317. headerParams,
  318. formParams,
  319. contentTypes.isEmpty ? null : contentTypes.first,
  320. );
  321. }
  322. /// Parameters:
  323. ///
  324. /// * [String] albumId (required):
  325. ///
  326. /// * [String] userId (required):
  327. Future<void> removeUserFromAlbum(String albumId, String userId,) async {
  328. final response = await removeUserFromAlbumWithHttpInfo(albumId, userId,);
  329. if (response.statusCode >= HttpStatus.badRequest) {
  330. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  331. }
  332. }
  333. /// Performs an HTTP 'PATCH /album/{albumId}' operation and returns the [Response].
  334. /// Parameters:
  335. ///
  336. /// * [String] albumId (required):
  337. ///
  338. /// * [UpdateAlbumDto] updateAlbumDto (required):
  339. Future<Response> updateAlbumInfoWithHttpInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
  340. // ignore: prefer_const_declarations
  341. final path = r'/album/{albumId}'
  342. .replaceAll('{albumId}', albumId);
  343. // ignore: prefer_final_locals
  344. Object? postBody = updateAlbumDto;
  345. final queryParams = <QueryParam>[];
  346. final headerParams = <String, String>{};
  347. final formParams = <String, String>{};
  348. const contentTypes = <String>['application/json'];
  349. return apiClient.invokeAPI(
  350. path,
  351. 'PATCH',
  352. queryParams,
  353. postBody,
  354. headerParams,
  355. formParams,
  356. contentTypes.isEmpty ? null : contentTypes.first,
  357. );
  358. }
  359. /// Parameters:
  360. ///
  361. /// * [String] albumId (required):
  362. ///
  363. /// * [UpdateAlbumDto] updateAlbumDto (required):
  364. Future<AlbumResponseDto?> updateAlbumInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
  365. final response = await updateAlbumInfoWithHttpInfo(albumId, updateAlbumDto,);
  366. if (response.statusCode >= HttpStatus.badRequest) {
  367. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  368. }
  369. // When a remote server returns no body with a status of 204, we shall not decode it.
  370. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  371. // FormatException when trying to decode an empty string.
  372. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  373. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  374. }
  375. return null;
  376. }
  377. }