getTopChannelsForTeamWithHttpInfo method

Future<Response> getTopChannelsForTeamWithHttpInfo(
  1. String teamId,
  2. String timeRange, {
  3. int? page,
  4. int? perPage,
})

Get a list of the top channels for a team.

Get a list of the top public and private channels (the user is a member of) for a given team. ##### Permissions Must have view_team permission for the team.

Note: This method returns the HTTP Response.

Parameters:

  • String teamId (required): Team GUID

  • String timeRange (required): Time range can be "today", "7_day", or "28_day". - today: channels with posts on the current day. - 7_day: channels with posts in the last 7 days. - 28_day: channels with posts in the last 28 days.

  • int page: The page to select.

  • int perPage: The number of items per page, up to a maximum of 200.

Implementation

Future<Response> getTopChannelsForTeamWithHttpInfo(
  String teamId,
  String timeRange, {
  int? page,
  int? perPage,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/teams/{team_id}/top/channels'.replaceAll('{team_id}', teamId);

  // ignore: prefer_final_locals
  Object? postBody;

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

  queryParams.addAll(_queryParams('', 'time_range', timeRange));
  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,
  );
}