getSubscriptions method

Future<Subscription> getSubscriptions(
  1. Authentication authentication
)

Implementation

Future<Subscription> getSubscriptions(Authentication authentication) async {
  http.Response response = await _httpService.get(
    '/api/v1/subscriptions.get',
    authentication,
  );

  if (response.statusCode == 200) {
    if (response.body.isNotEmpty == true) {
      return Subscription.fromMap(jsonDecode(response.body));
    } else {
      return Subscription();
    }
  }
  throw RocketChatException(response.body);
}