getHistoricalStatsForAccount static method
Future<DestinyHistoricalStatsAccountResultResponse>
getHistoricalStatsForAccount(
- HttpClient client,
- String destinyMembershipId,
- List<
DestinyStatsGroupType> groups, - BungieMembershipType membershipType,
Gets aggregate historical stats organized around each character for a given account.
Implementation
static Future<DestinyHistoricalStatsAccountResultResponse> getHistoricalStatsForAccount (
HttpClient client,
String destinyMembershipId,
List<DestinyStatsGroupType> groups,
BungieMembershipType membershipType,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _destinyMembershipId = '$destinyMembershipId';
final String _membershipType = '${membershipType.value}';
params['groups'] = groups.map((DestinyStatsGroupType groups)=>groups.value).toList();
final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/$_membershipType/Account/$_destinyMembershipId/Stats/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return DestinyHistoricalStatsAccountResultResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}