tagResource method
Adds the specified tag to the specified index, FAQ, or data source resource. If the tag already exists, the existing value is replaced with the new value.
May throw ValidationException. May throw ResourceUnavailableException. May throw ThrottlingException. May throw AccessDeniedException. May throw InternalServerException.
Parameter resourceARN
:
The Amazon Resource Name (ARN) of the index, FAQ, or data source to tag.
Parameter tags
:
A list of tag keys to add to the index, FAQ, or data source. If a tag
already exists, the existing value is replaced with the new value.
Implementation
Future<void> tagResource({
required String resourceARN,
required List<Tag> tags,
}) async {
ArgumentError.checkNotNull(resourceARN, 'resourceARN');
_s.validateStringLength(
'resourceARN',
resourceARN,
1,
1011,
isRequired: true,
);
ArgumentError.checkNotNull(tags, 'tags');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSKendraFrontendService.TagResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceARN': resourceARN,
'Tags': tags,
},
);
}