tagStream method

Future<void> tagStream({
  1. required Map<String, String> tags,
  2. String? streamARN,
  3. String? streamName,
})

Adds one or more tags to a stream. A tag is a key-value pair (the value is optional) that you can define and assign to AWS resources. If you specify a tag that already exists, the tag value is replaced with the value that you specify in the request. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

You must provide either the StreamName or the StreamARN.

This operation requires permission for the KinesisVideo:TagStream action.

Kinesis video streams support up to 50 tags.

May throw ClientLimitExceededException. May throw InvalidArgumentException. May throw ResourceNotFoundException. May throw NotAuthorizedException. May throw InvalidResourceFormatException. May throw TagsPerResourceExceededLimitException.

Parameter tags : A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional).

Parameter streamARN : The Amazon Resource Name (ARN) of the resource that you want to add the tag or tags to.

Parameter streamName : The name of the stream that you want to add the tag or tags to.

Implementation

Future<void> tagStream({
  required Map<String, String> tags,
  String? streamARN,
  String? streamName,
}) async {
  ArgumentError.checkNotNull(tags, 'tags');
  _s.validateStringLength(
    'streamARN',
    streamARN,
    1,
    1024,
  );
  _s.validateStringLength(
    'streamName',
    streamName,
    1,
    256,
  );
  final $payload = <String, dynamic>{
    'Tags': tags,
    if (streamARN != null) 'StreamARN': streamARN,
    if (streamName != null) 'StreamName': streamName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/tagStream',
    exceptionFnMap: _exceptionFns,
  );
}