tagResource method
Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
May throw ValidationException. May throw ResourceNotFoundException. May throw InvalidArnException. May throw TooManyTagsException. May throw InvalidTagsException. May throw ConcurrentModificationException.
Parameter resourceArn
:
The Amazon Resource Name (ARN) of the resource you want to add tags to.
Parameter tags
:
The tags you want to modify or add to the resource.
Implementation
Future<void> tagResource({
required String resourceArn,
required List<Tag> tags,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
ArgumentError.checkNotNull(tags, 'tags');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodePipeline_20150709.TagResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'resourceArn': resourceArn,
'tags': tags,
},
);
}