tagResource method

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

Creates a new Tag resource to represent a tag.

May throw NotFoundException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConflictException.

Parameter resourceArn : The resource ARN for the tag.

Parameter tags : The collection of tags. Each tag element is associated with a given resource.

Implementation

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