banMember static method
Future<Int32Response>
banMember(
- HttpClient client,
- String groupId,
- String membershipId,
- BungieMembershipType membershipType,
- GroupBanRequest body,
Bans the requested member from the requested group for the specified period of time.
Implementation
static Future<Int32Response> banMember (
HttpClient client,
String groupId,
String membershipId,
BungieMembershipType membershipType,
GroupBanRequest body
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _groupId = '$groupId';
final String _membershipId = '$membershipId';
final String _membershipType = '${membershipType.value}';
final HttpClientConfig config = HttpClientConfig('POST', '/GroupV2/$_groupId/Members/$_membershipType/$_membershipId/Ban/', params);
config.body = await body.asyncToJson();
config.bodyContentType = 'application/json';
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return Int32Response.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}