addOptionalConversation static method
Future<Int64Response>
addOptionalConversation(
- HttpClient client,
- String groupId,
- GroupOptionalConversationAddRequest body
Add a new optional conversation/chat channel. Requires admin permissions to the group.
Implementation
static Future<Int64Response> addOptionalConversation (
HttpClient client,
String groupId,
GroupOptionalConversationAddRequest body
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _groupId = '$groupId';
final HttpClientConfig config = HttpClientConfig('POST', '/GroupV2/$_groupId/OptionalConversations/Add/', params);
config.body = await body.asyncToJson();
config.bodyContentType = 'application/json';
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return Int64Response.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}