deregisterStreamConsumer method

Future<void> deregisterStreamConsumer({
  1. String? consumerARN,
  2. String? consumerName,
  3. String? streamARN,
})

To deregister a consumer, provide its ARN. Alternatively, you can provide the ARN of the data stream and the name you gave the consumer when you registered it. You may also provide all three parameters, as long as they don't conflict with each other. If you don't know the name or ARN of the consumer that you want to deregister, you can use the ListStreamConsumers operation to get a list of the descriptions of all the consumers that are currently registered with a given data stream. The description of a consumer contains its name and ARN.

This operation has a limit of five transactions per second per stream.

May throw LimitExceededException. May throw ResourceNotFoundException. May throw InvalidArgumentException.

Parameter consumerARN : The ARN returned by Kinesis Data Streams when you registered the consumer. If you don't know the ARN of the consumer that you want to deregister, you can use the ListStreamConsumers operation to get a list of the descriptions of all the consumers that are currently registered with a given data stream. The description of a consumer contains its ARN.

Parameter consumerName : The name that you gave to the consumer.

Parameter streamARN : The ARN of the Kinesis data stream that the consumer is registered with. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Implementation

Future<void> deregisterStreamConsumer({
  String? consumerARN,
  String? consumerName,
  String? streamARN,
}) async {
  _s.validateStringLength(
    'consumerARN',
    consumerARN,
    1,
    2048,
  );
  _s.validateStringLength(
    'consumerName',
    consumerName,
    1,
    128,
  );
  _s.validateStringLength(
    'streamARN',
    streamARN,
    1,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Kinesis_20131202.DeregisterStreamConsumer'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (consumerARN != null) 'ConsumerARN': consumerARN,
      if (consumerName != null) 'ConsumerName': consumerName,
      if (streamARN != null) 'StreamARN': streamARN,
    },
  );
}