listTagsForResource method

Future<ListTagsForResourceResponse> listTagsForResource({
  1. required String resourceId,
  2. required TagResourceType resourceType,
})

Lists tags for one health check or hosted zone.

For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

May throw InvalidInput. May throw NoSuchHealthCheck. May throw NoSuchHostedZone. May throw PriorRequestNotComplete. May throw ThrottlingException.

Parameter resourceId : The ID of the resource for which you want to retrieve tags.

Parameter resourceType : The type of the resource.

  • The resource type for health checks is healthcheck.
  • The resource type for hosted zones is hostedzone.

Implementation

Future<ListTagsForResourceResponse> listTagsForResource({
  required String resourceId,
  required TagResourceType resourceType,
}) async {
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  _s.validateStringLength(
    'resourceId',
    resourceId,
    0,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceType, 'resourceType');
  final $result = await _protocol.send(
    method: 'GET',
    requestUri:
        '/2013-04-01/tags/${Uri.encodeComponent(resourceType.toValue())}/${Uri.encodeComponent(resourceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return ListTagsForResourceResponse.fromXml($result.body);
}