listRoleTags method

Future<ListRoleTagsResponse> listRoleTags({
  1. required String roleName,
  2. String? marker,
  3. int? maxItems,
})

Lists the tags that are attached to the specified role. 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 roleName : The name of the IAM role for which you want to see the list of tags.

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<ListRoleTagsResponse> listRoleTags({
  required String roleName,
  String? marker,
  int? maxItems,
}) async {
  ArgumentError.checkNotNull(roleName, 'roleName');
  _s.validateStringLength(
    'roleName',
    roleName,
    1,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    320,
  );
  _s.validateNumRange(
    'maxItems',
    maxItems,
    1,
    1000,
  );
  final $request = <String, dynamic>{};
  $request['RoleName'] = roleName;
  marker?.also((arg) => $request['Marker'] = arg);
  maxItems?.also((arg) => $request['MaxItems'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ListRoleTags',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ListRoleTagsRequest'],
    shapes: shapes,
    resultWrapper: 'ListRoleTagsResult',
  );
  return ListRoleTagsResponse.fromXml($result);
}