decreaseStreamRetentionPeriod method

Future<void> decreaseStreamRetentionPeriod({
  1. required int retentionPeriodHours,
  2. String? streamARN,
  3. String? streamId,
  4. String? streamName,
})

Decreases the Kinesis data stream's retention period, which is the length of time data records are accessible after they are added to the stream. The minimum value of a stream's retention period is 24 hours. This operation may result in lost data. For example, if the stream's retention period is 48 hours and is decreased to 24 hours, any data already in the stream that is older than 24 hours is inaccessible.

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

Parameter retentionPeriodHours : The new retention period of the stream, in hours. Must be less than the current retention period.

Parameter streamARN : The ARN of the stream.

Parameter streamId : Not Implemented. Reserved for future use.

Parameter streamName : The name of the stream to modify.

Implementation

Future<void> decreaseStreamRetentionPeriod({
  required int retentionPeriodHours,
  String? streamARN,
  String? streamId,
  String? streamName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Kinesis_20131202.DecreaseStreamRetentionPeriod'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RetentionPeriodHours': retentionPeriodHours,
      if (streamARN != null) 'StreamARN': streamARN,
      if (streamId != null) 'StreamId': streamId,
      if (streamName != null) 'StreamName': streamName,
    },
  );
}