tagResource method
Add tags to an accelerator resource.
For more information, see Tagging in AWS Global Accelerator in the AWS Global Accelerator Developer Guide.
May throw AcceleratorNotFoundException. May throw InternalServiceErrorException. May throw InvalidArgumentException.
Parameter resourceArn
:
The Amazon Resource Name (ARN) of the Global Accelerator resource to add
tags to. An ARN uniquely identifies a resource.
Parameter tags
:
The tags to add to a resource. A tag consists of a key and a value that
you define.
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': 'GlobalAccelerator_V20180706.TagResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceArn': resourceArn,
'Tags': tags,
},
);
}