tagResource method

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

Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource are not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated with that resource are deleted as well.

May throw NotFoundException. May throw BadRequestException. May throw InternalServerErrorException.

Parameter resourceArn : The Amazon Resource Name (ARN) that identifies the AWS Elemental MediaConnect resource to which to add tags.

Parameter tags : A map from tag keys to values. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required Map<String, String> tags,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  ArgumentError.checkNotNull(tags, 'tags');
  final $payload = <String, dynamic>{
    'tags': tags,
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
    exceptionFnMap: _exceptionFns,
  );
}