ChannelUserMessageSendApiRequest constructor
Null safety
Implementation
ChannelUserMessageSendApiRequest({
required UserMessageParams params,
required this.channelType,
required String channelUrl,
String? senderId,
bool markAsRead = false,
List<String>? additionalMentionedUserIds,
}) : super(userId: senderId) {
url = '${channelType.urlString}/$channelUrl/messages';
body = {
'message_type': CommandString.userMessage,
'user_id': senderId,
'mark_as_read': markAsRead,
if (additionalMentionedUserIds != null)
'mentioned_user_ids': additionalMentionedUserIds,
};
body.addAll(params.toJson());
body.removeWhere((key, value) => value == null);
}