listTagsOfResource method

Future<ListTagsOfResourceOutput> listTagsOfResource({
  1. required String resourceArn,
  2. String? nextToken,
})

List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource up to 10 times per second, per account.

For an overview on tagging DynamoDB resources, see Tagging for DynamoDB in the Amazon DynamoDB Developer Guide.

May throw ResourceNotFoundException. May throw InternalServerError.

Parameter resourceArn : The Amazon DynamoDB resource with tags to be listed. This value is an Amazon Resource Name (ARN).

Parameter nextToken : An optional string that, if supplied, must be copied from the output of a previous call to ListTagOfResource. When provided in this manner, this API fetches the next page of results.

Implementation

Future<ListTagsOfResourceOutput> listTagsOfResource({
  required String resourceArn,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    1283,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.ListTagsOfResource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListTagsOfResourceOutput.fromJson(jsonResponse.body);
}