listUserTags method
Lists the tags that are attached to the specified user. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM Identities in the IAM User Guide.
May throw NoSuchEntityException. May throw ServiceFailureException.
Parameter userName
:
The name of the IAM user whose tags you want to see.
This parameter accepts (through its regex pattern) a string of characters that consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-
Parameter marker
:
Use this parameter only when paginating results and only after you receive
a response indicating that the results are truncated. Set it to the value
of the Marker
element in the response that you received to
indicate where the next call should start.
Parameter maxItems
:
(Optional) Use this only when paginating results to indicate the maximum
number of items that you want in the response. If additional items exist
beyond the maximum that you specify, the IsTruncated
response
element is true
.
If you do not include this parameter, it defaults to 100. Note that IAM
might return fewer results, even when more results are available. In that
case, the IsTruncated
response element returns
true
, and Marker
contains a value to include in
the subsequent call that tells the service where to continue from.
Implementation
Future<ListUserTagsResponse> listUserTags({
required String userName,
String? marker,
int? maxItems,
}) async {
ArgumentError.checkNotNull(userName, 'userName');
_s.validateStringLength(
'userName',
userName,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'marker',
marker,
1,
320,
);
_s.validateNumRange(
'maxItems',
maxItems,
1,
1000,
);
final $request = <String, dynamic>{};
$request['UserName'] = userName;
marker?.also((arg) => $request['Marker'] = arg);
maxItems?.also((arg) => $request['MaxItems'] = arg);
final $result = await _protocol.send(
$request,
action: 'ListUserTags',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ListUserTagsRequest'],
shapes: shapes,
resultWrapper: 'ListUserTagsResult',
);
return ListUserTagsResponse.fromXml($result);
}