getBulkReactions method

Future<Map<String, List<MmReaction>>?> getBulkReactions(
  1. List<String> requestBody
)

Bulk get the reaction for posts

Get a list of reactions made by all users to a given post. ##### Permissions Must have read_channel permission for the channel the post is in. Minimum server version: 5.8

Parameters:

Implementation

Future<Map<String, List<MmReaction>>?> getBulkReactions(
  List<String> requestBody,
) async {
  final response = await getBulkReactionsWithHttpInfo(
    requestBody,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw MmApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return Map<String, List<MmReaction>>.from(
      await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, List<MmReaction>>'),
    );
  }
  return null;
}