deleteStream method

Future<void> deleteStream({
  1. required String streamARN,
  2. String? currentVersion,
})

Deletes a Kinesis video stream and the data contained in the stream.

This method marks the stream for deletion, and makes the data in the stream inaccessible immediately.

To ensure that you have the latest version of the stream before deleting it, you can specify the stream version. Kinesis Video Streams assigns a version to each stream. When you update a stream, Kinesis Video Streams assigns a new version number. To get the latest stream version, use the DescribeStream API.

This operation requires permission for the KinesisVideo:DeleteStream action.

May throw ClientLimitExceededException. May throw InvalidArgumentException. May throw ResourceNotFoundException. May throw NotAuthorizedException. May throw VersionMismatchException. May throw ResourceInUseException.

Parameter streamARN : The Amazon Resource Name (ARN) of the stream that you want to delete.

Parameter currentVersion : Optional: The version of the stream that you want to delete.

Specify the version as a safeguard to ensure that your are deleting the correct stream. To get the stream version, use the DescribeStream API.

If not specified, only the CreationTime is checked before deleting the stream.

Implementation

Future<void> deleteStream({
  required String streamARN,
  String? currentVersion,
}) async {
  ArgumentError.checkNotNull(streamARN, 'streamARN');
  _s.validateStringLength(
    'streamARN',
    streamARN,
    1,
    1024,
    isRequired: true,
  );
  _s.validateStringLength(
    'currentVersion',
    currentVersion,
    1,
    64,
  );
  final $payload = <String, dynamic>{
    'StreamARN': streamARN,
    if (currentVersion != null) 'CurrentVersion': currentVersion,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/deleteStream',
    exceptionFnMap: _exceptionFns,
  );
}