activity_api.dart 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 ActivityApi {
  11. ActivityApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
  12. final ApiClient apiClient;
  13. /// Performs an HTTP 'POST /activity' operation and returns the [Response].
  14. /// Parameters:
  15. ///
  16. /// * [ActivityCreateDto] activityCreateDto (required):
  17. Future<Response> createActivityWithHttpInfo(ActivityCreateDto activityCreateDto,) async {
  18. // ignore: prefer_const_declarations
  19. final path = r'/activity';
  20. // ignore: prefer_final_locals
  21. Object? postBody = activityCreateDto;
  22. final queryParams = <QueryParam>[];
  23. final headerParams = <String, String>{};
  24. final formParams = <String, String>{};
  25. const contentTypes = <String>['application/json'];
  26. return apiClient.invokeAPI(
  27. path,
  28. 'POST',
  29. queryParams,
  30. postBody,
  31. headerParams,
  32. formParams,
  33. contentTypes.isEmpty ? null : contentTypes.first,
  34. );
  35. }
  36. /// Parameters:
  37. ///
  38. /// * [ActivityCreateDto] activityCreateDto (required):
  39. Future<ActivityResponseDto?> createActivity(ActivityCreateDto activityCreateDto,) async {
  40. final response = await createActivityWithHttpInfo(activityCreateDto,);
  41. if (response.statusCode >= HttpStatus.badRequest) {
  42. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  43. }
  44. // When a remote server returns no body with a status of 204, we shall not decode it.
  45. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  46. // FormatException when trying to decode an empty string.
  47. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  48. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ActivityResponseDto',) as ActivityResponseDto;
  49. }
  50. return null;
  51. }
  52. /// Performs an HTTP 'DELETE /activity/{id}' operation and returns the [Response].
  53. /// Parameters:
  54. ///
  55. /// * [String] id (required):
  56. Future<Response> deleteActivityWithHttpInfo(String id,) async {
  57. // ignore: prefer_const_declarations
  58. final path = r'/activity/{id}'
  59. .replaceAll('{id}', id);
  60. // ignore: prefer_final_locals
  61. Object? postBody;
  62. final queryParams = <QueryParam>[];
  63. final headerParams = <String, String>{};
  64. final formParams = <String, String>{};
  65. const contentTypes = <String>[];
  66. return apiClient.invokeAPI(
  67. path,
  68. 'DELETE',
  69. queryParams,
  70. postBody,
  71. headerParams,
  72. formParams,
  73. contentTypes.isEmpty ? null : contentTypes.first,
  74. );
  75. }
  76. /// Parameters:
  77. ///
  78. /// * [String] id (required):
  79. Future<void> deleteActivity(String id,) async {
  80. final response = await deleteActivityWithHttpInfo(id,);
  81. if (response.statusCode >= HttpStatus.badRequest) {
  82. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  83. }
  84. }
  85. /// Performs an HTTP 'GET /activity' operation and returns the [Response].
  86. /// Parameters:
  87. ///
  88. /// * [String] albumId (required):
  89. ///
  90. /// * [String] assetId:
  91. ///
  92. /// * [ReactionType] type:
  93. ///
  94. /// * [String] userId:
  95. Future<Response> getActivitiesWithHttpInfo(String albumId, { String? assetId, ReactionType? type, String? userId, }) async {
  96. // ignore: prefer_const_declarations
  97. final path = r'/activity';
  98. // ignore: prefer_final_locals
  99. Object? postBody;
  100. final queryParams = <QueryParam>[];
  101. final headerParams = <String, String>{};
  102. final formParams = <String, String>{};
  103. queryParams.addAll(_queryParams('', 'albumId', albumId));
  104. if (assetId != null) {
  105. queryParams.addAll(_queryParams('', 'assetId', assetId));
  106. }
  107. if (type != null) {
  108. queryParams.addAll(_queryParams('', 'type', type));
  109. }
  110. if (userId != null) {
  111. queryParams.addAll(_queryParams('', 'userId', userId));
  112. }
  113. const contentTypes = <String>[];
  114. return apiClient.invokeAPI(
  115. path,
  116. 'GET',
  117. queryParams,
  118. postBody,
  119. headerParams,
  120. formParams,
  121. contentTypes.isEmpty ? null : contentTypes.first,
  122. );
  123. }
  124. /// Parameters:
  125. ///
  126. /// * [String] albumId (required):
  127. ///
  128. /// * [String] assetId:
  129. ///
  130. /// * [ReactionType] type:
  131. ///
  132. /// * [String] userId:
  133. Future<List<ActivityResponseDto>?> getActivities(String albumId, { String? assetId, ReactionType? type, String? userId, }) async {
  134. final response = await getActivitiesWithHttpInfo(albumId, assetId: assetId, type: type, userId: userId, );
  135. if (response.statusCode >= HttpStatus.badRequest) {
  136. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  137. }
  138. // When a remote server returns no body with a status of 204, we shall not decode it.
  139. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  140. // FormatException when trying to decode an empty string.
  141. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  142. final responseBody = await _decodeBodyBytes(response);
  143. return (await apiClient.deserializeAsync(responseBody, 'List<ActivityResponseDto>') as List)
  144. .cast<ActivityResponseDto>()
  145. .toList();
  146. }
  147. return null;
  148. }
  149. /// Performs an HTTP 'GET /activity/statistics' operation and returns the [Response].
  150. /// Parameters:
  151. ///
  152. /// * [String] albumId (required):
  153. ///
  154. /// * [String] assetId:
  155. Future<Response> getActivityStatisticsWithHttpInfo(String albumId, { String? assetId, }) async {
  156. // ignore: prefer_const_declarations
  157. final path = r'/activity/statistics';
  158. // ignore: prefer_final_locals
  159. Object? postBody;
  160. final queryParams = <QueryParam>[];
  161. final headerParams = <String, String>{};
  162. final formParams = <String, String>{};
  163. queryParams.addAll(_queryParams('', 'albumId', albumId));
  164. if (assetId != null) {
  165. queryParams.addAll(_queryParams('', 'assetId', assetId));
  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] albumId (required):
  181. ///
  182. /// * [String] assetId:
  183. Future<ActivityStatisticsResponseDto?> getActivityStatistics(String albumId, { String? assetId, }) async {
  184. final response = await getActivityStatisticsWithHttpInfo(albumId, assetId: assetId, );
  185. if (response.statusCode >= HttpStatus.badRequest) {
  186. throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  187. }
  188. // When a remote server returns no body with a status of 204, we shall not decode it.
  189. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  190. // FormatException when trying to decode an empty string.
  191. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
  192. return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ActivityStatisticsResponseDto',) as ActivityStatisticsResponseDto;
  193. }
  194. return null;
  195. }
  196. }