describeTopicPartitions method

Future<DescribeTopicPartitionsResponse> describeTopicPartitions({
  1. required String clusterArn,
  2. required String topicName,
  3. int? maxResults,
  4. String? nextToken,
})

Returns partition details of this topic on a MSK cluster.

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

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

Parameter topicName : The Kafka topic name that uniquely identifies the topic.

Parameter maxResults : The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.

Parameter nextToken : The paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request.

Implementation

Future<DescribeTopicPartitionsResponse> describeTopicPartitions({
  required String clusterArn,
  required String topicName,
  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:
        '/v1/clusters/${Uri.encodeComponent(clusterArn)}/topics/${Uri.encodeComponent(topicName)}/partitions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeTopicPartitionsResponse.fromJson(response);
}