getFlaggedPostsForUser method
Get a list of flagged posts
Get a page of flagged posts of a user provided user id string. Selects from a channel, team, or all flagged posts by a user. Will only return posts from channels in which the user is member. ##### Permissions Must be user or have manage_system
permission.
Parameters:
Implementation
Future<List<MmPostList>?> getFlaggedPostsForUser(
String userId, {
String? teamId,
String? channelId,
int? page,
int? perPage,
}) async {
final response = await getFlaggedPostsForUserWithHttpInfo(
userId,
teamId: teamId,
channelId: channelId,
page: page,
perPage: perPage,
);
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) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<MmPostList>') as List).cast<MmPostList>().toList();
}
return null;
}