tagResource method

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

Adds tags to a resource. A tag is a label you can assign to an Amazon Web Services resource. In Glue, you can tag only certain resources. For information about what resources you can tag, see Amazon Web Services Tags in Glue.

May throw EntityNotFoundException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException.

Parameter resourceArn : The ARN of the Glue resource to which to add the tags. For more information about Glue resource ARNs, see the Glue ARN string pattern.

Parameter tagsToAdd : Tags to add to this resource.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required Map<String, String> tagsToAdd,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      'TagsToAdd': tagsToAdd,
    },
  );
}