getLeaderboards static method

Future<DestinyLeaderboardResultsResponse> getLeaderboards(
  1. HttpClient client,
  2. String destinyMembershipId,
  3. int maxtop,
  4. BungieMembershipType membershipType,
  5. String modes,
  6. String statid,
)

Gets leaderboards with the signed in user's friends and the supplied destinyMembershipId as the focus. PREVIEW: This endpoint has not yet been implemented. It is being returned for a preview of future functionality, and for public comment/suggestion/preparation.

Implementation

static Future<DestinyLeaderboardResultsResponse> getLeaderboards (
    HttpClient client,
    String destinyMembershipId,
    int maxtop,
    BungieMembershipType membershipType,
    String modes,
    String statid,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _destinyMembershipId = '$destinyMembershipId';
    final String _membershipType = '${membershipType.value}';
    params['maxtop'] = maxtop;
    params['modes'] = modes;
    params['statid'] = statid;
    final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/$_membershipType/Account/$_destinyMembershipId/Stats/Leaderboards/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyLeaderboardResultsResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}