getMembershipDataById static method
Future<UserMembershipDataResponse>
getMembershipDataById(
- HttpClient client,
- String membershipId,
- BungieMembershipType membershipType
Returns a list of accounts associated with the supplied membership ID and membership type. This will include all linked accounts (even when hidden) if supplied credentials permit it.
Implementation
static Future<UserMembershipDataResponse> getMembershipDataById (
HttpClient client,
String membershipId,
BungieMembershipType membershipType,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _membershipId = '$membershipId';
final String _membershipType = '${membershipType.value}';
final HttpClientConfig config = HttpClientConfig('GET', '/User/GetMembershipsById/$_membershipId/$_membershipType/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return UserMembershipDataResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}