o_auth_api.dart 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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 OAuthApi {
  11. OAuthApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. ///
  14. ///
  15. /// Note: This method returns the HTTP [Response].
  16. ///
  17. /// Parameters:
  18. ///
  19. /// * [OAuthCallbackDto] oAuthCallbackDto (required):
  20. Future<Response> callbackWithHttpInfo(OAuthCallbackDto oAuthCallbackDto,) async {
  21. // ignore: prefer_const_declarations
  22. final path = r'/oauth/callback';
  23. // ignore: prefer_final_locals
  24. Object? postBody = oAuthCallbackDto;
  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. 'POST',
  32. queryParams,
  33. postBody,
  34. headerParams,
  35. formParams,
  36. contentTypes.isEmpty ? null : contentTypes.first,
  37. );
  38. }
  39. ///
  40. ///
  41. /// Parameters:
  42. ///
  43. /// * [OAuthCallbackDto] oAuthCallbackDto (required):
  44. Future<LoginResponseDto?> callback(OAuthCallbackDto oAuthCallbackDto,) async {
  45. final response = await callbackWithHttpInfo(oAuthCallbackDto,);
  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), 'LoginResponseDto',) as LoginResponseDto;
  54. }
  55. return null;
  56. }
  57. ///
  58. ///
  59. /// Note: This method returns the HTTP [Response].
  60. ///
  61. /// Parameters:
  62. ///
  63. /// * [OAuthConfigDto] oAuthConfigDto (required):
  64. Future<Response> generateConfigWithHttpInfo(OAuthConfigDto oAuthConfigDto,) async {
  65. // ignore: prefer_const_declarations
  66. final path = r'/oauth/config';
  67. // ignore: prefer_final_locals
  68. Object? postBody = oAuthConfigDto;
  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. 'POST',
  76. queryParams,
  77. postBody,
  78. headerParams,
  79. formParams,
  80. contentTypes.isEmpty ? null : contentTypes.first,
  81. );
  82. }
  83. ///
  84. ///
  85. /// Parameters:
  86. ///
  87. /// * [OAuthConfigDto] oAuthConfigDto (required):
  88. Future<OAuthConfigResponseDto?> generateConfig(OAuthConfigDto oAuthConfigDto,) async {
  89. final response = await generateConfigWithHttpInfo(oAuthConfigDto,);
  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), 'OAuthConfigResponseDto',) as OAuthConfigResponseDto;
  98. }
  99. return null;
  100. }
  101. ///
  102. ///
  103. /// Note: This method returns the HTTP [Response].
  104. ///
  105. /// Parameters:
  106. ///
  107. /// * [OAuthCallbackDto] oAuthCallbackDto (required):
  108. Future<Response> linkWithHttpInfo(OAuthCallbackDto oAuthCallbackDto,) async {
  109. // ignore: prefer_const_declarations
  110. final path = r'/oauth/link';
  111. // ignore: prefer_final_locals
  112. Object? postBody = oAuthCallbackDto;
  113. final queryParams = <QueryParam>[];
  114. final headerParams = <String, String>{};
  115. final formParams = <String, String>{};
  116. const contentTypes = <String>['application/json'];
  117. return apiClient.invokeAPI(
  118. path,
  119. 'POST',
  120. queryParams,
  121. postBody,
  122. headerParams,
  123. formParams,
  124. contentTypes.isEmpty ? null : contentTypes.first,
  125. );
  126. }
  127. ///
  128. ///
  129. /// Parameters:
  130. ///
  131. /// * [OAuthCallbackDto] oAuthCallbackDto (required):
  132. Future<UserResponseDto?> link(OAuthCallbackDto oAuthCallbackDto,) async {
  133. final response = await linkWithHttpInfo(oAuthCallbackDto,);
  134. if (response.statusCode >= HttpStatus.badRequest) {
  135. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  136. }
  137. // When a remote server returns no body with a status of 204, we shall not decode it.
  138. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  139. // FormatException when trying to decode an empty string.
  140. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  141. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  142. }
  143. return null;
  144. }
  145. ///
  146. ///
  147. /// Note: This method returns the HTTP [Response].
  148. Future<Response> mobileRedirectWithHttpInfo() async {
  149. // ignore: prefer_const_declarations
  150. final path = r'/oauth/mobile-redirect';
  151. // ignore: prefer_final_locals
  152. Object? postBody;
  153. final queryParams = <QueryParam>[];
  154. final headerParams = <String, String>{};
  155. final formParams = <String, String>{};
  156. const contentTypes = <String>[];
  157. return apiClient.invokeAPI(
  158. path,
  159. 'GET',
  160. queryParams,
  161. postBody,
  162. headerParams,
  163. formParams,
  164. contentTypes.isEmpty ? null : contentTypes.first,
  165. );
  166. }
  167. ///
  168. Future<void> mobileRedirect() async {
  169. final response = await mobileRedirectWithHttpInfo();
  170. if (response.statusCode >= HttpStatus.badRequest) {
  171. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  172. }
  173. }
  174. ///
  175. ///
  176. /// Note: This method returns the HTTP [Response].
  177. Future<Response> unlinkWithHttpInfo() async {
  178. // ignore: prefer_const_declarations
  179. final path = r'/oauth/unlink';
  180. // ignore: prefer_final_locals
  181. Object? postBody;
  182. final queryParams = <QueryParam>[];
  183. final headerParams = <String, String>{};
  184. final formParams = <String, String>{};
  185. const contentTypes = <String>[];
  186. return apiClient.invokeAPI(
  187. path,
  188. 'POST',
  189. queryParams,
  190. postBody,
  191. headerParams,
  192. formParams,
  193. contentTypes.isEmpty ? null : contentTypes.first,
  194. );
  195. }
  196. ///
  197. Future<UserResponseDto?> unlink() async {
  198. final response = await unlinkWithHttpInfo();
  199. if (response.statusCode >= HttpStatus.badRequest) {
  200. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  201. }
  202. // When a remote server returns no body with a status of 204, we shall not decode it.
  203. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  204. // FormatException when trying to decode an empty string.
  205. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  206. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
  207. }
  208. return null;
  209. }
  210. }