album_api.dart 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  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. ///
  20. /// * [String] key:
  21. Future<Response> addAssetsToAlbumWithHttpInfo(String albumId, AddAssetsDto addAssetsDto, { String? key, }) async {
  22. // ignore: prefer_const_declarations
  23. final path = r'/album/{albumId}/assets'
  24. .replaceAll('{albumId}', albumId);
  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] albumId (required):
  47. ///
  48. /// * [AddAssetsDto] addAssetsDto (required):
  49. ///
  50. /// * [String] key:
  51. Future<AddAssetsResponseDto?> addAssetsToAlbum(String albumId, AddAssetsDto addAssetsDto, { String? key, }) async {
  52. final response = await addAssetsToAlbumWithHttpInfo(albumId, 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/{albumId}/users' operation and returns the [Response].
  65. /// Parameters:
  66. ///
  67. /// * [String] albumId (required):
  68. ///
  69. /// * [AddUsersDto] addUsersDto (required):
  70. Future<Response> addUsersToAlbumWithHttpInfo(String albumId, AddUsersDto addUsersDto,) async {
  71. // ignore: prefer_const_declarations
  72. final path = r'/album/{albumId}/users'
  73. .replaceAll('{albumId}', albumId);
  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] albumId (required):
  93. ///
  94. /// * [AddUsersDto] addUsersDto (required):
  95. Future<AlbumResponseDto?> addUsersToAlbum(String albumId, AddUsersDto addUsersDto,) async {
  96. final response = await addUsersToAlbumWithHttpInfo(albumId, 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 'POST /album/create-shared-link' operation and returns the [Response].
  148. /// Parameters:
  149. ///
  150. /// * [CreateAlbumShareLinkDto] createAlbumShareLinkDto (required):
  151. Future<Response> createAlbumSharedLinkWithHttpInfo(CreateAlbumShareLinkDto createAlbumShareLinkDto,) async {
  152. // ignore: prefer_const_declarations
  153. final path = r'/album/create-shared-link';
  154. // ignore: prefer_final_locals
  155. Object? postBody = createAlbumShareLinkDto;
  156. final queryParams = <QueryParam>[];
  157. final headerParams = <String, String>{};
  158. final formParams = <String, String>{};
  159. const contentTypes = <String>['application/json'];
  160. return apiClient.invokeAPI(
  161. path,
  162. 'POST',
  163. queryParams,
  164. postBody,
  165. headerParams,
  166. formParams,
  167. contentTypes.isEmpty ? null : contentTypes.first,
  168. );
  169. }
  170. /// Parameters:
  171. ///
  172. /// * [CreateAlbumShareLinkDto] createAlbumShareLinkDto (required):
  173. Future<SharedLinkResponseDto?> createAlbumSharedLink(CreateAlbumShareLinkDto createAlbumShareLinkDto,) async {
  174. final response = await createAlbumSharedLinkWithHttpInfo(createAlbumShareLinkDto,);
  175. if (response.statusCode >= HttpStatus.badRequest) {
  176. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  177. }
  178. // When a remote server returns no body with a status of 204, we shall not decode it.
  179. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  180. // FormatException when trying to decode an empty string.
  181. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  182. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  183. }
  184. return null;
  185. }
  186. /// Performs an HTTP 'DELETE /album/{albumId}' operation and returns the [Response].
  187. /// Parameters:
  188. ///
  189. /// * [String] albumId (required):
  190. Future<Response> deleteAlbumWithHttpInfo(String albumId,) async {
  191. // ignore: prefer_const_declarations
  192. final path = r'/album/{albumId}'
  193. .replaceAll('{albumId}', albumId);
  194. // ignore: prefer_final_locals
  195. Object? postBody;
  196. final queryParams = <QueryParam>[];
  197. final headerParams = <String, String>{};
  198. final formParams = <String, String>{};
  199. const contentTypes = <String>[];
  200. return apiClient.invokeAPI(
  201. path,
  202. 'DELETE',
  203. queryParams,
  204. postBody,
  205. headerParams,
  206. formParams,
  207. contentTypes.isEmpty ? null : contentTypes.first,
  208. );
  209. }
  210. /// Parameters:
  211. ///
  212. /// * [String] albumId (required):
  213. Future<void> deleteAlbum(String albumId,) async {
  214. final response = await deleteAlbumWithHttpInfo(albumId,);
  215. if (response.statusCode >= HttpStatus.badRequest) {
  216. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  217. }
  218. }
  219. /// Performs an HTTP 'GET /album/{albumId}/download' operation and returns the [Response].
  220. /// Parameters:
  221. ///
  222. /// * [String] albumId (required):
  223. ///
  224. /// * [String] name:
  225. ///
  226. /// * [num] skip:
  227. ///
  228. /// * [String] key:
  229. Future<Response> downloadArchiveWithHttpInfo(String albumId, { String? name, num? skip, String? key, }) async {
  230. // ignore: prefer_const_declarations
  231. final path = r'/album/{albumId}/download'
  232. .replaceAll('{albumId}', albumId);
  233. // ignore: prefer_final_locals
  234. Object? postBody;
  235. final queryParams = <QueryParam>[];
  236. final headerParams = <String, String>{};
  237. final formParams = <String, String>{};
  238. if (name != null) {
  239. queryParams.addAll(_queryParams('', 'name', name));
  240. }
  241. if (skip != null) {
  242. queryParams.addAll(_queryParams('', 'skip', skip));
  243. }
  244. if (key != null) {
  245. queryParams.addAll(_queryParams('', 'key', key));
  246. }
  247. const contentTypes = <String>[];
  248. return apiClient.invokeAPI(
  249. path,
  250. 'GET',
  251. queryParams,
  252. postBody,
  253. headerParams,
  254. formParams,
  255. contentTypes.isEmpty ? null : contentTypes.first,
  256. );
  257. }
  258. /// Parameters:
  259. ///
  260. /// * [String] albumId (required):
  261. ///
  262. /// * [String] name:
  263. ///
  264. /// * [num] skip:
  265. ///
  266. /// * [String] key:
  267. Future<MultipartFile?> downloadArchive(String albumId, { String? name, num? skip, String? key, }) async {
  268. final response = await downloadArchiveWithHttpInfo(albumId, name: name, skip: skip, key: key, );
  269. if (response.statusCode >= HttpStatus.badRequest) {
  270. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  271. }
  272. // When a remote server returns no body with a status of 204, we shall not decode it.
  273. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  274. // FormatException when trying to decode an empty string.
  275. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  276. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
  277. }
  278. return null;
  279. }
  280. /// Performs an HTTP 'GET /album/count-by-user-id' operation and returns the [Response].
  281. Future<Response> getAlbumCountByUserIdWithHttpInfo() async {
  282. // ignore: prefer_const_declarations
  283. final path = r'/album/count-by-user-id';
  284. // ignore: prefer_final_locals
  285. Object? postBody;
  286. final queryParams = <QueryParam>[];
  287. final headerParams = <String, String>{};
  288. final formParams = <String, String>{};
  289. const contentTypes = <String>[];
  290. return apiClient.invokeAPI(
  291. path,
  292. 'GET',
  293. queryParams,
  294. postBody,
  295. headerParams,
  296. formParams,
  297. contentTypes.isEmpty ? null : contentTypes.first,
  298. );
  299. }
  300. Future<AlbumCountResponseDto?> getAlbumCountByUserId() async {
  301. final response = await getAlbumCountByUserIdWithHttpInfo();
  302. if (response.statusCode >= HttpStatus.badRequest) {
  303. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  304. }
  305. // When a remote server returns no body with a status of 204, we shall not decode it.
  306. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  307. // FormatException when trying to decode an empty string.
  308. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  309. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumCountResponseDto',) as AlbumCountResponseDto;
  310. }
  311. return null;
  312. }
  313. /// Performs an HTTP 'GET /album/{albumId}' operation and returns the [Response].
  314. /// Parameters:
  315. ///
  316. /// * [String] albumId (required):
  317. ///
  318. /// * [String] key:
  319. Future<Response> getAlbumInfoWithHttpInfo(String albumId, { String? key, }) async {
  320. // ignore: prefer_const_declarations
  321. final path = r'/album/{albumId}'
  322. .replaceAll('{albumId}', albumId);
  323. // ignore: prefer_final_locals
  324. Object? postBody;
  325. final queryParams = <QueryParam>[];
  326. final headerParams = <String, String>{};
  327. final formParams = <String, String>{};
  328. if (key != null) {
  329. queryParams.addAll(_queryParams('', 'key', key));
  330. }
  331. const contentTypes = <String>[];
  332. return apiClient.invokeAPI(
  333. path,
  334. 'GET',
  335. queryParams,
  336. postBody,
  337. headerParams,
  338. formParams,
  339. contentTypes.isEmpty ? null : contentTypes.first,
  340. );
  341. }
  342. /// Parameters:
  343. ///
  344. /// * [String] albumId (required):
  345. ///
  346. /// * [String] key:
  347. Future<AlbumResponseDto?> getAlbumInfo(String albumId, { String? key, }) async {
  348. final response = await getAlbumInfoWithHttpInfo(albumId, key: key, );
  349. if (response.statusCode >= HttpStatus.badRequest) {
  350. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  351. }
  352. // When a remote server returns no body with a status of 204, we shall not decode it.
  353. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  354. // FormatException when trying to decode an empty string.
  355. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  356. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  357. }
  358. return null;
  359. }
  360. /// Performs an HTTP 'GET /album' operation and returns the [Response].
  361. /// Parameters:
  362. ///
  363. /// * [bool] shared:
  364. ///
  365. /// * [String] assetId:
  366. /// Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
  367. Future<Response> getAllAlbumsWithHttpInfo({ bool? shared, String? assetId, }) async {
  368. // ignore: prefer_const_declarations
  369. final path = r'/album';
  370. // ignore: prefer_final_locals
  371. Object? postBody;
  372. final queryParams = <QueryParam>[];
  373. final headerParams = <String, String>{};
  374. final formParams = <String, String>{};
  375. if (shared != null) {
  376. queryParams.addAll(_queryParams('', 'shared', shared));
  377. }
  378. if (assetId != null) {
  379. queryParams.addAll(_queryParams('', 'assetId', assetId));
  380. }
  381. const contentTypes = <String>[];
  382. return apiClient.invokeAPI(
  383. path,
  384. 'GET',
  385. queryParams,
  386. postBody,
  387. headerParams,
  388. formParams,
  389. contentTypes.isEmpty ? null : contentTypes.first,
  390. );
  391. }
  392. /// Parameters:
  393. ///
  394. /// * [bool] shared:
  395. ///
  396. /// * [String] assetId:
  397. /// Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
  398. Future<List<AlbumResponseDto>?> getAllAlbums({ bool? shared, String? assetId, }) async {
  399. final response = await getAllAlbumsWithHttpInfo( shared: shared, assetId: assetId, );
  400. if (response.statusCode >= HttpStatus.badRequest) {
  401. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  402. }
  403. // When a remote server returns no body with a status of 204, we shall not decode it.
  404. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  405. // FormatException when trying to decode an empty string.
  406. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  407. final responseBody = await _decodeBodyBytes(response);
  408. return (await apiClient.deserializeAsync(responseBody, 'List<AlbumResponseDto>') as List)
  409. .cast<AlbumResponseDto>()
  410. .toList();
  411. }
  412. return null;
  413. }
  414. /// Performs an HTTP 'DELETE /album/{albumId}/assets' operation and returns the [Response].
  415. /// Parameters:
  416. ///
  417. /// * [String] albumId (required):
  418. ///
  419. /// * [RemoveAssetsDto] removeAssetsDto (required):
  420. Future<Response> removeAssetFromAlbumWithHttpInfo(String albumId, RemoveAssetsDto removeAssetsDto,) async {
  421. // ignore: prefer_const_declarations
  422. final path = r'/album/{albumId}/assets'
  423. .replaceAll('{albumId}', albumId);
  424. // ignore: prefer_final_locals
  425. Object? postBody = removeAssetsDto;
  426. final queryParams = <QueryParam>[];
  427. final headerParams = <String, String>{};
  428. final formParams = <String, String>{};
  429. const contentTypes = <String>['application/json'];
  430. return apiClient.invokeAPI(
  431. path,
  432. 'DELETE',
  433. queryParams,
  434. postBody,
  435. headerParams,
  436. formParams,
  437. contentTypes.isEmpty ? null : contentTypes.first,
  438. );
  439. }
  440. /// Parameters:
  441. ///
  442. /// * [String] albumId (required):
  443. ///
  444. /// * [RemoveAssetsDto] removeAssetsDto (required):
  445. Future<AlbumResponseDto?> removeAssetFromAlbum(String albumId, RemoveAssetsDto removeAssetsDto,) async {
  446. final response = await removeAssetFromAlbumWithHttpInfo(albumId, removeAssetsDto,);
  447. if (response.statusCode >= HttpStatus.badRequest) {
  448. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  449. }
  450. // When a remote server returns no body with a status of 204, we shall not decode it.
  451. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  452. // FormatException when trying to decode an empty string.
  453. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  454. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  455. }
  456. return null;
  457. }
  458. /// Performs an HTTP 'DELETE /album/{albumId}/user/{userId}' operation and returns the [Response].
  459. /// Parameters:
  460. ///
  461. /// * [String] albumId (required):
  462. ///
  463. /// * [String] userId (required):
  464. Future<Response> removeUserFromAlbumWithHttpInfo(String albumId, String userId,) async {
  465. // ignore: prefer_const_declarations
  466. final path = r'/album/{albumId}/user/{userId}'
  467. .replaceAll('{albumId}', albumId)
  468. .replaceAll('{userId}', userId);
  469. // ignore: prefer_final_locals
  470. Object? postBody;
  471. final queryParams = <QueryParam>[];
  472. final headerParams = <String, String>{};
  473. final formParams = <String, String>{};
  474. const contentTypes = <String>[];
  475. return apiClient.invokeAPI(
  476. path,
  477. 'DELETE',
  478. queryParams,
  479. postBody,
  480. headerParams,
  481. formParams,
  482. contentTypes.isEmpty ? null : contentTypes.first,
  483. );
  484. }
  485. /// Parameters:
  486. ///
  487. /// * [String] albumId (required):
  488. ///
  489. /// * [String] userId (required):
  490. Future<void> removeUserFromAlbum(String albumId, String userId,) async {
  491. final response = await removeUserFromAlbumWithHttpInfo(albumId, userId,);
  492. if (response.statusCode >= HttpStatus.badRequest) {
  493. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  494. }
  495. }
  496. /// Performs an HTTP 'PATCH /album/{albumId}' operation and returns the [Response].
  497. /// Parameters:
  498. ///
  499. /// * [String] albumId (required):
  500. ///
  501. /// * [UpdateAlbumDto] updateAlbumDto (required):
  502. Future<Response> updateAlbumInfoWithHttpInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
  503. // ignore: prefer_const_declarations
  504. final path = r'/album/{albumId}'
  505. .replaceAll('{albumId}', albumId);
  506. // ignore: prefer_final_locals
  507. Object? postBody = updateAlbumDto;
  508. final queryParams = <QueryParam>[];
  509. final headerParams = <String, String>{};
  510. final formParams = <String, String>{};
  511. const contentTypes = <String>['application/json'];
  512. return apiClient.invokeAPI(
  513. path,
  514. 'PATCH',
  515. queryParams,
  516. postBody,
  517. headerParams,
  518. formParams,
  519. contentTypes.isEmpty ? null : contentTypes.first,
  520. );
  521. }
  522. /// Parameters:
  523. ///
  524. /// * [String] albumId (required):
  525. ///
  526. /// * [UpdateAlbumDto] updateAlbumDto (required):
  527. Future<AlbumResponseDto?> updateAlbumInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
  528. final response = await updateAlbumInfoWithHttpInfo(albumId, updateAlbumDto,);
  529. if (response.statusCode >= HttpStatus.badRequest) {
  530. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  531. }
  532. // When a remote server returns no body with a status of 204, we shall not decode it.
  533. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  534. // FormatException when trying to decode an empty string.
  535. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  536. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
  537. }
  538. return null;
  539. }
  540. }