getChannelMembersWithHttpInfo method

Future<Response> getChannelMembersWithHttpInfo(
  1. String channelId, {
  2. int? page,
  3. int? perPage,
})

Get channel members

Get a page of members for a channel. ##### Permissions read_channel permission for the channel.

Note: This method returns the HTTP Response.

Parameters:

  • String channelId (required): Channel GUID

  • int page: The page to select.

  • int perPage: The number of members per page. There is a maximum limit of 200 members.

Implementation

Future<Response> getChannelMembersWithHttpInfo(
  String channelId, {
  int? page,
  int? perPage,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/channels/{channel_id}/members'.replaceAll('{channel_id}', channelId);

  // ignore: prefer_final_locals
  Object? postBody;

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

  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,
  );
}