enableKinesisStreamingDestination method

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

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 InvalidEndpointException. 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. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.

Parameter enableKinesisStreamingConfiguration : The source for the Kinesis streaming information that is being enabled.

Implementation

Future<KinesisStreamingDestinationOutput> enableKinesisStreamingDestination({
  required String streamArn,
  required String tableName,
  EnableKinesisStreamingConfiguration? enableKinesisStreamingConfiguration,
}) async {
  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,
      if (enableKinesisStreamingConfiguration != null)
        'EnableKinesisStreamingConfiguration':
            enableKinesisStreamingConfiguration,
    },
    endpoint: _resolveEndpoint(
      resourceArn: tableName,
    ),
  );

  return KinesisStreamingDestinationOutput.fromJson(jsonResponse.body);
}