addTagsToStream method

Future<void> addTagsToStream({
  1. required String streamName,
  2. required Map<String, String> tags,
})

Adds or updates tags for the specified Kinesis data stream. Each time you invoke this operation, you can specify up to 10 tags. If you want to add more than 10 tags to your stream, you can invoke this operation multiple times. In total, each stream can have up to 50 tags.

If tags have already been assigned to the stream, AddTagsToStream overwrites any existing tags that correspond to the specified tag keys.

AddTagsToStream has a limit of five transactions per second per account.

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

Parameter streamName : The name of the stream.

Parameter tags : A set of up to 10 key-value pairs to use to create the tags.

Implementation

Future<void> addTagsToStream({
  required String streamName,
  required Map<String, String> tags,
}) async {
  ArgumentError.checkNotNull(streamName, 'streamName');
  _s.validateStringLength(
    'streamName',
    streamName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Kinesis_20131202.AddTagsToStream'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StreamName': streamName,
      'Tags': tags,
    },
  );
}