listTournaments method

  1. @override
Future<TournamentList> listTournaments({
  1. required Session session,
  2. int? categoryStart,
  3. int? categoryEnd,
  4. String? cursor,
  5. DateTime? startTime,
  6. DateTime? endTime,
  7. int limit = defaultLimit,
})
override

Listing tournaments

Players can list and filter tournaments with various criteria.

Implementation

@override
Future<model.TournamentList> listTournaments({
  required model.Session session,
  int? categoryStart,
  int? categoryEnd,
  String? cursor,
  DateTime? startTime,
  DateTime? endTime,
  int limit = defaultLimit,
}) async {
  final res = await _client.listTournaments(
    api.ListTournamentsRequest(
      categoryEnd: api.UInt32Value(value: categoryEnd),
      categoryStart: api.UInt32Value(value: categoryStart),
      cursor: cursor,
      startTime: api.UInt32Value(value: startTime != null ? startTime.millisecondsSinceEpoch ~/ 1000 : null),
      endTime: api.UInt32Value(value: endTime != null ? endTime.millisecondsSinceEpoch ~/ 1000 : null),
      limit: api.Int32Value(value: limit),
    ),
    options: _getSessionCallOptions(session),
  );

  return model.TournamentList.fromDto(res);
}