getUser method

Future<GetUserResponse> getUser({
  1. String? userName,
})

Retrieves information about the specified IAM user, including the user's creation date, path, unique ID, and ARN.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID used to sign the request to this API.

May throw NoSuchEntityException. May throw ServiceFailureException.

Parameter userName : The name of the user to get information about.

This parameter is optional. If it is not included, it defaults to the user making the request. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Implementation

Future<GetUserResponse> getUser({
  String? userName,
}) async {
  _s.validateStringLength(
    'userName',
    userName,
    1,
    128,
  );
  final $request = <String, dynamic>{};
  userName?.also((arg) => $request['UserName'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'GetUser',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['GetUserRequest'],
    shapes: shapes,
    resultWrapper: 'GetUserResult',
  );
  return GetUserResponse.fromXml($result);
}