share_api.dart 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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 ShareApi {
  11. ShareApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. ///
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [String] id (required):
  20. ///
  21. /// * [EditSharedLinkDto] editSharedLinkDto (required):
  22. Future<Response> editSharedLinkWithHttpInfo(String id, EditSharedLinkDto editSharedLinkDto,) async {
  23. // ignore: prefer_const_declarations
  24. final path = r'/share/{id}'
  25. .replaceAll('{id}', id);
  26. // ignore: prefer_final_locals
  27. Object? postBody = editSharedLinkDto;
  28. final queryParams = <QueryParam>[];
  29. final headerParams = <String, String>{};
  30. final formParams = <String, String>{};
  31. const contentTypes = <String>['application/json'];
  32. return apiClient.invokeAPI(
  33. path,
  34. 'PATCH',
  35. queryParams,
  36. postBody,
  37. headerParams,
  38. formParams,
  39. contentTypes.isEmpty ? null : contentTypes.first,
  40. );
  41. }
  42. ///
  43. ///
  44. /// Parameters:
  45. ///
  46. /// * [String] id (required):
  47. ///
  48. /// * [EditSharedLinkDto] editSharedLinkDto (required):
  49. Future<SharedLinkResponseDto?> editSharedLink(String id, EditSharedLinkDto editSharedLinkDto,) async {
  50. final response = await editSharedLinkWithHttpInfo(id, editSharedLinkDto,);
  51. if (response.statusCode >= HttpStatus.badRequest) {
  52. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  53. }
  54. // When a remote server returns no body with a status of 204, we shall not decode it.
  55. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  56. // FormatException when trying to decode an empty string.
  57. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  58. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  59. }
  60. return null;
  61. }
  62. ///
  63. ///
  64. /// Note: This method returns the HTTP [Response].
  65. Future<Response> getAllSharedLinksWithHttpInfo() async {
  66. // ignore: prefer_const_declarations
  67. final path = r'/share';
  68. // ignore: prefer_final_locals
  69. Object? postBody;
  70. final queryParams = <QueryParam>[];
  71. final headerParams = <String, String>{};
  72. final formParams = <String, String>{};
  73. const contentTypes = <String>[];
  74. return apiClient.invokeAPI(
  75. path,
  76. 'GET',
  77. queryParams,
  78. postBody,
  79. headerParams,
  80. formParams,
  81. contentTypes.isEmpty ? null : contentTypes.first,
  82. );
  83. }
  84. ///
  85. Future<List<SharedLinkResponseDto>?> getAllSharedLinks() async {
  86. final response = await getAllSharedLinksWithHttpInfo();
  87. if (response.statusCode >= HttpStatus.badRequest) {
  88. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  89. }
  90. // When a remote server returns no body with a status of 204, we shall not decode it.
  91. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  92. // FormatException when trying to decode an empty string.
  93. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  94. final responseBody = await _decodeBodyBytes(response);
  95. return (await apiClient.deserializeAsync(responseBody, 'List<SharedLinkResponseDto>') as List)
  96. .cast<SharedLinkResponseDto>()
  97. .toList();
  98. }
  99. return null;
  100. }
  101. ///
  102. ///
  103. /// Note: This method returns the HTTP [Response].
  104. Future<Response> getMySharedLinkWithHttpInfo() async {
  105. // ignore: prefer_const_declarations
  106. final path = r'/share/me';
  107. // ignore: prefer_final_locals
  108. Object? postBody;
  109. final queryParams = <QueryParam>[];
  110. final headerParams = <String, String>{};
  111. final formParams = <String, String>{};
  112. const contentTypes = <String>[];
  113. return apiClient.invokeAPI(
  114. path,
  115. 'GET',
  116. queryParams,
  117. postBody,
  118. headerParams,
  119. formParams,
  120. contentTypes.isEmpty ? null : contentTypes.first,
  121. );
  122. }
  123. ///
  124. Future<SharedLinkResponseDto?> getMySharedLink() async {
  125. final response = await getMySharedLinkWithHttpInfo();
  126. if (response.statusCode >= HttpStatus.badRequest) {
  127. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  128. }
  129. // When a remote server returns no body with a status of 204, we shall not decode it.
  130. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  131. // FormatException when trying to decode an empty string.
  132. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  133. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  134. }
  135. return null;
  136. }
  137. ///
  138. ///
  139. /// Note: This method returns the HTTP [Response].
  140. ///
  141. /// Parameters:
  142. ///
  143. /// * [String] id (required):
  144. Future<Response> getSharedLinkByIdWithHttpInfo(String id,) async {
  145. // ignore: prefer_const_declarations
  146. final path = r'/share/{id}'
  147. .replaceAll('{id}', id);
  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. 'GET',
  157. queryParams,
  158. postBody,
  159. headerParams,
  160. formParams,
  161. contentTypes.isEmpty ? null : contentTypes.first,
  162. );
  163. }
  164. ///
  165. ///
  166. /// Parameters:
  167. ///
  168. /// * [String] id (required):
  169. Future<SharedLinkResponseDto?> getSharedLinkById(String id,) async {
  170. final response = await getSharedLinkByIdWithHttpInfo(id,);
  171. if (response.statusCode >= HttpStatus.badRequest) {
  172. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  173. }
  174. // When a remote server returns no body with a status of 204, we shall not decode it.
  175. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  176. // FormatException when trying to decode an empty string.
  177. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  178. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
  179. }
  180. return null;
  181. }
  182. ///
  183. ///
  184. /// Note: This method returns the HTTP [Response].
  185. ///
  186. /// Parameters:
  187. ///
  188. /// * [String] id (required):
  189. Future<Response> removeSharedLinkWithHttpInfo(String id,) async {
  190. // ignore: prefer_const_declarations
  191. final path = r'/share/{id}'
  192. .replaceAll('{id}', id);
  193. // ignore: prefer_final_locals
  194. Object? postBody;
  195. final queryParams = <QueryParam>[];
  196. final headerParams = <String, String>{};
  197. final formParams = <String, String>{};
  198. const contentTypes = <String>[];
  199. return apiClient.invokeAPI(
  200. path,
  201. 'DELETE',
  202. queryParams,
  203. postBody,
  204. headerParams,
  205. formParams,
  206. contentTypes.isEmpty ? null : contentTypes.first,
  207. );
  208. }
  209. ///
  210. ///
  211. /// Parameters:
  212. ///
  213. /// * [String] id (required):
  214. Future<String?> removeSharedLink(String id,) async {
  215. final response = await removeSharedLinkWithHttpInfo(id,);
  216. if (response.statusCode >= HttpStatus.badRequest) {
  217. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  218. }
  219. // When a remote server returns no body with a status of 204, we shall not decode it.
  220. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  221. // FormatException when trying to decode an empty string.
  222. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  223. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
  224. }
  225. return null;
  226. }
  227. }