getActivityHistory static method

Future<DestinyActivityHistoryResultsResponse> getActivityHistory(
  1. HttpClient client,
  2. String characterId,
  3. int count,
  4. String destinyMembershipId,
  5. BungieMembershipType membershipType,
  6. DestinyActivityModeType mode,
  7. int page,
)

Gets activity history stats for indicated character.

Implementation

static Future<DestinyActivityHistoryResultsResponse> getActivityHistory (
    HttpClient client,
    String characterId,
    int count,
    String destinyMembershipId,
    BungieMembershipType membershipType,
    DestinyActivityModeType mode,
    int page,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _characterId = '$characterId';
    final String _destinyMembershipId = '$destinyMembershipId';
    final String _membershipType = '${membershipType.value}';
    params['count'] = count;
    params['mode'] = mode.value;
    params['page'] = page;
    final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/$_membershipType/Account/$_destinyMembershipId/Character/$_characterId/Stats/Activities/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyActivityHistoryResultsResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}