deleteGroup method

Future<void> deleteGroup(
  1. String groupId
)

Deletes an existing user device group.

Throws an exception if the group doesn't exist.

Implementation

Future<void> deleteGroup(String groupId) async {
  final uri = _urlBase.getPath(_devGroupBase, {
    'group_id': groupId,
  });

  final resp = await delete(uri, headers: {
    URLBase.authHeader: accessToken,
  });
  final Map<String, dynamic> bodyResp =
      await JsonIsolate().decodeJson(resp.body);
  if (resp.statusCode != 200) {
    throw bodyResp['description'];
  }
}