describeStream method

Future<DescribeStreamOutput> describeStream({
  1. required String streamArn,
  2. String? exclusiveStartShardId,
  3. int? limit,
})

Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table. Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data.

May throw ResourceNotFoundException. May throw InternalServerError.

Parameter streamArn : The Amazon Resource Name (ARN) for the stream.

Parameter exclusiveStartShardId : The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation.

Parameter limit : The maximum number of shard objects to return. The upper limit is 100.

Implementation

Future<DescribeStreamOutput> describeStream({
  required String streamArn,
  String? exclusiveStartShardId,
  int? limit,
}) async {
  ArgumentError.checkNotNull(streamArn, 'streamArn');
  _s.validateStringLength(
    'streamArn',
    streamArn,
    37,
    1024,
    isRequired: true,
  );
  _s.validateStringLength(
    'exclusiveStartShardId',
    exclusiveStartShardId,
    28,
    65,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDBStreams_20120810.DescribeStream'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StreamArn': streamArn,
      if (exclusiveStartShardId != null)
        'ExclusiveStartShardId': exclusiveStartShardId,
      if (limit != null) 'Limit': limit,
    },
  );

  return DescribeStreamOutput.fromJson(jsonResponse.body);
}