listTags method
Returns a list of key-value pairs assigned to a target recovery point, backup plan, or backup vault.
May throw ResourceNotFoundException. May throw InvalidParameterValueException. May throw MissingParameterValueException. May throw ServiceUnavailableException.
Parameter resourceArn
:
An Amazon Resource Name (ARN) that uniquely identifies a resource. The
format of the ARN depends on the type of resource. Valid targets for
ListTags
are recovery points, backup plans, and backup
vaults.
Parameter maxResults
:
The maximum number of items to be returned.
Parameter nextToken
:
The next item following a partial list of returned items. For example, if
a request is made to return maxResults
number of items,
NextToken
allows you to return more items in your list
starting at the location pointed to by the next token.
Implementation
Future<ListTagsOutput> listTags({
required String resourceArn,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}/',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListTagsOutput.fromJson(response);
}