enableKinesisStreamingDestination method

Future<KinesisStreamingDestinationOutput> enableKinesisStreamingDestination({
  1. required String streamArn,
  2. required String tableName,
})

Starts table data replication to the specified Kinesis data stream at a timestamp chosen during the enable workflow. If this operation doesn't return results immediately, use DescribeKinesisStreamingDestination to check if streaming to the Kinesis data stream is ACTIVE.

May throw InternalServerError. May throw LimitExceededException. May throw ResourceInUseException. May throw ResourceNotFoundException.

Parameter streamArn : The ARN for a Kinesis data stream.

Parameter tableName : The name of the DynamoDB table.

Implementation

Future<KinesisStreamingDestinationOutput> enableKinesisStreamingDestination({
  required String streamArn,
  required String tableName,
}) async {
  ArgumentError.checkNotNull(streamArn, 'streamArn');
  _s.validateStringLength(
    'streamArn',
    streamArn,
    37,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    3,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.EnableKinesisStreamingDestination'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StreamArn': streamArn,
      'TableName': tableName,
    },
  );

  return KinesisStreamingDestinationOutput.fromJson(jsonResponse.body);
}