updateStreamMode method

Future<void> updateStreamMode({
  1. required String streamARN,
  2. required StreamModeDetails streamModeDetails,
  3. String? streamId,
  4. int? warmThroughputMiBps,
})

Updates the capacity mode of the data stream. Currently, in Kinesis Data Streams, you can choose between an on-demand capacity mode and a provisioned capacity mode for your data stream.

If you'd still like to proactively scale your on-demand data stream’s capacity, you can unlock the warm throughput feature for on-demand data streams by enabling MinimumThroughputBillingCommitment for your account. Once your account has MinimumThroughputBillingCommitment enabled, you can specify the warm throughput in MiB per second that your stream can support in writes.

May throw InvalidArgumentException. May throw LimitExceededException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter streamARN : Specifies the ARN of the data stream whose capacity mode you want to update.

Parameter streamModeDetails : Specifies the capacity mode to which you want to set your data stream. Currently, in Kinesis Data Streams, you can choose between an on-demand capacity mode and a provisioned capacity mode for your data streams.

Parameter streamId : Not Implemented. Reserved for future use.

Parameter warmThroughputMiBps : The target warm throughput in MB/s that the stream should be scaled to handle. This represents the throughput capacity that will be immediately available for write operations. This field is only valid when the stream mode is being updated to on-demand.

Implementation

Future<void> updateStreamMode({
  required String streamARN,
  required StreamModeDetails streamModeDetails,
  String? streamId,
  int? warmThroughputMiBps,
}) async {
  _s.validateNumRange(
    'warmThroughputMiBps',
    warmThroughputMiBps,
    0,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Kinesis_20131202.UpdateStreamMode'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StreamARN': streamARN,
      'StreamModeDetails': streamModeDetails,
      if (streamId != null) 'StreamId': streamId,
      if (warmThroughputMiBps != null)
        'WarmThroughputMiBps': warmThroughputMiBps,
    },
  );
}