getFlaggedPostsForUserWithHttpInfo method

Future<Response> getFlaggedPostsForUserWithHttpInfo(
  1. String userId, {
  2. String? teamId,
  3. String? channelId,
  4. int? page,
  5. int? perPage,
})

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.

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required): ID of the user

  • String teamId: Team ID

  • String channelId: Channel ID

  • int page: The page to select

  • int perPage: The number of posts per page

Implementation

Future<Response> getFlaggedPostsForUserWithHttpInfo(
  String userId, {
  String? teamId,
  String? channelId,
  int? page,
  int? perPage,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/users/{user_id}/posts/flagged'.replaceAll('{user_id}', userId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (teamId != null) {
    queryParams.addAll(_queryParams('', 'team_id', teamId));
  }
  if (channelId != null) {
    queryParams.addAll(_queryParams('', 'channel_id', channelId));
  }
  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (perPage != null) {
    queryParams.addAll(_queryParams('', 'per_page', perPage));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}