listChannels method

Future<ListChannelsResponse> listChannels({
  1. required String clusterArn,
  2. int? maxResults,
  3. String? nextToken,
  4. String? topicNameFilter,
})

Returns the list of channels in a cluster.

May throw BadRequestException. May throw ForbiddenException. May throw InternalServerErrorException. May throw NotFoundException. May throw ServiceUnavailableException. May throw TooManyRequestsException. May throw UnauthorizedException.

Parameter clusterArn : The Amazon Resource Name (ARN) that uniquely identifies the cluster.

Parameter maxResults : Maximum number of channels to return in a single response.

Parameter nextToken : If the response of ListChannels is truncated, it returns a nextToken in the response. This nextToken should be sent in the subsequent request to ListChannels.

Parameter topicNameFilter : Filters results to channels whose topic name matches the specified value.

Implementation

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