listChannels method

Future<ListChannelsOutput> listChannels({
  1. required String spaceId,
  2. int? maxResults,
  3. String? nextToken,
})

Returns the list of channel within a private re:Post with some information about each channel.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter spaceId : The unique ID of the private re:Post.

Parameter maxResults : The maximum number of channels to include in the results.

Parameter nextToken : The token for the next set of channel to return. You receive this token from a previous ListChannels operation.

Implementation

Future<ListChannelsOutput> listChannels({
  required String spaceId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/spaces/${Uri.encodeComponent(spaceId)}/channels',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListChannelsOutput.fromJson(response);
}