describeStream method

Future<DescribeStreamOutput> describeStream({
  1. String? exclusiveStartShardId,
  2. int? limit,
  3. String? streamARN,
  4. String? streamId,
  5. String? streamName,
})

Describes the specified Kinesis data stream. The information returned includes the stream name, Amazon Resource Name (ARN), creation time, enhanced metric configuration, and shard map. The shard map is an array of shard objects. For each shard object, there is the hash key and sequence number ranges that the shard spans, and the IDs of any earlier shards that played in a role in creating the shard. Every record ingested in the stream is identified by a sequence number, which is assigned when the record is put into the stream.

You can limit the number of shards returned by each call. For more information, see Retrieving Shards from a Stream in the Amazon Kinesis Data Streams Developer Guide.

There are no guarantees about the chronological order shards returned. To process shards in chronological order, use the ID of the parent shard to track the lineage to the oldest shard.

This operation has a limit of 10 transactions per second per account.

May throw AccessDeniedException. May throw InvalidArgumentException. May throw LimitExceededException. May throw ResourceNotFoundException.

Parameter exclusiveStartShardId : The shard ID of the shard to start with.

Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows ExclusiveStartShardId.

If you don't specify this parameter, the default behavior for DescribeStream is to describe the stream starting with the first shard in the stream.

Parameter limit : The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.

Parameter streamARN : The ARN of the stream.

Parameter streamId : Not Implemented. Reserved for future use.

Parameter streamName : The name of the stream to describe.

Implementation

Future<DescribeStreamOutput> describeStream({
  String? exclusiveStartShardId,
  int? limit,
  String? streamARN,
  String? streamId,
  String? streamName,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    10000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Kinesis_20131202.DescribeStream'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (exclusiveStartShardId != null)
        'ExclusiveStartShardId': exclusiveStartShardId,
      if (limit != null) 'Limit': limit,
      if (streamARN != null) 'StreamARN': streamARN,
      if (streamId != null) 'StreamId': streamId,
      if (streamName != null) 'StreamName': streamName,
    },
    endpoint: _resolveEndpoint(
      operationType: 'control',
      streamARN: streamARN,
      streamId: streamId,
    ),
  );

  return DescribeStreamOutput.fromJson(jsonResponse.body);
}