listGroups method

  1. @override
Future<GroupList> listGroups({
  1. required Session session,
  2. String? name,
  3. String? cursor,
  4. String? langTag,
  5. int? members,
  6. bool? open,
  7. int limit = defaultLimit,
})
override

Listing and filtering groups

Groups can be listed using a number of optional filters: name, lang_tag, open and (number of) members. If all filters are omitted, the operation will list all existing groups.

Players use group listing and filtering to search for existing groups to join.

The name filter is case insensitive and mutually exclusive to the remainder filters. It can be useful to help the user look for a specific group by name, and it supports the % wildcard for partial matches as a suffix. As an example, looking for a group that is prefixed with the “Persian” word would be written as persian% name filter.

Implementation

@override
Future<model.GroupList> listGroups({
  required model.Session session,
  String? name,
  String? cursor,
  String? langTag,
  int? members,
  bool? open,
  int limit = defaultLimit,
}) async {
  _session = session;

  final res = await _api.v2GroupGet(
    cursor: cursor,
    langTag: langTag,
    limit: limit,
    members: members,
    name: name,
    open: open,
  );

  return model.GroupList.fromJson(res.body!.toJson());
}