tagResource method
Tags a resource with user-supplied tags.
May throw BadRequestException. May throw NotFoundException. May throw LimitExceededException. May throw UnauthorizedException. May throw InternalFailureException. May throw AccessDeniedException.
Parameter resourceArn
:
The GraphqlApi
ARN.
Parameter tags
:
A TagMap
object.
Implementation
Future<void> tagResource({
required String resourceArn,
required Map<String, String> tags,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateStringLength(
'resourceArn',
resourceArn,
70,
75,
isRequired: true,
);
ArgumentError.checkNotNull(tags, 'tags');
final $payload = <String, dynamic>{
'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}