listStreams method

Future<ListStreamsOutput> listStreams({
  1. int? maxResults,
  2. String? nextToken,
  3. StreamNameCondition? streamNameCondition,
})

Returns an array of StreamInfo objects. Each object describes a stream. To retrieve only streams that satisfy a specific condition, you can specify a StreamNameCondition.

May throw ClientLimitExceededException. May throw InvalidArgumentException.

Parameter maxResults : The maximum number of streams to return in the response. The default is 10,000.

Parameter nextToken : If you specify this parameter, when the result of a ListStreams operation is truncated, the call returns the NextToken in the response. To get another batch of streams, provide this token in your next request.

Parameter streamNameCondition : Optional: Returns only streams that satisfy a specific condition. Currently, you can specify only the prefix of a stream name as a condition.

Implementation

Future<ListStreamsOutput> listStreams({
  int? maxResults,
  String? nextToken,
  StreamNameCondition? streamNameCondition,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    512,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (streamNameCondition != null)
      'StreamNameCondition': streamNameCondition,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/listStreams',
    exceptionFnMap: _exceptionFns,
  );
  return ListStreamsOutput.fromJson(response);
}