listTagsForResource method
Returns tags for a resource. Tagging is currently supported only for directories with a limit of 50 tags per directory. All 50 tags are returned for a given directory with this API call.
May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw InvalidTaggingRequestException.
Parameter resourceArn
:
The Amazon Resource Name (ARN) of the resource. Tagging is only supported
for directories.
Parameter maxResults
:
The MaxResults
parameter sets the maximum number of results
returned in a single page. This is for future use and is not supported
currently.
Parameter nextToken
:
The pagination token. This is for future use. Currently pagination is not
supported for tagging.
Implementation
Future<ListTagsForResourceResponse> listTagsForResource({
required String resourceArn,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateNumRange(
'maxResults',
maxResults,
50,
1152921504606846976,
);
final $payload = <String, dynamic>{
'ResourceArn': resourceArn,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/amazonclouddirectory/2017-01-11/tags',
exceptionFnMap: _exceptionFns,
);
return ListTagsForResourceResponse.fromJson(response);
}