shared_link_api.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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 SharedLinkApi {
  11. SharedLinkApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'PUT /shared-link/{id}/assets' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [String] id (required):
  17. ///
  18. /// * [AssetIdsDto] assetIdsDto (required):
  19. ///
  20. /// * [String] key:
  21. Future<Response> addSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto, { String? key, }) async {
  22. // ignore: prefer_const_declarations
  23. final path = r'/shared-link/{id}/assets'
  24. .replaceAll('{id}', id);
  25. // ignore: prefer_final_locals
  26. Object? postBody = assetIdsDto;
  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. /// * [AssetIdsDto] assetIdsDto (required):
  49. ///
  50. /// * [String] key:
  51. Future<List<AssetIdsResponseDto>?> addSharedLinkAssets(String id, AssetIdsDto assetIdsDto, { String? key, }) async {
  52. final response = await addSharedLinkAssetsWithHttpInfo(id, assetIdsDto, 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<AssetIdsResponseDto>') as List)
  62. .cast<AssetIdsResponseDto>()
  63. .toList();
  64. }
  65. return null;
  66. }
  67. /// Performs an HTTP 'POST /shared-link' operation and returns the [Response].
  68. /// Parameters:
  69. ///
  70. /// * [SharedLinkCreateDto] sharedLinkCreateDto (required):
  71. Future<Response> createSharedLinkWithHttpInfo(SharedLinkCreateDto sharedLinkCreateDto,) async {
  72. // ignore: prefer_const_declarations
  73. final path = r'/shared-link';
  74. // ignore: prefer_final_locals
  75. Object? postBody = sharedLinkCreateDto;
  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. 'POST',
  83. queryParams,
  84. postBody,
  85. headerParams,
  86. formParams,
  87. contentTypes.isEmpty ? null : contentTypes.first,
  88. );
  89. }
  90. /// Parameters:
  91. ///
  92. /// * [SharedLinkCreateDto] sharedLinkCreateDto (required):
  93. Future<SharedLinkResponseDto?> createSharedLink(SharedLinkCreateDto sharedLinkCreateDto,) async {
  94. final response = await createSharedLinkWithHttpInfo(sharedLinkCreateDto,);
  95. if (response.statusCode >= HttpStatus.badRequest) {
  96. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  97. }
  98. // When a remote server returns no body with a status of 204, we shall not decode it.
  99. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  100. // FormatException when trying to decode an empty string.
  101. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  102. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  103. }
  104. return null;
  105. }
  106. /// Performs an HTTP 'GET /shared-link' operation and returns the [Response].
  107. Future<Response> getAllSharedLinksWithHttpInfo() async {
  108. // ignore: prefer_const_declarations
  109. final path = r'/shared-link';
  110. // ignore: prefer_final_locals
  111. Object? postBody;
  112. final queryParams = <QueryParam>[];
  113. final headerParams = <String, String>{};
  114. final formParams = <String, String>{};
  115. const contentTypes = <String>[];
  116. return apiClient.invokeAPI(
  117. path,
  118. 'GET',
  119. queryParams,
  120. postBody,
  121. headerParams,
  122. formParams,
  123. contentTypes.isEmpty ? null : contentTypes.first,
  124. );
  125. }
  126. Future<List<SharedLinkResponseDto>?> getAllSharedLinks() async {
  127. final response = await getAllSharedLinksWithHttpInfo();
  128. if (response.statusCode >= HttpStatus.badRequest) {
  129. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  130. }
  131. // When a remote server returns no body with a status of 204, we shall not decode it.
  132. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  133. // FormatException when trying to decode an empty string.
  134. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  135. final responseBody = await _decodeBodyBytes(response);
  136. return (await apiClient.deserializeAsync(responseBody, 'List<SharedLinkResponseDto>') as List)
  137. .cast<SharedLinkResponseDto>()
  138. .toList();
  139. }
  140. return null;
  141. }
  142. /// Performs an HTTP 'GET /shared-link/me' operation and returns the [Response].
  143. /// Parameters:
  144. ///
  145. /// * [String] key:
  146. Future<Response> getMySharedLinkWithHttpInfo({ String? key, }) async {
  147. // ignore: prefer_const_declarations
  148. final path = r'/shared-link/me';
  149. // ignore: prefer_final_locals
  150. Object? postBody;
  151. final queryParams = <QueryParam>[];
  152. final headerParams = <String, String>{};
  153. final formParams = <String, String>{};
  154. if (key != null) {
  155. queryParams.addAll(_queryParams('', 'key', key));
  156. }
  157. const contentTypes = <String>[];
  158. return apiClient.invokeAPI(
  159. path,
  160. 'GET',
  161. queryParams,
  162. postBody,
  163. headerParams,
  164. formParams,
  165. contentTypes.isEmpty ? null : contentTypes.first,
  166. );
  167. }
  168. /// Parameters:
  169. ///
  170. /// * [String] key:
  171. Future<SharedLinkResponseDto?> getMySharedLink({ String? key, }) async {
  172. final response = await getMySharedLinkWithHttpInfo( key: key, );
  173. if (response.statusCode >= HttpStatus.badRequest) {
  174. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  175. }
  176. // When a remote server returns no body with a status of 204, we shall not decode it.
  177. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  178. // FormatException when trying to decode an empty string.
  179. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  180. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  181. }
  182. return null;
  183. }
  184. /// Performs an HTTP 'GET /shared-link/{id}' operation and returns the [Response].
  185. /// Parameters:
  186. ///
  187. /// * [String] id (required):
  188. Future<Response> getSharedLinkByIdWithHttpInfo(String id,) async {
  189. // ignore: prefer_const_declarations
  190. final path = r'/shared-link/{id}'
  191. .replaceAll('{id}', id);
  192. // ignore: prefer_final_locals
  193. Object? postBody;
  194. final queryParams = <QueryParam>[];
  195. final headerParams = <String, String>{};
  196. final formParams = <String, String>{};
  197. const contentTypes = <String>[];
  198. return apiClient.invokeAPI(
  199. path,
  200. 'GET',
  201. queryParams,
  202. postBody,
  203. headerParams,
  204. formParams,
  205. contentTypes.isEmpty ? null : contentTypes.first,
  206. );
  207. }
  208. /// Parameters:
  209. ///
  210. /// * [String] id (required):
  211. Future<SharedLinkResponseDto?> getSharedLinkById(String id,) async {
  212. final response = await getSharedLinkByIdWithHttpInfo(id,);
  213. if (response.statusCode >= HttpStatus.badRequest) {
  214. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  215. }
  216. // When a remote server returns no body with a status of 204, we shall not decode it.
  217. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  218. // FormatException when trying to decode an empty string.
  219. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  220. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  221. }
  222. return null;
  223. }
  224. /// Performs an HTTP 'DELETE /shared-link/{id}' operation and returns the [Response].
  225. /// Parameters:
  226. ///
  227. /// * [String] id (required):
  228. Future<Response> removeSharedLinkWithHttpInfo(String id,) async {
  229. // ignore: prefer_const_declarations
  230. final path = r'/shared-link/{id}'
  231. .replaceAll('{id}', id);
  232. // ignore: prefer_final_locals
  233. Object? postBody;
  234. final queryParams = <QueryParam>[];
  235. final headerParams = <String, String>{};
  236. final formParams = <String, String>{};
  237. const contentTypes = <String>[];
  238. return apiClient.invokeAPI(
  239. path,
  240. 'DELETE',
  241. queryParams,
  242. postBody,
  243. headerParams,
  244. formParams,
  245. contentTypes.isEmpty ? null : contentTypes.first,
  246. );
  247. }
  248. /// Parameters:
  249. ///
  250. /// * [String] id (required):
  251. Future<void> removeSharedLink(String id,) async {
  252. final response = await removeSharedLinkWithHttpInfo(id,);
  253. if (response.statusCode >= HttpStatus.badRequest) {
  254. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  255. }
  256. }
  257. /// Performs an HTTP 'DELETE /shared-link/{id}/assets' operation and returns the [Response].
  258. /// Parameters:
  259. ///
  260. /// * [String] id (required):
  261. ///
  262. /// * [AssetIdsDto] assetIdsDto (required):
  263. ///
  264. /// * [String] key:
  265. Future<Response> removeSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto, { String? key, }) async {
  266. // ignore: prefer_const_declarations
  267. final path = r'/shared-link/{id}/assets'
  268. .replaceAll('{id}', id);
  269. // ignore: prefer_final_locals
  270. Object? postBody = assetIdsDto;
  271. final queryParams = <QueryParam>[];
  272. final headerParams = <String, String>{};
  273. final formParams = <String, String>{};
  274. if (key != null) {
  275. queryParams.addAll(_queryParams('', 'key', key));
  276. }
  277. const contentTypes = <String>['application/json'];
  278. return apiClient.invokeAPI(
  279. path,
  280. 'DELETE',
  281. queryParams,
  282. postBody,
  283. headerParams,
  284. formParams,
  285. contentTypes.isEmpty ? null : contentTypes.first,
  286. );
  287. }
  288. /// Parameters:
  289. ///
  290. /// * [String] id (required):
  291. ///
  292. /// * [AssetIdsDto] assetIdsDto (required):
  293. ///
  294. /// * [String] key:
  295. Future<List<AssetIdsResponseDto>?> removeSharedLinkAssets(String id, AssetIdsDto assetIdsDto, { String? key, }) async {
  296. final response = await removeSharedLinkAssetsWithHttpInfo(id, assetIdsDto, key: key, );
  297. if (response.statusCode >= HttpStatus.badRequest) {
  298. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  299. }
  300. // When a remote server returns no body with a status of 204, we shall not decode it.
  301. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  302. // FormatException when trying to decode an empty string.
  303. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  304. final responseBody = await _decodeBodyBytes(response);
  305. return (await apiClient.deserializeAsync(responseBody, 'List<AssetIdsResponseDto>') as List)
  306. .cast<AssetIdsResponseDto>()
  307. .toList();
  308. }
  309. return null;
  310. }
  311. /// Performs an HTTP 'PATCH /shared-link/{id}' operation and returns the [Response].
  312. /// Parameters:
  313. ///
  314. /// * [String] id (required):
  315. ///
  316. /// * [SharedLinkEditDto] sharedLinkEditDto (required):
  317. Future<Response> updateSharedLinkWithHttpInfo(String id, SharedLinkEditDto sharedLinkEditDto,) async {
  318. // ignore: prefer_const_declarations
  319. final path = r'/shared-link/{id}'
  320. .replaceAll('{id}', id);
  321. // ignore: prefer_final_locals
  322. Object? postBody = sharedLinkEditDto;
  323. final queryParams = <QueryParam>[];
  324. final headerParams = <String, String>{};
  325. final formParams = <String, String>{};
  326. const contentTypes = <String>['application/json'];
  327. return apiClient.invokeAPI(
  328. path,
  329. 'PATCH',
  330. queryParams,
  331. postBody,
  332. headerParams,
  333. formParams,
  334. contentTypes.isEmpty ? null : contentTypes.first,
  335. );
  336. }
  337. /// Parameters:
  338. ///
  339. /// * [String] id (required):
  340. ///
  341. /// * [SharedLinkEditDto] sharedLinkEditDto (required):
  342. Future<SharedLinkResponseDto?> updateSharedLink(String id, SharedLinkEditDto sharedLinkEditDto,) async {
  343. final response = await updateSharedLinkWithHttpInfo(id, sharedLinkEditDto,);
  344. if (response.statusCode >= HttpStatus.badRequest) {
  345. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  346. }
  347. // When a remote server returns no body with a status of 204, we shall not decode it.
  348. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  349. // FormatException when trying to decode an empty string.
  350. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  351. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  352. }
  353. return null;
  354. }
  355. }