shared_link_api.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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] password:
  146. ///
  147. /// * [String] token:
  148. ///
  149. /// * [String] key:
  150. Future<Response> getMySharedLinkWithHttpInfo({ String? password, String? token, String? key, }) async {
  151. // ignore: prefer_const_declarations
  152. final path = r'/shared-link/me';
  153. // ignore: prefer_final_locals
  154. Object? postBody;
  155. final queryParams = <QueryParam>[];
  156. final headerParams = <String, String>{};
  157. final formParams = <String, String>{};
  158. if (password != null) {
  159. queryParams.addAll(_queryParams('', 'password', password));
  160. }
  161. if (token != null) {
  162. queryParams.addAll(_queryParams('', 'token', token));
  163. }
  164. if (key != null) {
  165. queryParams.addAll(_queryParams('', 'key', key));
  166. }
  167. const contentTypes = <String>[];
  168. return apiClient.invokeAPI(
  169. path,
  170. 'GET',
  171. queryParams,
  172. postBody,
  173. headerParams,
  174. formParams,
  175. contentTypes.isEmpty ? null : contentTypes.first,
  176. );
  177. }
  178. /// Parameters:
  179. ///
  180. /// * [String] password:
  181. ///
  182. /// * [String] token:
  183. ///
  184. /// * [String] key:
  185. Future<SharedLinkResponseDto?> getMySharedLink({ String? password, String? token, String? key, }) async {
  186. final response = await getMySharedLinkWithHttpInfo( password: password, token: token, key: key, );
  187. if (response.statusCode >= HttpStatus.badRequest) {
  188. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  189. }
  190. // When a remote server returns no body with a status of 204, we shall not decode it.
  191. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  192. // FormatException when trying to decode an empty string.
  193. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  194. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  195. }
  196. return null;
  197. }
  198. /// Performs an HTTP 'GET /shared-link/{id}' operation and returns the [Response].
  199. /// Parameters:
  200. ///
  201. /// * [String] id (required):
  202. Future<Response> getSharedLinkByIdWithHttpInfo(String id,) async {
  203. // ignore: prefer_const_declarations
  204. final path = r'/shared-link/{id}'
  205. .replaceAll('{id}', id);
  206. // ignore: prefer_final_locals
  207. Object? postBody;
  208. final queryParams = <QueryParam>[];
  209. final headerParams = <String, String>{};
  210. final formParams = <String, String>{};
  211. const contentTypes = <String>[];
  212. return apiClient.invokeAPI(
  213. path,
  214. 'GET',
  215. queryParams,
  216. postBody,
  217. headerParams,
  218. formParams,
  219. contentTypes.isEmpty ? null : contentTypes.first,
  220. );
  221. }
  222. /// Parameters:
  223. ///
  224. /// * [String] id (required):
  225. Future<SharedLinkResponseDto?> getSharedLinkById(String id,) async {
  226. final response = await getSharedLinkByIdWithHttpInfo(id,);
  227. if (response.statusCode >= HttpStatus.badRequest) {
  228. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  229. }
  230. // When a remote server returns no body with a status of 204, we shall not decode it.
  231. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  232. // FormatException when trying to decode an empty string.
  233. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  234. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  235. }
  236. return null;
  237. }
  238. /// Performs an HTTP 'DELETE /shared-link/{id}' operation and returns the [Response].
  239. /// Parameters:
  240. ///
  241. /// * [String] id (required):
  242. Future<Response> removeSharedLinkWithHttpInfo(String id,) async {
  243. // ignore: prefer_const_declarations
  244. final path = r'/shared-link/{id}'
  245. .replaceAll('{id}', id);
  246. // ignore: prefer_final_locals
  247. Object? postBody;
  248. final queryParams = <QueryParam>[];
  249. final headerParams = <String, String>{};
  250. final formParams = <String, String>{};
  251. const contentTypes = <String>[];
  252. return apiClient.invokeAPI(
  253. path,
  254. 'DELETE',
  255. queryParams,
  256. postBody,
  257. headerParams,
  258. formParams,
  259. contentTypes.isEmpty ? null : contentTypes.first,
  260. );
  261. }
  262. /// Parameters:
  263. ///
  264. /// * [String] id (required):
  265. Future<void> removeSharedLink(String id,) async {
  266. final response = await removeSharedLinkWithHttpInfo(id,);
  267. if (response.statusCode >= HttpStatus.badRequest) {
  268. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  269. }
  270. }
  271. /// Performs an HTTP 'DELETE /shared-link/{id}/assets' operation and returns the [Response].
  272. /// Parameters:
  273. ///
  274. /// * [String] id (required):
  275. ///
  276. /// * [AssetIdsDto] assetIdsDto (required):
  277. ///
  278. /// * [String] key:
  279. Future<Response> removeSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto, { String? key, }) async {
  280. // ignore: prefer_const_declarations
  281. final path = r'/shared-link/{id}/assets'
  282. .replaceAll('{id}', id);
  283. // ignore: prefer_final_locals
  284. Object? postBody = assetIdsDto;
  285. final queryParams = <QueryParam>[];
  286. final headerParams = <String, String>{};
  287. final formParams = <String, String>{};
  288. if (key != null) {
  289. queryParams.addAll(_queryParams('', 'key', key));
  290. }
  291. const contentTypes = <String>['application/json'];
  292. return apiClient.invokeAPI(
  293. path,
  294. 'DELETE',
  295. queryParams,
  296. postBody,
  297. headerParams,
  298. formParams,
  299. contentTypes.isEmpty ? null : contentTypes.first,
  300. );
  301. }
  302. /// Parameters:
  303. ///
  304. /// * [String] id (required):
  305. ///
  306. /// * [AssetIdsDto] assetIdsDto (required):
  307. ///
  308. /// * [String] key:
  309. Future<List<AssetIdsResponseDto>?> removeSharedLinkAssets(String id, AssetIdsDto assetIdsDto, { String? key, }) async {
  310. final response = await removeSharedLinkAssetsWithHttpInfo(id, assetIdsDto, key: key, );
  311. if (response.statusCode >= HttpStatus.badRequest) {
  312. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  313. }
  314. // When a remote server returns no body with a status of 204, we shall not decode it.
  315. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  316. // FormatException when trying to decode an empty string.
  317. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  318. final responseBody = await _decodeBodyBytes(response);
  319. return (await apiClient.deserializeAsync(responseBody, 'List<AssetIdsResponseDto>') as List)
  320. .cast<AssetIdsResponseDto>()
  321. .toList();
  322. }
  323. return null;
  324. }
  325. /// Performs an HTTP 'PATCH /shared-link/{id}' operation and returns the [Response].
  326. /// Parameters:
  327. ///
  328. /// * [String] id (required):
  329. ///
  330. /// * [SharedLinkEditDto] sharedLinkEditDto (required):
  331. Future<Response> updateSharedLinkWithHttpInfo(String id, SharedLinkEditDto sharedLinkEditDto,) async {
  332. // ignore: prefer_const_declarations
  333. final path = r'/shared-link/{id}'
  334. .replaceAll('{id}', id);
  335. // ignore: prefer_final_locals
  336. Object? postBody = sharedLinkEditDto;
  337. final queryParams = <QueryParam>[];
  338. final headerParams = <String, String>{};
  339. final formParams = <String, String>{};
  340. const contentTypes = <String>['application/json'];
  341. return apiClient.invokeAPI(
  342. path,
  343. 'PATCH',
  344. queryParams,
  345. postBody,
  346. headerParams,
  347. formParams,
  348. contentTypes.isEmpty ? null : contentTypes.first,
  349. );
  350. }
  351. /// Parameters:
  352. ///
  353. /// * [String] id (required):
  354. ///
  355. /// * [SharedLinkEditDto] sharedLinkEditDto (required):
  356. Future<SharedLinkResponseDto?> updateSharedLink(String id, SharedLinkEditDto sharedLinkEditDto,) async {
  357. final response = await updateSharedLinkWithHttpInfo(id, sharedLinkEditDto,);
  358. if (response.statusCode >= HttpStatus.badRequest) {
  359. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  360. }
  361. // When a remote server returns no body with a status of 204, we shall not decode it.
  362. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  363. // FormatException when trying to decode an empty string.
  364. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  365. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  366. }
  367. return null;
  368. }
  369. }