getUsers method

Future<Response> getUsers({
  1. int? limit,
  2. String? cursor,
  3. bool? includeRole,
  4. String? projectId,
})

Retrieve all users

Implementation

Future<Response> getUsers({
  int? limit,
  String? cursor,
  bool? includeRole,
  String? projectId,
}) async {
  try {
    final response = await _dio.get(
      '/users',
      queryParameters: {
        if (limit != null) 'limit': limit,
        if (cursor != null) 'cursor': cursor,
        if (includeRole != null) 'includeRole': includeRole,
        if (projectId != null) 'projectId': projectId,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to retrieve users: ${e.message}');
  }
}